TIMSP430
Breadboard
Sufficient Wire
4 LEDs
4 Resistors between 200-500 Ohms, 220 is ideal
Demonstrating MSP430 Flashing LED:
Demonstrating LED Flashing Band (Nightrider)
void setup()
{
pinMode(6,OUTPUT); //Initialize Digital Pin 6 as an output
pinMode(7,OUTPUT); //Initialize Digital Pin 7 as an output
pinMode(8,OUTPUT); //Initialize Digital Pin 8 as an output
pinMode(9,OUTPUT); //Initialize Digital Pin 9 as an output
}
void loop()
{
digitalWrite(6,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(6,LOW); //Set LED Off
digitalWrite(7,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(7,LOW); //Set LED Off
digitalWrite(8,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(8,LOW); //Set LED Off
digitalWrite(9,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(9,LOW); //Set LED Off
digitalWrite(8,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(8,LOW); //Set LED Off
digitalWrite(7,HIGH); //Set LED On
delay(100); //Wait for 1000 ms (1 second)
digitalWrite(7,LOW); //Set LED Off
}
No comments:
Post a Comment