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 with Ramping.c
1
/*
2
Standard Servo with Ramping.c
3
4
Moves servo to 0, 90 and 180 degrees. Uses ramping to gradually move the
5
servo to the target.
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(500);
// Allow 1/2 second to get there
17
servo_setramp(16, 7);
// Change by up to 7/10 degree/20 ms
18
servo_angle(16, 1800);
// P16 servo to 180 degrees
19
pause(6000);
// Allow 6 seconds to get there
20
// (with ramping in effect)
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