Добавлена библиотека IRremote #10
@ -101,6 +101,7 @@
|
||||
#include <IRremote.hpp>
|
||||
|
||||
int SEND_BUTTON_PIN = BTN_BUILTIN;
|
||||
int BTN_ACTIVE_STATE = HIGH;
|
||||
|
||||
int DELAY_BETWEEN_REPEAT = 50;
|
||||
|
||||
@ -118,7 +119,7 @@ void storeCode();
|
||||
void sendCode(storedIRDataStruct *aIRDataToSend);
|
||||
|
||||
void setup() {
|
||||
pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);
|
||||
pinMode(SEND_BUTTON_PIN, INPUT);
|
||||
|
||||
Serial.begin(9600);
|
||||
while (!Serial)
|
||||
@ -141,10 +142,7 @@ void setup() {
|
||||
void loop() {
|
||||
|
||||
// If button pressed, send the code.
|
||||
bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == LOW); // Button pin is active LOW
|
||||
if (digitalRead(SEND_BUTTON_PIN))
|
||||
Serial.println("pressed");
|
||||
|
||||
bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == BTN_ACTIVE_STATE); // Button pin is active LOW
|
||||
/*
|
||||
* Check for current button state
|
||||
*/
|
||||
|
||||
@ -93,7 +93,7 @@ uint8_t sNumberOfBits = 32;
|
||||
bool sSendButtonWasActive;
|
||||
|
||||
void setup() {
|
||||
pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);
|
||||
pinMode(SEND_BUTTON_PIN, INPUT);
|
||||
|
||||
Serial.begin(9600);
|
||||
while (!Serial)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user