Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. bool value=LOW;
  2. void setup() {
  3. Serial.begin(9600);
  4. pinMode(LED_BUILTIN, OUTPUT);
  5. }
  6. void loop() {
  7. digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
  8. value = (0!=(*portOutputRegister( digitalPinToPort(LED_BUILTIN) ) & digitalPinToBitMask(LED_BUILTIN)));
  9. Serial.println(value);
  10. delay(1000); // wait for a second
  11. digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
  12. value = (0!=(*portOutputRegister( digitalPinToPort(LED_BUILTIN) ) & digitalPinToBitMask(LED_BUILTIN)));
  13. Serial.println(value);
  14. delay(1000); // wait for a second
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement