Skip to content

Commit a4d329d

Browse files
committed
init
Signed-off-by: Michael Carlstrom <[email protected]>
1 parent f3ddc7d commit a4d329d

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

src/float/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Setup
2+
3+
https://learn.adafruit.com/adafruit-feather-32u4-radio-with-lora-radio-module/setup
4+
5+
# Hardware
6+
7+
Adafruit Feather 32u4 RFM95 LoRa Radio- 868 or 915 MHz - RadioFruit
8+
9+
# Dependencies
10+
11+
RadioHead v1.122.1 by Mike McCauley
12+
13+
Blue Robotics MS5837 Library v1.1.1 by BlueRobotics
14+
115
# Transceiver Arduino Sketches
216

317
These sketches must include files from `include/`, but that's impossible with the Arduino IDE. We hardlink the each file in `include/` manually.

src/float/float_transceiver/float_transceiver.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct Stage {
5858
OverrideState overrideState = OverrideState::NoOverride;
5959
uint8_t currentStage = 0;
6060

61-
const Stage SCHEDULE[SCHEDULE_LENGTH] = {
61+
const Stage SCHEDULE[] = {
6262
// Pump immediately in case we just rebooted at the bottom of the pool
6363
{StageType::Pump, PUMP_MAX },
6464

src/float/surface_transceiver/surface_transceiver.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ bool printRFStatus = true;
2121
// Singleton instance of the radio driver
2222
RH_RF95 rf95(RFM95_CS, RFM95_INT);
2323

24-
const uint8_t LEGAL_COMMANDS_LEN = 5;
25-
const String LEGAL_COMMANDS[LEGAL_COMMANDS_LEN] = {"submerge", "suck", "pump", "stop", "return"};
24+
const String LEGAL_COMMANDS[] = {"submerge", "suck", "pump", "stop", "return"};
2625

2726
void setup() {
2827
Serial.begin(115200);
@@ -73,9 +72,9 @@ void loop() {
7372
printRFStatus = false;
7473
}
7574

76-
for (int i = 0; i < LEGAL_COMMANDS_LEN; i++) {
77-
if (command.startsWith(LEGAL_COMMANDS[i])) {
78-
sendCommand(LEGAL_COMMANDS[i]);
75+
for (auto legalCommand : LEGAL_COMMANDS) {
76+
if (command.startsWith(legalCommand)) {
77+
sendCommand(legalCommand);
7978
return;
8079
}
8180
}

0 commit comments

Comments
 (0)