User:Stonestone/TIB
< User:Stonestone
Revision as of 14:29, 22 January 2016 by Stonestone (talk | contribs)
LED testing #1
Documentation
Codes
int r1 = 13 ;
int r2 = 12 ;
int r3 = 11 ;
int r4 = 10 ;
int r5 = 9 ;
int r6 = 8 ;
int r7 = 4 ;
int r8 = 3 ;
int r9 = 2 ;
int d = random(300);
void setup() {
pinMode(r1, OUTPUT);
pinMode(r2, OUTPUT);
pinMode(r3, OUTPUT);
pinMode(r4, OUTPUT);
pinMode(r5, OUTPUT);
pinMode(r6, OUTPUT);
pinMode(r7, OUTPUT);
pinMode(r8, OUTPUT);
pinMode(r9, OUTPUT);
}
void loop(){
digitalWrite(r1,HIGH);
delay(d);
digitalWrite(r1,LOW);
digitalWrite(r2,HIGH);
delay(d);
digitalWrite(r2,LOW);
digitalWrite(r3,HIGH);
delay(d);
digitalWrite(r3,LOW);
digitalWrite(r4,HIGH);
delay(d);
digitalWrite(r4,LOW);
digitalWrite(r5,HIGH);
delay(d);
digitalWrite(r5,LOW);
digitalWrite(r6,HIGH);
delay(d);
digitalWrite(r6,LOW);
digitalWrite(r7,HIGH);
delay(d);
digitalWrite(r7,LOW);
digitalWrite(r8,HIGH);
delay(d);
digitalWrite(r8,LOW);
digitalWrite(r9,HIGH);
delay(d);
digitalWrite(r9,LOW);
}
Problem
- 3/4 lights cannot work well. I guess it is because of the connection problem.
- Stupid Codes.