Skip to content

Commit

Permalink
allows use of TRUE and FALSE to turn on and off
Browse files Browse the repository at this point in the history
  • Loading branch information
mnr committed Feb 21, 2024
1 parent 5784507 commit 6c55585
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/rpi_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#' rpi_set(toggleThesePins, 0) # turns off all pins
rpi_set <- function(pin_number, onOff) {

if( is.logical(onOff) ) {
onOff <- ifelse(onOff,1,0)
}

bcm_line <- rpigpior::rpi_pinToBCM(pin_number)

pinAndValue <- paste0(bcm_line,"=",onOff)
Expand Down

0 comments on commit 6c55585

Please sign in to comment.