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
seriale1
introduction
Open the serial monitor
I want to turn on a led by serial port
program
apri il programma
inizia il laboratorio
algorithm
attrezzaggio
pin3˜
_red_led
variabili
X
=
0
ciclo
write the serial input on variable
X
MODULATION
_red_led
to the value:
X
IF HAPPENS THAT
X
is greater than
255
the variable
X
is equal to
255
wait
100
milliseconds
Arduino code
//programma: seriale1 //******* pin ******** //******* declare ******** const int pin_red_led=3;//pin of _red_led int X=0;//declares the variable //********** setup ********** void setup(){ Serial.begin(9600); // Initialize the serial port pinMode(pin_red_led,OUTPUT); } //********** loop ********** void loop() { X=Serial.read(); analogWrite(pin_red_led,X); if(X>255){ X=255; } 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