pages
home
compiler
code compiler
electronics
notes about electronics
laboratory
laboratory
Processing
Processing code compiler
Theremino
Theremino code compiler
logggin
accedi o esci
tutorials Arduino
lights
my first led turns on
led's games
an electronic dice
traffic lights
candle effect
fading effect
red-green-blue 1
red-green-blue 2
7-segment display - Countdown
7-segment display bis
sensors
sensors
Sensor and serial port
sensor PIR
ultrasonic sensor
sound
Theremin
a melody
build a note
switches
buttons
keypad
input via serial port
input via serial port 2
input remote control
input remote control 2
use of variables
custom functions
servos
a robot
a remote-controlled robot
elettronica
mechanics
Italian
handbook
pins
connections
resistors
remarkable sketches
remarkable circuits
Arduino pins
error messages
tables
colour's tables
electrical simbols
referenze on-line
reference Arduino
reference Processing
link
www.arduino.cc
fritzing.org/projects
processing.org
links
hardware
base kit
facilitated kits
advanced kits
Theremino
begins the workshop
review a workshop carried out
my account
info
link
contacts
rgb2
introduction
let's try to create the colors
program
apri il programma
inizia il laboratorio
algorithm
attrezzaggio
pin3˜
_RGBblue1
pin5˜
_RGBgreen1
pin6˜
_RGBred1
variabili
ciclo
annotation: red
MODULATION
_RGBred1
to the value:
255
MODULATION
_RGBgreen1
to the value:
0
MODULATION
_RGBblue1
to the value:
0
wait
2000
milliseconds
annotation: dark red
MODULATION
_RGBred1
to the value:
80
MODULATION
_RGBgreen1
to the value:
0
MODULATION
_RGBblue1
to the value:
0
wait
2000
milliseconds
annotation: blue
MODULATION
_RGBred1
to the value:
0
MODULATION
_RGBgreen1
to the value:
0
MODULATION
_RGBblue1
to the value:
255
wait
2000
milliseconds
annotation: yellow
MODULATION
_RGBred1
to the value:
255
MODULATION
_RGBgreen1
to the value:
255
MODULATION
_RGBblue1
to the value:
0
wait
2000
milliseconds
annotation: orange
MODULATION
_RGBred1
to the value:
255
MODULATION
_RGBgreen1
to the value:
80
MODULATION
_RGBblue1
to the value:
0
wait
2000
milliseconds
annotation: white
MODULATION
_RGBred1
to the value:
255
MODULATION
_RGBgreen1
to the value:
255
MODULATION
_RGBblue1
to the value:
255
wait
2000
milliseconds
Arduino code
//programma: rgb2 //******* pin ******** //******* declare ******** const int pin_RGBblue1=3;//pin of _RGBblue1 const int pin_RGBgreen1=5;//pin of _RGBgreen1 const int pin_RGBred1=6;//pin of _RGBred1 //********** setup ********** void setup(){ pinMode(pin_RGBblue1,OUTPUT); pinMode(pin_RGBgreen1,OUTPUT); pinMode(pin_RGBred1,OUTPUT); } //********** loop ********** void loop() { // red analogWrite(pin_RGBred1,255); analogWrite(pin_RGBgreen1,0); analogWrite(pin_RGBblue1,0); delay(2000);//attendi // dark_red analogWrite(pin_RGBred1,80); analogWrite(pin_RGBgreen1,0); analogWrite(pin_RGBblue1,0); delay(2000);//attendi // blue analogWrite(pin_RGBred1,0); analogWrite(pin_RGBgreen1,0); analogWrite(pin_RGBblue1,255); delay(2000);//attendi // yellow analogWrite(pin_RGBred1,255); analogWrite(pin_RGBgreen1,255); analogWrite(pin_RGBblue1,0); delay(2000);//attendi // orange analogWrite(pin_RGBred1,255); analogWrite(pin_RGBgreen1,80); analogWrite(pin_RGBblue1,0); delay(2000);//attendi // white analogWrite(pin_RGBred1,255); analogWrite(pin_RGBgreen1,255); analogWrite(pin_RGBblue1,255); delay(2000);//attendi };//end loop //powered by "Arduinomio" (C) //www.mastrohora.it
copy/past in Arduino
electrical connections
here Fritzing's file
logout
Ultima modifica: Agosto 2016