Add files via upload

This commit is contained in:
isaac879
2020-04-30 06:05:40 +01:00
committed by GitHub
parent fdc7ebc213
commit 7b65960799
2 changed files with 17 additions and 1 deletions
+15
View File
@@ -886,6 +886,21 @@ void timelapse(unsigned int numberOfPictures, unsigned long msDelay){
void serialData(void){
char instruction = Serial.read();
if(instruction == INSTRUCTION_BYTES_PAN_SPEED){
int count = 0;
while(Serial.available() < 2){//Wait for six bytes to be available. Breaks after ~200ms if bytes are not received.
delayMicroseconds(200);
count++;
if(count > 1000){
serialFlush();//Clear the serial buffer
break;
}
}
int panStepSpeed = (Serial.read() << 8) + Serial.read();
stepper_pan.setSpeed(panStepSpeed);
stepper_pan.runSpeed();
}
delay(2); //wait to make sure all data in the serial message has arived
ledBatteryLevel(getBatteryPercentage());
memset(&stringText[0], 0, sizeof(stringText)); //clear the array