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

senza_titolo

introduction

Arduino We carry out an electronic dice with seven LEDs
after an intervals of 5 seconds takes a random score.

Handworking: you can create an elegant wooden dice. Make seven 5mm holes in which to insert the LEDs.
The LEDs we number them in this way:
Arduino

program

Arduino apri il programma


Arduino inizia il laboratorio

algorithm


attrezzaggio

pin7 ledblu Arduino _led7
pin6˜ ledblu Arduino _led6
pin5˜ ledblu Arduino _led5
pin4 ledblu Arduino _led4
pin3˜ ledblu Arduino _led3
pin2 ledblu Arduino _led2
pin1 ledblu Arduino _led1

variabili

X = 0

ciclo

dado Arduino the variable X becames equal to a casual number included between 1 e 6
IF HAPPENS THAT X is equal to 1
SWITCH ON (5 Volt) switch on _led7 component
IF HAPPENS THAT X is equal to 2
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led6 component
IF HAPPENS THAT X is equal to 3
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led7 component
SWITCH ON (5 Volt) switch on _led6 component
IF HAPPENS THAT X is equal to 4
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led4 component
SWITCH ON (5 Volt) switch on _led3 component
SWITCH ON (5 Volt) switch on _led6 component
IF HAPPENS THAT X is equal to 5
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led4 component
SWITCH ON (5 Volt) switch on _led3 component
SWITCH ON (5 Volt) switch on _led6 component
SWITCH ON (5 Volt) switch on _led7 component
IF HAPPENS THAT X is equal to 6
SWITCH ON (5 Volt) switch on _led1 component
SWITCH ON (5 Volt) switch on _led2 component
SWITCH ON (5 Volt) switch on _led3 component
SWITCH ON (5 Volt) switch on _led4 component
SWITCH ON (5 Volt) switch on _led5 component
SWITCH ON (5 Volt) switch on _led6 component
wait 5000 milliseconds



SWITCH OFF   (0 Volt) switch off _led1 component
SWITCH OFF   (0 Volt) switch off _led2 component
SWITCH OFF   (0 Volt) switch off _led3 component
SWITCH OFF   (0 Volt) switch off _led4 component
SWITCH OFF   (0 Volt) switch off _led5 component
SWITCH OFF   (0 Volt) switch off _led6 component
SWITCH OFF   (0 Volt) switch off _led7 component
wait 3000 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