Browse Source

Persistent statuses

master
gituser 10 months ago
parent
commit
0e535c78e3
4 changed files with 18 additions and 13 deletions
  1. 3
    3
      .cproject
  2. 5
    6
      .sproject
  3. 9
    3
      FSRemotePowerSwitch.ino
  4. 1
    1
      sloeber.ino.cpp

+ 3
- 3
.cproject View File

@@ -20,27 +20,27 @@
<tool id="io.sloeber.tool.sketch.compiler.cpp.2023035055" name="Arduino C++ Compiler" superClass="io.sloeber.tool.sketch.compiler.cpp">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="io.sloeber.compiler.cpp.sketch.option.incpath.1878572355" name="Include Paths (-I)" superClass="io.sloeber.compiler.cpp.sketch.option.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
</option>
<inputType id="io.sloeber.compiler.cpp.sketch.input.1496076099" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/>
</tool>
<tool id="io.sloeber.tool.compiler.c.521670227" name="Arduino C Compiler" superClass="io.sloeber.tool.compiler.c">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="io.sloeber.compiler.c.sketch.option.incpath.1725144655" name="Include Paths (-I)" superClass="io.sloeber.compiler.c.sketch.option.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
</option>
<inputType id="io.sloeber.compiler.c.sketch.input.280688484" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/>
</tool>
<tool id="io.sloeber.tool.sketch.compiler.s.1924256987" name="Arduino Assembler" superClass="io.sloeber.tool.sketch.compiler.s">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="io.sloeber.compiler.asm.sketch.option.incpath.215936531" name="Include Paths (-I)" superClass="io.sloeber.compiler.asm.sketch.option.incpath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/core/variant}&quot;"/>
</option>
<inputType id="io.sloeber.compiler.S.sketch.input.288275921" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/>
</tool>

+ 5
- 6
.sproject View File

@@ -1,8 +1,8 @@
Config.Release.board.BOARD.ID=nano
Config.Release.board.BOARD.MENU.cpu=atmega328
Config.Release.board.BOARD.TXT=C:\bin\Sloeber\4.4.3\arduinoPlugin\packages\arduino\hardware\avr\1.8.4\boards.txt
Config.Release.board.PROGRAMMER.NAME=ArduinoISP
Config.Release.board.UPLOAD.PORT=COM5
Config.Release.board.BOARD.MENU.cpu=atmega328old
Config.Release.board.BOARD.TXT=${SLOEBER_HOME}/arduinoPlugin/packages/arduino/hardware/avr/1.8.4/boards.txt
Config.Release.board.PROGRAMMER.NAME=Default
Config.Release.board.UPLOAD.PORT=COM4
Config.Release.compile.sloeber.extra.all=
Config.Release.compile.sloeber.extra.archive=
Config.Release.compile.sloeber.extra.assembly=
@@ -10,8 +10,7 @@ Config.Release.compile.sloeber.extra.c.compile=
Config.Release.compile.sloeber.extra.compile=
Config.Release.compile.sloeber.extra.cpp.compile=
Config.Release.compile.sloeber.extra.link=
Config.Release.compile.sloeber.size.custom=
Config.Release.compile.sloeber.size.type=RAW_RESULT
Config.Release.compile.sloeber.size.switch=false
Config.Release.compile.sloeber.warning_level=NONE
Config.Release.compile.sloeber.warning_level.custom=
Config.Release.other.IS_VERSION_CONTROLLED=false

+ 9
- 3
FSRemotePowerSwitch.ino View File

@@ -28,6 +28,7 @@ const String CMD_AZIMUT_CAM = "Azimut_Cam";
const String CMD_ACT_AZIMUT_CAM = "Actual_Azimut_Cam";
const String CMD_ZERO_CAM = "Zero_Cam";
const String CMD_VELOCITY_CAM = "Velocity_Cam";
const String CMD_STATUS_VELOCITY_CAM = "Status_Velocity_Cam";
const String CMD_VAL_ON = "On";
const String CMD_VAL_OFF = "Off";
const String CMD_VELOCITY_SLOW = "Slow";
@@ -36,9 +37,9 @@ const String CMD_VELOCITY_FAST = "Fast";
const int PWR_RELAY_PIN = 5;
const int PWR_CAM_PIN = 6;

String stepperVelocity;

JsonDocument msg;
String stepperVelocity;
int actAzi = 0;

// Define motor interface type
#define motorInterfaceType AccelStepper::MotorInterfaceType::HALF4WIRE
@@ -152,6 +153,7 @@ void loop() {

} else if (sdr == CMD_SENDER_PC && cmd == CMD_ZERO_CAM) {
stepper.setCurrentPosition(0);
actAzi = 0;
sendZeroCamStatus(String(stepper.currentPosition()));

} else if (sdr == CMD_SENDER_PC && cmd == CMD_VELOCITY_CAM) {
@@ -162,12 +164,16 @@ void loop() {
}
sendCamVelocityStatus();

} else if (sdr == CMD_SENDER_PC && cmd == CMD_STATUS_VELOCITY_CAM) {
sendCamVelocityStatus();

} else if (sdr == CMD_SENDER_PC && cmd == CMD_ACT_AZIMUT_CAM) {
int actAzi = round(stepper.currentPosition() / (4076.0 / 360.0) * -1);
actAzi = round(stepper.currentPosition() / (4076.0 / 360.0) * -1);
sendCamActAzimut(String(actAzi));

} else if (sdr == CMD_SENDER_PC && cmd == CMD_AZIMUT_CAM) {
if (digitalRead(PWR_CAM_PIN) == LOW) {
actAzi = val.toInt();
long target = round((4076.0 / 360.0) * val.toDouble() * -1);
stepper.moveTo(target);
stepper.run();

+ 1
- 1
sloeber.ino.cpp View File

@@ -2,7 +2,7 @@
//This is a automatic generated file
//Please do not modify this file
//If you touch this file your change will be overwritten during the next build
//This file has been generated on 2025-01-15 20:10:44
//This file has been generated on 2025-01-22 13:56:01

#include "Arduino.h"
#include "Arduino.h"

Loading…
Cancel
Save