Ledger Nano X - The secure hardware wallet
SHARE
TWEET

MapeoEntradaSalida

hidromotic Apr 10th, 2020 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //PARPADEO DE LED
  2. //Mapear en una salida (11), el estado de una entrada (7).
  3.  
  4. #define PIN_LED 13
  5. #define CONFIGURAR_LED pinMode(PIN_LED, OUTPUT)
  6. #define ENCENDER_LED digitalWrite(PIN_LED, HIGH)
  7. #define APAGAR_LED digitalWrite(PIN_LED, LOW)
  8.  
  9. #define PIN_LED_BOT 11
  10. #define CONFIGURAR_LED_BOT  pinMode(PIN_LED_BOT, OUTPUT)
  11. #define ENCENDER_LED_BOT    digitalWrite(PIN_LED_BOT, HIGH)
  12. #define APAGAR_LED_BOT      digitalWrite(PIN_LED_BOT, LOW)
  13.  
  14. #define PIN_BOT 7
  15. #define CONFIGURAR_BOT      pinMode(PIN_BOT, INPUT)
  16. #define BOT_PRESIONADO      (digitalRead(PIN_BOT)==HIGH)
  17.  
  18. void setup()
  19.   {
  20.   CONFIGURAR_LED;
  21.   CONFIGURAR_BOT;
  22.   CONFIGURAR_LED_BOT;
  23.   }
  24.  
  25. void loop()
  26.   {
  27.   if(BOT_PRESIONADO)  ENCENDER_LED_BOT;
  28.   else                APAGAR_LED_BOT;
  29. //  ENCENDER_LED;
  30. //  delay(1000); //esperamos 1 segundo
  31. //  
  32. //  APAGAR_LED;
  33. //  delay(1000);
  34.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top