EasyManua.ls Logo

Intel Galileo

Intel Galileo
34 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Hardware 26
Hardware
After telling the Galileo that we want to go backwards, we have to set the speed. Our total program, forward,
stop, back, stop, looks like this:
voidsetup(){
}
voidloop(){
motor.run(FORWARD);
motor.setSpeed(125);//halfspeed
delay(1000);//goforwardfor1second
motor.run(RELEASE);
delay(500);//stopforhalfasecond
motor.run(BACKWARD);
motor.setSpeed(255);//fullspeedbackwards
delay(1000);//gobackwardsforasecond
motor.run(RELEASE);
delay(500);//stopforhalfasecond
}
voidloop(){
motor.run(FORWARD); //prepare to go
forward
motor.setSpeed(125); //go around half
speed
delay(1000);//goforwardfor1second
(1000milliseconds
motor.run(RELEASE);//stopthemotor
delay(1000); //stop the motor for 1
second
}
Again, test this program to make sure it works.
The last thing we need is to tell the motor to go backwards. We tell the Galileo that we want to go backwards
by typing:
motor.run(BACKWARD);

Other manuals for Intel Galileo

Related product manuals