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
seriale2
introduction
This is another example. It can be used with
Processing
program
apri il programma
inizia il laboratorio
algorithm
attrezzaggio
pin2
_blue_led
variabili
X
=
0
ciclo
write the serial input on variable
X
IF HAPPENS THAT
X
is equal to
1
SWITCH ON (5 Volt)
_blue_led
IF HAPPENS THAT
X
is equal to
0
SWITCH OFF (0 Volt)
_blue_led
wait
100
milliseconds
Arduino code
//programma: seriale2 //******* pin ******** //******* declare ******** const int pin_blue_led=2;//pin of _blue_led int X=0;//declares the variable //********** setup ********** void setup(){ Serial.begin(9600); // Initialize the serial port pinMode(pin_blue_led,OUTPUT); } //********** loop ********** void loop() { X=Serial.read(); if(X==1){ digitalWrite(pin_blue_led,HIGH); // HIGH/LOW is the voltage 5V/0V) } if(X==0){ digitalWrite(pin_blue_led,LOW); // HIGH/LOW is the voltage 5V/0V) } delay(100);//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