Learn R Programming

Rduino (version 0.1)

setDpin: Set digital pin

Description

Set a digital pin to on or off

Usage

setDpin(pin, value)

Arguments

pin

the number of the pin to set (integer)

value

the value to which to set the pin (binary)

Examples

Run this code
# NOT RUN {
rduinoConnect()
# flash LED rapidly
for (i in 0:9) 
{
  setDpin(8,1)
  Sys.sleep(0.05)
  setDpin(8,0)
  Sys.sleep(0.05)
}
rduinoClose()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab