fix: PullDown
This commit is contained in:
1 parent
313e097a53
commit
b34a3a4acd
15 files changed
+101
-108
No files matched your search
@@ -46,7 +46,7 @@ class LinMot {
|
||||
private:
|
||||
OutputPort& _out1;
|
||||
OutputPort& _out2;
|
||||
bool _locked;
|
||||
bool _locked{};
|
||||
void set(bool val) {
|
||||
_out1.write(val);
|
||||
_out2.write(!val);
|
||||
@@ -64,13 +64,13 @@ class CurrMon {
|
||||
|
||||
float val{};
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
val += sampe();
|
||||
val += sample();
|
||||
}
|
||||
_refVal = val / 8;
|
||||
}
|
||||
|
||||
float sampleCurrent() {
|
||||
auto val = sampe() - _refVal;
|
||||
auto val = sample() - _refVal;
|
||||
val = val / 0.264;
|
||||
fmt::println("{:.2} A", val);
|
||||
return val;
|
||||
@@ -80,7 +80,7 @@ class CurrMon {
|
||||
float _refVal{};
|
||||
AdcAds1115& _adc;
|
||||
|
||||
float sampe() {
|
||||
float sample() {
|
||||
float volt;
|
||||
_adc.readConversionVoltage(volt);
|
||||
return volt;
|
||||
@@ -106,6 +106,7 @@ class DeviceIoState {
|
||||
}
|
||||
|
||||
OpMode Mode{OpMode::Maintanance};
|
||||
bool GameRunning{};
|
||||
pal::InputTransAware& SwordEntry;
|
||||
pal::InputTransAware& SwordEnd;
|
||||
pal::InputTransAware& SwordPulled;
|
||||
@@ -238,7 +239,7 @@ class MediaPlayer {
|
||||
static thread playWavFileThread(const string& filePath) {
|
||||
if (filePath.empty()) {
|
||||
fmt::println(stderr, "ERROR: Empty file path");
|
||||
thread([](){});
|
||||
thread([](){ Thread::sleep(2s); });
|
||||
}
|
||||
return thread([filePath]() {
|
||||
auto cmd = fmt::format("aplay '{}'", filePath);
|
||||
|
||||
Reference in new issue
Block a user