![](/media/cache/profiles/profile_pic_for_github_less_than_1MB.jpg.50x50_q85.jpg)
This is example code that can get you started with building your own IR vision robot that communicates over LoRa
Dependencies: Adafruit-MotorShield Adafruit-PWM-Servo-Driver Adafruit_GFX BufferedSerial MAX17055_EZconfig NEO-6m-GPS SX1276GenericLib USBDeviceHT max32630fthr max77650_charger_sample
Fork of MAX326xxFTHR_LoRa_Example_test by
SX1276GenericPingPong/GenericPingPong.h@28:0ed92c590607, 2018-07-23 (annotated)
- Committer:
- dev_alexander
- Date:
- Mon Jul 23 23:39:35 2018 +0000
- Revision:
- 28:0ed92c590607
- Parent:
- 26:69aba05f010f
- Child:
- 42:911770814147
Reworked how the buffers are loaded and unloaded. Now prints off data received from the Slave on the Master. This is a stable release.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Helmut64 | 0:c43b6919ae15 | 1 | /* |
Helmut64 | 0:c43b6919ae15 | 2 | / _____) _ | | |
Helmut64 | 0:c43b6919ae15 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
Helmut64 | 0:c43b6919ae15 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
Helmut64 | 0:c43b6919ae15 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
Helmut64 | 0:c43b6919ae15 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
Helmut64 | 0:c43b6919ae15 | 7 | ( C )2014 Semtech |
Helmut64 | 0:c43b6919ae15 | 8 | |
Helmut64 | 0:c43b6919ae15 | 9 | Description: Contains the callbacks for the IRQs and any application related details |
Helmut64 | 0:c43b6919ae15 | 10 | |
Helmut64 | 0:c43b6919ae15 | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
Helmut64 | 0:c43b6919ae15 | 12 | |
Helmut64 | 0:c43b6919ae15 | 13 | Maintainer: Miguel Luis and Gregory Cristian |
Helmut64 | 0:c43b6919ae15 | 14 | */ |
Helmut64 | 0:c43b6919ae15 | 15 | |
Helmut64 | 0:c43b6919ae15 | 16 | /* |
Helmut64 | 0:c43b6919ae15 | 17 | * This file contains a copy of the master content sx1276PingPong |
Helmut64 | 0:c43b6919ae15 | 18 | * with adaption for the SX1276Generic environment |
Helmut64 | 0:c43b6919ae15 | 19 | * (c) 2017 Helmut Tschemernjak |
Helmut64 | 0:c43b6919ae15 | 20 | * 30826 Garbsen (Hannover) Germany |
Helmut64 | 0:c43b6919ae15 | 21 | */ |
Helmut64 | 0:c43b6919ae15 | 22 | |
Helmut64 | 0:c43b6919ae15 | 23 | #ifndef __SX1276PINGPONG_H__ |
Helmut64 | 0:c43b6919ae15 | 24 | #define __SX1276PINGPONG_H__ |
Helmut64 | 0:c43b6919ae15 | 25 | |
dev_alexander | 19:9f035b9e65ec | 26 | /* |
Helmut64 | 0:c43b6919ae15 | 27 | #ifdef FEATURE_LORA |
Helmut64 | 0:c43b6919ae15 | 28 | int SX1276PingPong(void); |
Helmut64 | 0:c43b6919ae15 | 29 | #else |
Helmut64 | 0:c43b6919ae15 | 30 | #define SX1276PingPong(x) void() |
Helmut64 | 0:c43b6919ae15 | 31 | #endif |
dev_alexander | 19:9f035b9e65ec | 32 | */ |
dev_alexander | 19:9f035b9e65ec | 33 | |
dev_alexander | 25:1a031add188a | 34 | |
dev_alexander | 25:1a031add188a | 35 | |
dev_alexander | 25:1a031add188a | 36 | const uint8_t PingMsg[] = { 0xff, 0xff, 0x00, 0x00, 'P', 'I', 'N', 'G'};// "PING"; |
dev_alexander | 25:1a031add188a | 37 | const uint8_t PongMsg[] = { 0xff, 0xff, 0x00, 0x00, 'P', 'O', 'N', 'G'};// "PONG"; |
dev_alexander | 25:1a031add188a | 38 | |
dev_alexander | 25:1a031add188a | 39 | |
dev_alexander | 25:1a031add188a | 40 | |
dev_alexander | 28:0ed92c590607 | 41 | int SX1276PingPongSetup(uint8_t *BufferTxFromMain, uint8_t *BufferRxFromMain); |
dev_alexander | 22:abca9d17d13d | 42 | |
dev_alexander | 19:9f035b9e65ec | 43 | int SX1276PingPong(void); |
dev_alexander | 19:9f035b9e65ec | 44 | |
Helmut64 | 0:c43b6919ae15 | 45 | /* |
Helmut64 | 0:c43b6919ae15 | 46 | * Callback functions prototypes |
Helmut64 | 0:c43b6919ae15 | 47 | */ |
Helmut64 | 0:c43b6919ae15 | 48 | /*! |
Helmut64 | 0:c43b6919ae15 | 49 | * @brief Function to be executed on Radio Tx Done event |
Helmut64 | 0:c43b6919ae15 | 50 | */ |
Helmut64 | 11:d3a591c20cd7 | 51 | void OnTxDone(void *radio, void *userThisPtr, void *userData); |
Helmut64 | 0:c43b6919ae15 | 52 | |
Helmut64 | 0:c43b6919ae15 | 53 | /*! |
Helmut64 | 0:c43b6919ae15 | 54 | * @brief Function to be executed on Radio Rx Done event |
Helmut64 | 0:c43b6919ae15 | 55 | */ |
Helmut64 | 11:d3a591c20cd7 | 56 | void OnRxDone(void *radio, void *userThisPtr, void *userData, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ); |
Helmut64 | 0:c43b6919ae15 | 57 | |
Helmut64 | 0:c43b6919ae15 | 58 | /*! |
Helmut64 | 0:c43b6919ae15 | 59 | * @brief Function executed on Radio Tx Timeout event |
Helmut64 | 0:c43b6919ae15 | 60 | */ |
Helmut64 | 11:d3a591c20cd7 | 61 | void OnTxTimeout(void *radio, void *userThisPtr, void *userData); |
Helmut64 | 0:c43b6919ae15 | 62 | |
Helmut64 | 0:c43b6919ae15 | 63 | /*! |
Helmut64 | 0:c43b6919ae15 | 64 | * @brief Function executed on Radio Rx Timeout event |
Helmut64 | 0:c43b6919ae15 | 65 | */ |
Helmut64 | 11:d3a591c20cd7 | 66 | void OnRxTimeout(void *radio, void *userThisPtr, void *userData); |
Helmut64 | 0:c43b6919ae15 | 67 | |
Helmut64 | 0:c43b6919ae15 | 68 | /*! |
Helmut64 | 0:c43b6919ae15 | 69 | * @brief Function executed on Radio Rx Error event |
Helmut64 | 0:c43b6919ae15 | 70 | */ |
Helmut64 | 11:d3a591c20cd7 | 71 | void OnRxError(void *radio, void *userThisPtr, void *userData); |
Helmut64 | 0:c43b6919ae15 | 72 | |
Helmut64 | 0:c43b6919ae15 | 73 | /*! |
Helmut64 | 0:c43b6919ae15 | 74 | * @brief Function executed on Radio Fhss Change Channel event |
Helmut64 | 0:c43b6919ae15 | 75 | */ |
Helmut64 | 11:d3a591c20cd7 | 76 | void OnFhssChangeChannel(void *radio, void *userThisPtr, void *userData, uint8_t channelIndex); |
Helmut64 | 0:c43b6919ae15 | 77 | |
Helmut64 | 0:c43b6919ae15 | 78 | /*! |
Helmut64 | 0:c43b6919ae15 | 79 | * @brief Function executed on CAD Done event |
Helmut64 | 0:c43b6919ae15 | 80 | */ |
Helmut64 | 11:d3a591c20cd7 | 81 | void OnCadDone(void *radio, void *userThisPtr, void *userData); |
Helmut64 | 0:c43b6919ae15 | 82 | |
Helmut64 | 0:c43b6919ae15 | 83 | #endif // __MAIN_H__ |