Wednesday, October 23, 2013

Arduino mini project-Traffic light


For this mini project, things are simple and straight forward, simply tell the LED when to turn on and off, its a things that I could write the program on my own but I still decided to post it because my final idea has something to do with this sort of layout, and it does give me idea of how am I going to approach it in a better way.

code for this project:

int ledred=10; 
int ledyellow=7; 
int ledgreen=4; 

void setup()
{

 pinMode(ledred,OUTPUT);
 pinMode(ledyellow,OUTPUT);
 pinMode(ledgreen,OUTPUT);

}

void loop() {


digitalWrite(ledred,HIGH);
 delay(1000);
digitalWrite(ledred,LOW);
digitalWrite(ledyellow,HIGH); 
delay(200);
digitalWrite(ledyellow,LOW);
digitalWrite(ledgreen,HIGH);
delay(1000);
digitalWrite(ledgreen,LOW);

)










Thursday, October 17, 2013

Arduino mini project-74HC595

In this particular  mini project, Im learning the use of a dedicated micro-controller which is labelled 74HC595, for this chip has 8 bit register and memory, it does something quite useful when you have too many things to control at once while only having one board. 

In this case im controlling 8 LEDs at the same time, if i would do it the other way, my Arduino board wold be full of wires and hard to use, this is when the extra microchip comes handy, I am able to use only 4 pins to control 8 LEDs with the help of 74HC595, although this isnt something I would use for my final outcome but its always great to learn new skills, it would be useful some day.