|
|
@ -38,7 +38,7 @@ void setup() { |
|
|
|
|
|
|
|
// Delay for a while to let the CPU settle down
|
|
|
|
delay(10); |
|
|
|
pinMode(LED_BUILTIN, OUTPUT); |
|
|
|
// pinMode(LED_BUILTIN, OUTPUT);
|
|
|
|
|
|
|
|
// Serial.print(F("Initializing Motors: "));
|
|
|
|
// Initialize motors
|
|
|
@ -57,9 +57,10 @@ void setup() { |
|
|
|
NULL, |
|
|
|
2, // Priority. With 3 (configMAX_PRIORITIES - 1) being the highest and 0 being the lowest.
|
|
|
|
NULL, |
|
|
|
ARDUINO_RUNNING_CORE |
|
|
|
CORE0 |
|
|
|
); |
|
|
|
|
|
|
|
/***
|
|
|
|
xTaskCreatePinnedToCore( |
|
|
|
taskBlink, |
|
|
|
"TaskBlink", // Name of the process
|
|
|
@ -67,8 +68,9 @@ void setup() { |
|
|
|
NULL, |
|
|
|
1, // Priority. With 3 (configMAX_PRIORITIES - 1) being the highest and 0 being the lowest.
|
|
|
|
NULL, |
|
|
|
ARDUINO_RUNNING_CORE |
|
|
|
CORE0 |
|
|
|
); |
|
|
|
***/ |
|
|
|
} |
|
|
|
|
|
|
|
void loop() { |
|
|
@ -140,10 +142,10 @@ void loop() { |
|
|
|
// delay(100);
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void taskMotor(void *pvParameters) { |
|
|
|
(void) pvParameters; |
|
|
|
|
|
|
|
uint32_t counter = 0; |
|
|
|
for(;;) { |
|
|
|
/***
|
|
|
|
motors.write_motor(MOTOR1, 1046); |
|
|
@ -151,12 +153,17 @@ void taskMotor(void *pvParameters) { |
|
|
|
motors.write_motor(MOTOR3, 1146); |
|
|
|
motors.write_motor(MOTOR4, 1246); |
|
|
|
***/ |
|
|
|
motors.write_motor(1046, 1346, 1146, 2040); |
|
|
|
//motors.write_motor(1046, 1046, 1046, 1046);
|
|
|
|
vTaskDelay(1); |
|
|
|
counter++; |
|
|
|
if(!(counter % 10)) { |
|
|
|
motors.write_motor(1046, 1346, 1146, 2040); |
|
|
|
} else { |
|
|
|
//motors.write_motor(1046, 1046, 1046, 1046);
|
|
|
|
vTaskDelay(1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/****
|
|
|
|
void taskBlink(void *pvParameters) { |
|
|
|
(void) pvParameters; |
|
|
|
|
|
|
@ -169,3 +176,8 @@ void taskBlink(void *pvParameters) { |
|
|
|
vTaskDelay(10); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void delay(uint32_t ms) { |
|
|
|
vTaskDelay(ms / portTICK_PERIOD_MS); |
|
|
|
} |
|
|
|
****/ |