uas_arduino

Writing 8 bits out using a byte input type

Jan 25th, 2013
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void writeByte(byte data, byte[] pins){
  2.     for(byte a = 0; a < 8; a++){
  3.         if((data >> a) & 0x01){
  4.             digitalWrite(pins[a], HIGH);
  5.         }else{
  6.             digitalWrite(pins[a], LOW);
  7.         }
  8.     }
  9. }
RAW Paste Data