powered by
Get the value of a digital pin
getDpin(pin)
the number of the pin to get (integer)
the binary value of the pin.
# 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