Skip to content

Commit

Permalink
removed debug line
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt committed Nov 9, 2023
1 parent 55ff38e commit cf3f138
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=DigitalSignals Arduino
version=0.1.1
version=0.1.2
author=Tolentino Cotesta <[email protected]>
maintainer=Tolentino Cotesta <[email protected]>
sentence=Arduino Digital Signal library
Expand Down
34 changes: 17 additions & 17 deletions src/DigitalOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ void DigitalOut::run(bool input, int count) {
m_blinkCount = 0;
}

static int lastState = -1;
if (lastState != m_runState) {
lastState = m_runState;
Serial.println(m_runState);
}
switch (m_runState) {
// static int lastState = -1;
// if (lastState != m_runState) {
// lastState = m_runState;
// Serial.println(m_runState);
// }

switch (m_runState) {
case RunStates::OFF :
m_waitOff = false;
m_waitOff = false;
if (input) {
m_activeTime = millis();
m_runState = RunStates::DELAY_ON;

// If Blink, set out ON immediately on input level HIGH
if (m_type == Type::BLINK) {
m_runState = RunStates::ON;
m_runState = RunStates::ON;
}
}
// Reset after last blink (do nothing if count == 0)
Expand Down Expand Up @@ -109,22 +109,22 @@ void DigitalOut::run(bool input, int count) {

// Increase blink counter (do nothing if count == 0)
if ((++m_blinkCount >= count) && count ) {
m_runState = RunStates::OFF;
m_runState = RunStates::OFF;
}
return;
}

// Reset output
if (input == false) {
if ((m_type == Type::TON_TOFF) || (m_type == Type::TON_M && m_offTime)) {
// Reset output
if (input == false) {
if ((m_type == Type::TON_TOFF) || (m_type == Type::TON_M && m_offTime)) {
if (m_waitOff == false) {
m_waitOff = true;
m_activeTime = millis();
break;
m_activeTime = millis();
break;
}
if (millis() - m_activeTime > m_offTime) {
if (millis() - m_activeTime > m_offTime) {
m_activeTime = reset();
m_runState = RunStates::OFF;
m_runState = RunStates::OFF;
}
}
}
Expand Down

0 comments on commit cf3f138

Please sign in to comment.