(Created page with "category:Scratch for Arduino")
 
Line 1: Line 1:
 
[[category:Scratch for Arduino]]
 
[[category:Scratch for Arduino]]
 +
 +
'''Aim:''' Display RGB color with LED
 +
 +
[[Image:Arduino_Interface_RGB_LED.JPG||680px]]
 +
 +
 +
'''Digital 11,12,13''' are here defined as  led '''output'''
 +
 +
[[image:3led.png||680px]]
 +
 +
 
 +
 +
The program starts when the '''green flag''' is pressed.
 +
-When the key '''a''' is pressed, the LED which is connected to the '''digital 11'''
 +
will start blinking for 10 time with a '''1 sec ''' delay timing.
 +
-When key '''q''' is pressed the LED of '''digital 12''' will in turn get activated for
 +
the same amount of time.
 +
-when '''m''' is pressed the message '''stop''' is broadcasted which calls another function
 +
to turn all LEDs '''OFF''' before to '''stop all scripts'''.
 +
When '''p''' is pressed all three (3) color will successively turn '''ON''' and '''OFF''' continually.
 +
 
 +
'''''Notice'''''
 +
The LED is a common anode Led therefore  when it receives '''0''' it will '''turn ON ''' and when it receives'''1''' will '''turn OFF'''

Revision as of 20:49, 12 January 2015


Aim: Display RGB color with LED

Arduino Interface RGB LED.JPG


Digital 11,12,13 are here defined as led output

3led.png


The program starts when the green flag is pressed.
-When the key a is pressed, the LED which is connected to the digital 11
will start blinking for 10 time with a 1 sec  delay timing.
-When key q is pressed the LED of digital 12 will in turn get activated for 
the same amount of time.
-when m is pressed the message stop is broadcasted which calls another function
to turn all LEDs OFF before to stop all scripts.
When p is pressed all three (3) color will successively turn ON and OFF continually.
 

Notice

The LED is a common anode Led therefore  when it receives 0 it will turn ON  and when it receives1 will turn OFF