Hardware Reference
In-Depth Information
Servo myServo; // create a servo object
void setup() {
myServo.attach(9);
}
servo.write
Sets the position of a servo motor. See “Controlling Servos” on page 55 .
Syntax
myServo.write(angle);
Parameters
angle
The angle to set on the servo, from 0 to 180
myServo
Represents any servo object
Return value
None.
Example
Servo myServo; // create a servo object
void setup() {
myServo.attach(9);
myServo.write(90);
}
setup
A required function in every Arduino sketch. This is the block of code that's
executed once when your Galileo is booted. See “Setup and Loop” on page
26 .
Example
void setup() {
// The code here will be executed once
// when the board is booted.
}
void loop() {
// The code here will be executed
// repeatedly after setup() is executed.
}
Search WWH ::




Custom Search