]> git.piffa.net Git - sketchbook_andrea/blobdiff - motors/simple_motor_transistor_diode_0/simple_motor_transistor_diode_0.ino
motori e diodi
[sketchbook_andrea] / motors / simple_motor_transistor_diode_0 / simple_motor_transistor_diode_0.ino
index 5b86a2bf7250152e875423bcaa4812d108c4c251..c2709f593c554e83fd536ba53c97ff7d1545fc97 100644 (file)
@@ -1,21 +1,27 @@
 /* Simple Motor
- This sketch use a transistor and a diode
- in order to power a 5v ~150mAh directly from the board.
- Hard thing is to find a suitable motor!
 
- In order to power a more powerfull motor you need to connect
- the transistor to an other power line. 
+Gestione di un motore DC tramite Arduino.
+Elementi richiesti:
+
+- motore DC a 5v per ~300ma
+- transistor NPN 2N2222
+- diodo 1N4001
+ Schemi:
+ - Breadboard: http://lab.piffa.net/schemi/motor_transistor_diode_bb.png
+ - Schema circuito: http://lab.piffa.net/schemi/motor_transistor_diode_schem.png
  */
 
-int motorPin = 9;
+int motorPin = 9; // Pin tramite cui Arduino controlla il motore
 void setup() {
-  pinMode(motorPin, OUTPUT); // We drive the motor just like a LED
+  pinMode(motorPin, OUTPUT); 
 }
 
 void loop() {
-  digitalWrite(motorPin, HIGH); // Turn on the motor full throttle
+  digitalWrite(motorPin, HIGH); // Accende il motore a tutta potenza
   delay(1000);
-  digitalWrite(motorPin, LOW);  // Turn off motor
+  digitalWrite(motorPin, LOW);  // Spegne il motore
   delay(5000);
 }