pages
home
compiler logo
code compiler
electronics
notes about electronics
laboratory
laboratory
Processing logo
Processing code compiler
Theremino logo
Theremino code compiler
logggin Arduino
accedi o esci

tutorials Arduino

lights Arduino

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

inglese Italian

handbook

pins

connections

resistors

Scarica Adobe Flash Player

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

Arduino begins the workshop

review a workshop carried out

my account

info

link

contacts

serialesensore

introduction

Very important to know values detected by a sensor.   Arduino
It can be used to verify if it works, how it works, which values returns

The yellow LED on pin 13 is set by default. There is in fact one little LED connected to pin 13. We should use it then! Here, in this example, just to indicate the moment in which the brightness is detected by the sensor.


click here to open the serial monitor of the Arduino IDE. Arduino

program

Arduino apri il programma


Arduino inizia il laboratorio

algorithm


attrezzaggio

pinA0 genericosensore Arduino _generic_sensor
pin13 ledgiallo Arduino _led_13

variabili

_value = 0
previous_value = 0

ciclo

annotation: write the value of a sensor on the serial port
the variable _value is equal to... read the sensor: _generic_sensor
IF HAPPENS THAT _value is not equal to previous_value
USB Arduino write on the serial: valore_del_sensore_--> _value
the variable previous_value is equal to _value
SWITCH ON (5 Volt) switch on _led_13 component
wait 500 milliseconds
SWITCH OFF   (0 Volt) switch off _led_13 component
wait 500 milliseconds

Arduino code

Arduino

copy/past in Arduino

electrical connections

Arduino
Fritzing here Fritzing's file


indietro torna all'indice avanti esci logout Licenza Creative Commons

Ultima modifica: Agosto 2016