Devices & Components
Arduino Uno Rev3
LED (generic)
Jumper wires (generic)
Breadboard (generic)
Resistor 330 ohm
Project description
Code
Cat Blinker
javascript
This is a blinking red light. Your cat may or may not be attracted to it. All you need is a power source and after you plug it in it will work.
1void setup() { 2 // initialize digital pin LED_BUILTIN as an output. 3 pinMode(LED_BUILTIN, OUTPUT); 4} 5 6// the loop function runs over and over again forever 7void loop() { 8 digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) 9 delay(300); // wait for a second 10 digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW 11 delay(300); // wait for a second 12} 13
Cat Blinker
javascript
This is a blinking red light. Your cat may or may not be attracted to it. All you need is a power source and after you plug it in it will work.
1void setup() { 2 // initialize digital pin LED_BUILTIN as an output. 3 4 pinMode(LED_BUILTIN, OUTPUT); 5} 6 7// the loop function runs over and over 8 again forever 9void loop() { 10 digitalWrite(LED_BUILTIN, HIGH); // turn the 11 LED on (HIGH is the voltage level) 12 delay(300); // wait 13 for a second 14 digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making 15 the voltage LOW 16 delay(300); // wait for a second 17} 18
Downloadable files
diagram
diagram
Comments
Only logged in users can leave comments