22
22
Program
int value = 0;
// a variable that contains the value to get analog input read
int motor = 10;
// motor connected to PIN 10
int potentiometer = 0 ;
// Set the analogue input
void setup(){
// Not necessary
void loop(){
value = analogRead (potentiometer);
// reads the value of the analog input
and allocates val
analogWrite (motor, value);
// The read value is sent to the analog output 0
delay (30);
// wait 30 ms to make visible the effect
}