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
+2 -1
View File
@@ -50,6 +50,7 @@
#define SHUTTER_DELAY 200
#define INSTRUCTION_BYTES_PAN_SPEED 1
#define INSTRUCTION_STEP_MODE 'm'
#define INSTRUCTION_PAN_STEPS 'P'
#define INSTRUCTION_TILT_STEPS 'T'
@@ -132,7 +133,7 @@
#define NUM_LEDS 1
#define BRIGHTNESS 255
#define VERSION_NUMBER "2.1.1"
#define VERSION_NUMBER "2.2.1"
/*------------------------------------------------------------------------------------------------------------------------------------------------------*/