Merge branch 'servoIssue' into 'master'

Servo issue #12

See merge request ACD52832_MasterExample/ACD52832_MasterExampleFW!20
This commit is contained in:
Jurica Rešetar
2019-03-21 12:50:58 +01:00
5 changed files with 13785 additions and 29463 deletions
+3 -1
View File
@@ -366,7 +366,6 @@ State *ServoInstructionState::handleEvent(IOEXP_INT_SOURCE intSource)
if(intSource == IOEXP_INT_SOURCE::JOY_CENTER)
{
vTaskSuspend(servoTask);
servo.write(0.5f);
returnStatep = new ServoExampleState();
}
else
@@ -390,7 +389,10 @@ State *ServoExampleState::handleEvent(IOEXP_INT_SOURCE intSource)
if(intSource == IOEXP_INT_SOURCE::JOY_CENTER)
{
vTaskSuspend(servoTask);
servo.enable();
servo.write(0.5f);
waitMs(150);
servo.disable();
returnStatep = new ServoMenuState(EPD_WRITE_METHOD::FULL);
}
+13773 -29458
View File
File diff suppressed because it is too large Load Diff
+7 -2
View File
@@ -761,7 +761,10 @@ void servoFunction(void *arg)
servo.init();
servo.calibrate(0.00095, 90);
servo.enable();
servo.write(0.5f);
waitMs(SERVO_DELAY_MS);
servo.disable();
while(1)
{
@@ -771,9 +774,11 @@ void servoFunction(void *arg)
{
if(servo.read() > 0.1)
{
servo.enable();
percentage = servo.read() - 0.1f;
servo.write(percentage);
waitMs(SERVO_DELAY_MS);
servo.disable();
}
break;
}
@@ -781,16 +786,16 @@ void servoFunction(void *arg)
{
if(servo.read() < 0.90)
{
servo.enable();
percentage = servo.read() + 0.1f;
servo.write(percentage);
waitMs(SERVO_DELAY_MS);
servo.disable();
}
break;
}
default:
{
servo.write(servo.read());
waitMs(SERVO_DELAY_MS);
break;
}
}
+1 -1
View File
@@ -35,7 +35,7 @@
#define QUEUE_DEFAULT_SIZE (10)
#define TICKS_TO_BLOCK_DEFAULT (10)
#define GET_INTERRUPT_DELAY_MS (1)
#define SERVO_DELAY_MS (50)
#define SERVO_DELAY_MS (100)
#define POT_DELAY_MS (500)
/**