diff --git a/README.md b/README.md index 95fc0ca..4c5e514 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The system mounts a camera on a 2-axis gimbal (yaw + pitch) and continuously sca ## Quick Start -1. **Flash firmware:** `cd firmware && pio run --environment megaatmega2560 --target upload` +1. **Flash firmware:** `cd firmware && pio run -t upload` 2. **Build host:** `cd host/build && cmake .. && make -j$(nproc)` 3. **Run host:** `./FireWatchTower_2axis --init true --start true` diff --git a/host/deploy.sh b/deploy.sh similarity index 100% rename from host/deploy.sh rename to deploy.sh diff --git a/firmware/src/serial/CommandParser.cpp b/firmware/src/serial/CommandParser.cpp index 4bfcd67..1f4c892 100644 --- a/firmware/src/serial/CommandParser.cpp +++ b/firmware/src/serial/CommandParser.cpp @@ -9,12 +9,6 @@ #include "TMC5160.h" void parser(char &c) { - int base = 16; - if (Serial.peek() == 'd') { - Serial.read(); - base = 10; - } - static char buffer[32]; size_t len = Serial.readBytesUntil('\n', buffer, sizeof(buffer) - 1); buffer[len] = '\0'; @@ -29,8 +23,8 @@ void parser(char &c) { } switch (c) { - - case 'r': + + case 'r': // power cycle the motors init_motor_params(); motor_power_on(MotorPitch); motor_power_on(MotorYaw); @@ -39,22 +33,22 @@ void parser(char &c) { Serial.println(F("Reset")); break; - case 'q': + case 'q': // find endstop do_endstop(MotorYaw); do_endstop(MotorPitch); break; - case '!': + case '!': // turn motors off motor_power_off(MotorPitch); motor_power_off(MotorYaw); break; - case '*': + case '*': // turn motors on motor_power_on(MotorPitch); motor_power_on(MotorYaw); break; - case 'm': + case 'm': // move to a specific position in yawl Serial.print(F("Move ")); Serial.print(args[0]); Serial.print(F(" with ")); @@ -62,11 +56,11 @@ void parser(char &c) { tmc5160_moveTo(MotorYaw, args[0], args[1]); break; - case ';': + case ';': // change position homing (0x21: XACTUAL register) tmc5160_writeRegister(MotorYaw, 0x21, args[0]); break; - case 's': + case 's': // stop motors tmc5160_rotateMotor(MotorPitch, 0); tmc5160_rotateMotor(MotorYaw, 0); Serial.println(F("Stop")); diff --git a/host/deploy_host.sh b/host/deploy_host.sh new file mode 100644 index 0000000..b1af230 --- /dev/null +++ b/host/deploy_host.sh @@ -0,0 +1,8 @@ +#!/bin/bash +rsync -av --exclude='build/' ~/code/FireWatchTower_2axis/host/ ggs@10.11.12.111:/home/ggs/projects/FireWatchTower_2axis/host +ssh ggs@10.11.12.111 " + mkdir -p /home/ggs/projects/FireWatchTower_2axis/host/build && + cd /home/ggs/projects/FireWatchTower_2axis/host/build && + cmake .. && + make -j\$(nproc) +" \ No newline at end of file