Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte teste = 0;
- byte var = 0;
- //-----------------------
- void setup()
- {
- Serial.begin(9600);
- pinMode(2,INPUT_PULLUP);
- pinMode(4,INPUT_PULLUP);
- pinMode(6,INPUT_PULLUP);
- pinMode(8,INPUT_PULLUP);
- }
- //-----------------------
- void loop()
- {
- escrever();
- }
- //-----------------------
- void escrever()
- {
- teste=digitalRead(2);
- teste = teste<<1;
- teste=teste | digitalRead(4);
- teste = teste<<1;
- teste=teste | digitalRead(6);
- teste = teste<<1;
- teste=teste | digitalRead(8);
- var=teste;
- Serial.println(var,HEX);
- //mySendSwitch.send(var, 24);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement