浏览代码

Persistent statuses

master
gituser 10 个月前
父节点
当前提交
0e535c78e3
共有 4 个文件被更改,包括 18 次插入13 次删除
  1. 3
    3
      .cproject
  2. 5
    6
      .sproject
  3. 9
    3
      FSRemotePowerSwitch.ino
  4. 1
    1
      sloeber.ino.cpp

+ 3
- 3
.cproject 查看文件

<tool id="io.sloeber.tool.sketch.compiler.cpp.2023035055" name="Arduino C++ Compiler" superClass="io.sloeber.tool.sketch.compiler.cpp"> <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"> <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/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/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/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> </option>
<inputType id="io.sloeber.compiler.cpp.sketch.input.1496076099" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/> <inputType id="io.sloeber.compiler.cpp.sketch.input.1496076099" name="CPP source files" superClass="io.sloeber.compiler.cpp.sketch.input"/>
</tool> </tool>
<tool id="io.sloeber.tool.compiler.c.521670227" name="Arduino C Compiler" superClass="io.sloeber.tool.compiler.c"> <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"> <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/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/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/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> </option>
<inputType id="io.sloeber.compiler.c.sketch.input.280688484" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/> <inputType id="io.sloeber.compiler.c.sketch.input.280688484" name="C Source Files" superClass="io.sloeber.compiler.c.sketch.input"/>
</tool> </tool>
<tool id="io.sloeber.tool.sketch.compiler.s.1924256987" name="Arduino Assembler" superClass="io.sloeber.tool.sketch.compiler.s"> <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"> <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/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/AccelStepper/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/FSRemotePowerSwitch/libraries/ArduinoJson/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> </option>
<inputType id="io.sloeber.compiler.S.sketch.input.288275921" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/> <inputType id="io.sloeber.compiler.S.sketch.input.288275921" name="Assembly source files" superClass="io.sloeber.compiler.S.sketch.input"/>
</tool> </tool>

+ 5
- 6
.sproject 查看文件

Config.Release.board.BOARD.ID=nano 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.all=
Config.Release.compile.sloeber.extra.archive= Config.Release.compile.sloeber.extra.archive=
Config.Release.compile.sloeber.extra.assembly= Config.Release.compile.sloeber.extra.assembly=
Config.Release.compile.sloeber.extra.compile= Config.Release.compile.sloeber.extra.compile=
Config.Release.compile.sloeber.extra.cpp.compile= Config.Release.compile.sloeber.extra.cpp.compile=
Config.Release.compile.sloeber.extra.link= 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=NONE
Config.Release.compile.sloeber.warning_level.custom= Config.Release.compile.sloeber.warning_level.custom=
Config.Release.other.IS_VERSION_CONTROLLED=false Config.Release.other.IS_VERSION_CONTROLLED=false

+ 9
- 3
FSRemotePowerSwitch.ino 查看文件

const String CMD_ACT_AZIMUT_CAM = "Actual_Azimut_Cam"; const String CMD_ACT_AZIMUT_CAM = "Actual_Azimut_Cam";
const String CMD_ZERO_CAM = "Zero_Cam"; const String CMD_ZERO_CAM = "Zero_Cam";
const String CMD_VELOCITY_CAM = "Velocity_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_ON = "On";
const String CMD_VAL_OFF = "Off"; const String CMD_VAL_OFF = "Off";
const String CMD_VELOCITY_SLOW = "Slow"; const String CMD_VELOCITY_SLOW = "Slow";
const int PWR_RELAY_PIN = 5; const int PWR_RELAY_PIN = 5;
const int PWR_CAM_PIN = 6; const int PWR_CAM_PIN = 6;


String stepperVelocity;

JsonDocument msg; JsonDocument msg;
String stepperVelocity;
int actAzi = 0;


// Define motor interface type // Define motor interface type
#define motorInterfaceType AccelStepper::MotorInterfaceType::HALF4WIRE #define motorInterfaceType AccelStepper::MotorInterfaceType::HALF4WIRE


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


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


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

} else if (sdr == CMD_SENDER_PC && cmd == CMD_ACT_AZIMUT_CAM) { } 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)); sendCamActAzimut(String(actAzi));


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

+ 1
- 1
sloeber.ino.cpp 查看文件

//This is a automatic generated file //This is a automatic generated file
//Please do not modify this file //Please do not modify this file
//If you touch this file your change will be overwritten during the next build //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"
#include "Arduino.h" #include "Arduino.h"

正在加载...
取消
保存