From: AceVest Date: Mon, 18 Jun 2018 09:33:47 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=94e4fb53ecd982a81e24c821683559054abf284b;p=acecode.git ... --- diff --git a/arduino/hardware/ace/avr/cores/avr/app.cpp b/arduino/hardware/ace/avr/cores/avr/app.cpp index ab21c29..0b517b9 100644 --- a/arduino/hardware/ace/avr/cores/avr/app.cpp +++ b/arduino/hardware/ace/avr/cores/avr/app.cpp @@ -42,10 +42,16 @@ void user_task1() { uint8_t user_task2_stack[TASK_STACK_SIZE]; void user_task2() { int cnt = 0; + uint8_t pin = 14; + set_digital_pin_mode(pin, OUTPUT); + uint8_t state = LOW; + while(1) { + state = state == LOW ? HIGH : LOW; + digital_write(pin, state); Serial.print("user task 2, cnt: "); Serial.println(cnt++); - task_delay(90); + task_delay(random() % 50); } } #endif