Kita akan belajar membuat rangkaian dan pogram arduino lampu Srobo.
Wiring diagram dan bahan-bahan:
Dibawah ini adalah coding untuk arduino:
-
COPY CODING DI BAWAH INIint led1 =1; sint led2 = 2; void setup(){ pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); } void loop(){ digitalWrite(led1, HIGH); delay(60); digitalWrite(led1, LOW); delay(60); digitalWrite(led1, HIGH); delay(60); digitalWrite(led1, LOW); delay(60); digitalWrite(led1, HIGH); delay(60); digitalWrite(led1, LOW); delay(60); digitalWrite(led1, HIGH); delay(60); digitalWrite(led1, LOW); digitalWrite(led2, HIGH); delay(60); digitalWrite(led2, LOW); delay(60); digitalWrite(led2, HIGH); delay(60); digitalWrite(led2, LOW); delay(60); digitalWrite(led2, HIGH); delay(60); digitalWrite(led2, LOW); delay(60); digitalWrite(led2, HIGH); delay(60); digitalWrite(led2, LOW); }