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

sensori

introduction

If the ambient light is low turn on one red light ... if it is higher two leds... if it's strong three leds. Let's try this:

from 0 to 80 -> 1 led
from 80 to 160 -> 2 leds
from 160 to 250 -> 3 leds


program

Arduino apri il programma


Arduino inizia il laboratorio

algorithm


attrezzaggio

pin1 ledrosso Arduino _led1
pin2 ledrosso Arduino _led2
pin3˜ ledrosso Arduino _led3
pinA0 luce Arduino _sensorlight

variabili

A = 0

ciclo

the variable A is equal to... read the sensor: _sensorlight
IF HAPPENS THAT A is less than 80
SWITCH ON (5 Volt) switch on _led1 component
SWITCH OFF   (0 Volt) switch off _led2 component
SWITCH OFF   (0 Volt) switch off _led3 component
IF HAPPENS THAT A is greater than 80 and even IF A is less than 0
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led2 component
SWITCH OFF   (0 Volt) switch off _led3 component
IF HAPPENS THAT A is greater than 160
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led2 component
SWITCH ON (5 Volt) switch on _led3 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