изменена инициализация кнопки
This commit is contained in:
1 parent
c081a527fe
commit
915386cf99
2 files changed
+4
-6
No files matched your search
@@ -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
|
||||
*/
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user