Adafruit Feather M0 LoRa is programmed using Arduino IDE
TinyGPS library talks to the Adafruit Ultimate GPS featherwing to retrieve position and current timestamp.
Pulse Per Second hardware output from GPS triggers an interrupt routine on the M0 to synchronise transmission slots across all devices.
Code outline:
On Interrupt:
- Set flag for 'transmit required=TRUE'
Setup:
- Configure LoRa and GPS serial
- Determine our timeslot for sending telemetry.
Await valid GPS fix before continuing
Loop:
- If 'transmit require' flag is set AND the current timestamp is within our timeslot
- transmit our packet.
- Else:
- update device location when bytes on serial from GPS are available
- construct a data packet ready for transmission
- Device ID - Voltage (from onboard resistor divider) - position - fix status
- get the current (number of seconds past the minute) from GPS
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.