LoRa node acquiring analog input and sending to LoRa Server - Working ok
Dependents: DISCO-L072CZ-LRWAN1_LoRa_node EIoT_LoRa_node_1 EIoT_LoRa_node_2 EIoT_LoRa_node_3
Fork of SX1276GenericLib by
Diff: sx1276/arduino-mbed.h
- Revision:
- 68:66251038a897
- Parent:
- 67:d3afd803f40d
- Child:
- 69:d440a5b04708
diff -r d3afd803f40d -r 66251038a897 sx1276/arduino-mbed.h --- a/sx1276/arduino-mbed.h Sun Jul 16 21:25:00 2017 +0200 +++ b/sx1276/arduino-mbed.h Wed Jul 19 09:36:56 2017 +0200 @@ -22,7 +22,10 @@ #define NC -1 #define wait_ms delay - +enum PinMode { + PullUp = 1, + PullDown = 2, +}; class DigitalInOut { public: @@ -41,6 +44,17 @@ pinMode(_gpioPin, INPUT); }; + void mode(PinMode pull) { + switch(pull) { + case PullUp: + pinMode(_gpioPin, INPUT_PULLUP); + break; + case PullDown: + pinMode(_gpioPin, INPUT_PULLDOWN); + break; + } + } + int read() { if (digitalRead(_gpioPin) == HIGH) return 1;