Fritzinn and Arduino to control a bi-color LED with PWM
- Download Fritzing executable Binary for your system (Arch 64 in my case)
-
Start Fritzing and design your wiring as shown (Breadboard Tab)
-
set up Arduino IDE path if needed in Fritzing preference
-
use firmata_test to check the wiring is working (upload StandardFirmata first)
-
go to Code view in Fritzing, input testing code, save, choose the correct Platform, Board, Port, and then Upload.
-
By uploading the sample code from here, you should see a fading in/out of bi-color led.
123456789101112131415161718192021222324252627282930313233343536int light;int ledPin1 = 11;int ledPin2 = 10;void setup(){pinMode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);}void loop(){for(light=0; light <255; light=light+5){analogWrite(ledPin1, light);delay(20);}for(light=255; light >0; light=light-5){analogWrite(ledPin1, light);delay(20);}for(light=0; light <=255; light=light+5){analogWrite(ledPin2, light);delay(20);}for(light=255; light >=0; light=light-5){analogWrite(ledPin2, light);delay(20);}}
9
MAY
MAY
About the Author:
Beyond 8 hours - Computer, Sports, Family...