PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
Devices
Motor
Servo
Standard Servo Position.c
1
/*
2
Standard Servo Position.c
3
4
Moves servo to 0, 90 and 180 degrees. Holds each position for 2 s.
5
Connect servo to P16 port on Propeller Activity Board.
6
7
http://learn.parallax.com/propeller-c-simple-devices/standard-servo
8
*/
9
10
#include "simpletools.h"
// Include simpletools header
11
#include "servo.h"
// Include servo header
12
13
int
main
()
// main function
14
{
15
servo_angle(16, 0);
// P16 servo to 0 degrees
16
pause(3000);
// ...for 3 seconds
17
servo_angle(16, 900);
// P16 servo to 90 degrees
18
pause(3000);
// ...for 3 seconds
19
servo_angle(16, 1800);
// P16 servo to 180 degrees
20
pause(3000);
// ...for 3 seconds
21
servo_stop();
// Stop servo process
22
}
23
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12