Learn R Programming

Rduino (version 0.1)

getDpin: Get digital pin

Description

Get the value of a digital pin

Usage

getDpin(pin)

Arguments

pin

the number of the pin to get (integer)

Value

the binary value of the pin.

Examples

Run this code
# NOT RUN {
rduinoConnect()
# LED remains on until button is pressed
setDpin(5,1)
isPressed<-getDpin(4)
while (!isPressed){ isPressed<-getDpin(4) }
setDpin(5,0)
rduinoClose()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab