Removed blocks of commented code.
This commit is contained in:
109
src/main.cpp
109
src/main.cpp
@ -5,11 +5,6 @@
|
|||||||
#include <arduino-timer.h>
|
#include <arduino-timer.h>
|
||||||
|
|
||||||
const int LCD_TIMER=2500;
|
const int LCD_TIMER=2500;
|
||||||
/*
|
|
||||||
TODO:
|
|
||||||
- Test buttons
|
|
||||||
- Non-blocking "pulse" function
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Various variables.
|
// Various variables.
|
||||||
int iDeflection = 48;
|
int iDeflection = 48;
|
||||||
@ -250,107 +245,3 @@ void loop()
|
|||||||
parseInput(customKey);
|
parseInput(customKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void loop()
|
|
||||||
{
|
|
||||||
// put your main code here, to run repeatedly:
|
|
||||||
//Serial.println("Hello.");
|
|
||||||
//delay(1000);
|
|
||||||
//printSetting();
|
|
||||||
|
|
||||||
// print the string when a newline arrives:
|
|
||||||
if (stringComplete)
|
|
||||||
{
|
|
||||||
|
|
||||||
switch (inputString[0])
|
|
||||||
{
|
|
||||||
case 's':
|
|
||||||
if (bRunning)
|
|
||||||
{
|
|
||||||
bRunning = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bRunning = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 't':
|
|
||||||
// If we're running, don't do anything.
|
|
||||||
if (bRunning)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
doPulse();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'a':
|
|
||||||
iDeflection++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'z':
|
|
||||||
iDeflection--;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'd':
|
|
||||||
iDelay += 100;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'c':
|
|
||||||
iDelay -= 100;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'f':
|
|
||||||
iHoldDelay++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'v':
|
|
||||||
iHoldDelay--;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
iDeflection = constrain(iDeflection, 0, 180);
|
|
||||||
iDelay = constrain(iDelay, 10, 1000);
|
|
||||||
iHoldDelay = constrain(iHoldDelay, 0, 100);
|
|
||||||
|
|
||||||
printSetting();
|
|
||||||
|
|
||||||
// Serial.println(inputString);
|
|
||||||
// clear the string:
|
|
||||||
inputString = "";
|
|
||||||
stringComplete = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bRunning)
|
|
||||||
{
|
|
||||||
doPulse();
|
|
||||||
delay(iDelay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
SerialEvent occurs whenever a new data comes in the hardware serial RX. This
|
|
||||||
routine is run between each time loop() runs, so using delay inside loop can
|
|
||||||
delay response. Multiple bytes of data may be available.
|
|
||||||
|
|
||||||
void serialEvent()
|
|
||||||
{
|
|
||||||
while (Serial.available())
|
|
||||||
{
|
|
||||||
// get the new byte:
|
|
||||||
char inChar = (char)Serial.read();
|
|
||||||
// add it to the inputString:
|
|
||||||
inputString += inChar;
|
|
||||||
// if the incoming character is a newline, set a flag so the main loop can
|
|
||||||
// do something about it:
|
|
||||||
if (inChar == '\n')
|
|
||||||
{
|
|
||||||
stringComplete = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
Reference in New Issue
Block a user