onServo: Set servo

Description Usage Arguments Examples

View source: R/functions.R

Description

Activate a servo and set a value

Usage

1
onServo(pin, value)

Arguments

pin

the number of the pin connected to the servo

value

value to set for the servo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
rduinoConnect()
# set position of servo to position of potentiometer
off<-getDpin(4)
while (!off) 
{
  angle<-getApin(5)
  angle<- 1.68 * angle + 575
  setServo(9,angle)
  off<-getDpin(4)
}
offServo()
 
rduinoClose()

## End(Not run)

pdhoff/Rduino documentation built on May 29, 2019, 7:36 a.m.