Thursday, April 28, 2011
Monday, April 18, 2011
Monday, April 11, 2011
adafruit library
#include
AF_DCMotor motor(4); //setting the enable to pin 4
int sensorPin = 5;
int i = 0;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("speed test! "); // serial monitor start
motor.setSpeed(i);
motor.run(RELEASE);
}
void loop() {
i = analogRead(sensorPin);
i = map(i, 0, 1024, 0, 255);
motor.setSpeed(i);
Serial.println(i);
motor.run(FORWARD);
delay(10);
motor.run(RELEASE);
delay(10);
}
AF_DCMotor motor(4); //setting the enable to pin 4
int sensorPin = 5;
int i = 0;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("speed test! "); // serial monitor start
motor.setSpeed(i);
motor.run(RELEASE);
}
void loop() {
i = analogRead(sensorPin);
i = map(i, 0, 1024, 0, 255);
motor.setSpeed(i);
Serial.println(i);
motor.run(FORWARD);
delay(10);
motor.run(RELEASE);
delay(10);
}
Subscribe to:
Posts (Atom)