8 years, 7 months ago.

how to clear this below error

  1. include "mbed.h"
  2. include "rtos.h" DigitalOut pin(p20); DigitalOut pin1(p21); DigitalOut pin2(p22); DigitalOut pin3(p18);

void sensor_thread(void const *args) { if(pin3) { Thread thread(motor_thread); } } void motor_thread(void const *args) { while (true) { pin1=1; pin2=0; wait(2); pin1=0; pin2=1; wait(2); } }

int main() { Thread thread(sensor_thread);

} Error: Identifier "motor_thread" is undefined in "main.cpp", Line: 14, Col: 18

Be the first to answer this question.