Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo arm;
- int ch5;
- int val;
- void setup() {
- // put your setup code here, to run once:
- arm.attach(9);
- pinMode(10, INPUT);
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- ch5 = pulseIn(10, HIGH, 25000);
- val = map(ch5, 984, 1968, 0, 180);
- val = constrain(val, 0, 180);
- arm.write(val);
- delay(15);
- Serial.print("Channel 5:");
- Serial.println(val);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement