добавлен пин для платы старт
This commit is contained in:
parent
efac9cf87a
commit
25bc00a1bd
@ -44,8 +44,8 @@
|
|||||||
|
|
||||||
#include <IRremote.hpp>
|
#include <IRremote.hpp>
|
||||||
|
|
||||||
#define RELAY_PIN 5
|
#define RELAY_PIN 5 // P0_4
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
pinMode(LED_BUILTIN, OUTPUT);
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
|
|||||||
@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
|
//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
#define TONE_PIN 3
|
#define TONE_PIN 5 // P0_2
|
||||||
|
|
||||||
// Some kind of auto detect library if USE_TINY_IR_RECEIVER is deactivated
|
// Some kind of auto detect library if USE_TINY_IR_RECEIVER is deactivated
|
||||||
#if !defined(USE_TINY_IR_RECEIVER)
|
#if !defined(USE_TINY_IR_RECEIVER)
|
||||||
@ -119,11 +119,9 @@ void setup() {
|
|||||||
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing IRMP library version " VERSION_IRMP));
|
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing IRMP library version " VERSION_IRMP));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ESP8266) && !defined(NRF5)
|
|
||||||
// play feedback tone before setup, since it kills the IR timer settings
|
// play feedback tone before setup, since it kills the IR timer settings
|
||||||
tone(TONE_PIN, 1000, 50);
|
tone(TONE_PIN, 1000, 50);
|
||||||
delay(50);
|
delay(50);
|
||||||
#endif
|
|
||||||
|
|
||||||
IRDispatcher.init(); // This just calls irmp_init()
|
IRDispatcher.init(); // This just calls irmp_init()
|
||||||
#if defined(USE_TINY_IR_RECEIVER)
|
#if defined(USE_TINY_IR_RECEIVER)
|
||||||
|
|||||||
@ -87,8 +87,11 @@
|
|||||||
|
|
||||||
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
|
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 4
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
#define IR_SEND_PIN 3
|
#define IR_SEND_PIN 3 // P0_0
|
||||||
|
|
||||||
|
int SEND_BUTTON_PIN = BTN_BUILTIN;
|
||||||
|
int BTN_ACTIVE_STATE = LOW; // HIGH for Elbear boards, LOW for start board
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper macro for getting a macro definition as string
|
* Helper macro for getting a macro definition as string
|
||||||
@ -100,9 +103,6 @@
|
|||||||
|
|
||||||
#include <IRremote.hpp>
|
#include <IRremote.hpp>
|
||||||
|
|
||||||
int SEND_BUTTON_PIN = BTN_BUILTIN;
|
|
||||||
int BTN_ACTIVE_STATE = HIGH;
|
|
||||||
|
|
||||||
int DELAY_BETWEEN_REPEAT = 50;
|
int DELAY_BETWEEN_REPEAT = 50;
|
||||||
|
|
||||||
// Storage for the recorded code
|
// Storage for the recorded code
|
||||||
|
|||||||
@ -47,12 +47,13 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if !defined(IR_SEND_PIN)
|
#if !defined(IR_SEND_PIN)
|
||||||
#define IR_SEND_PIN 3
|
#define IR_SEND_PIN 3 // P0_0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 4
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
#define BTN_ACTIVE_STATE HIGH
|
#define SEND_BUTTON_PIN BTN_BUILTIN
|
||||||
|
#define BTN_ACTIVE_STATE HIGH // HIGH for Elbear boards, LOW for Start board
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper macro for getting a macro definition as string
|
* Helper macro for getting a macro definition as string
|
||||||
@ -81,8 +82,6 @@
|
|||||||
|
|
||||||
#include <IRremote.hpp>
|
#include <IRremote.hpp>
|
||||||
|
|
||||||
#define SEND_BUTTON_PIN BTN_BUILTIN
|
|
||||||
|
|
||||||
#define DELAY_BETWEEN_REPEATS_MILLIS 70
|
#define DELAY_BETWEEN_REPEATS_MILLIS 70
|
||||||
|
|
||||||
// Storage for the recorded code, pre-filled with NEC data
|
// Storage for the recorded code, pre-filled with NEC data
|
||||||
@ -106,7 +105,7 @@ void setup() {
|
|||||||
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
|
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
|
||||||
Serial.println(F("Ready to receive pulse distance/width coded IR signals at pin " STR(IR_RECEIVE_PIN)));
|
Serial.println(F("Ready to receive pulse distance/width coded IR signals at pin " STR(IR_RECEIVE_PIN)));
|
||||||
|
|
||||||
IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
|
IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
|
||||||
Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
|
Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
|
||||||
Serial.println(SEND_BUTTON_PIN);
|
Serial.println(SEND_BUTTON_PIN);
|
||||||
}
|
}
|
||||||
@ -184,6 +183,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IrReceiver.resume(); // resume receiver
|
IrReceiver.resume(); // resume receiver
|
||||||
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
sSendButtonWasActive = tSendButtonIsActive;
|
sSendButtonWasActive = tSendButtonIsActive;
|
||||||
|
|||||||
@ -83,7 +83,7 @@
|
|||||||
#define STR_HELPER(x) #x
|
#define STR_HELPER(x) #x
|
||||||
#define STR(x) STR_HELPER(x)
|
#define STR(x) STR_HELPER(x)
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
|
|
||||||
void handleOverflow();
|
void handleOverflow();
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
#define STR(x) STR_HELPER(x)
|
#define STR(x) STR_HELPER(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
|
|
||||||
#if !defined(RAW_BUFFER_LENGTH)
|
#if !defined(RAW_BUFFER_LENGTH)
|
||||||
|
|||||||
@ -94,9 +94,9 @@
|
|||||||
#define DECODE_SAMSUNG
|
#define DECODE_SAMSUNG
|
||||||
#define ADDRESS_OF_SAMSUNG_REMOTE 0x07 // The value you see as address in printIRResultShort()
|
#define ADDRESS_OF_SAMSUNG_REMOTE 0x07 // The value you see as address in printIRResultShort()
|
||||||
|
|
||||||
#define TONE_PIN 8
|
#define TONE_PIN 5 // P0_2
|
||||||
#define IR_RECEIVE_PIN 4
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
#define IR_SEND_PIN 3
|
#define IR_SEND_PIN 3 // P0_0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper macro for getting a macro definition as string
|
* Helper macro for getting a macro definition as string
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper macro for getting a macro definition as string
|
* Helper macro for getting a macro definition as string
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
#define STR(x) STR_HELPER(x)
|
#define STR(x) STR_HELPER(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
#define STR(x) STR_HELPER(x)
|
#define STR(x) STR_HELPER(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
#define STR(x) STR_HELPER(x)
|
#define STR(x) STR_HELPER(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IR_RECEIVE_PIN 2
|
#define IR_RECEIVE_PIN 4 // P0_1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For callback
|
* For callback
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user