User:Stonestone/TIB: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with " <div style="width:80%; font-family:Courier; padding:2px; float:center;font-size:15;background:#FFFFE0; border:1px solid black"> == LED testing #1 == === Documentation === [...")
 
No edit summary
Line 4: Line 4:


=== Documentation ===
=== Documentation ===
[[File:LED101.PNG|center|thumb|400px|N1]][[File:LED102.PNG|center|thumb|400px|N1]]<br />
[[File:LED101.png|center|thumb|400px|N1]][[File:LED102.png|center|thumb|400px|N1]]<br />
{{youtube|fANXUHP56Os|center|thumb|400px|LED1}}  <br />
{{youtube|fANXUHP56Os|center|thumb|400px|LED1}}  <br />
=== Codes ===
=== Codes ===

Revision as of 14:29, 22 January 2016

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

  1. 3/4 lights cannot work well. I guess it is because of the connection problem.
  2. Stupid Codes.