Learn R Programming

Rduino (version 0.1)

onServo: Set servo

Description

Activate a servo and set a value

Usage

onServo(pin, value)

Arguments

pin

the number of the pin connected to the servo

value

value to set for the servo

Examples

Run this code
# 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()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab