source: rtos_arduino/trunk/examples/MultiTask/r2ca_app.cpp@ 260

Last change on this file since 260 was 260, checked in by ertl-honda, 8 years ago

マクロ名を更新.
実行モデルを変更.

File size: 1023 bytes
Line 
1#include "r2ca.h"
2
3/*
4 * For MAINTASK
5 */
6void setup() {
7 Serial.begin(115200);
8 Serial.println("setup() : running ");
9
10 pinMode(13, OUTPUT);
11}
12
13int loop_cnt = 0;
14
15void loop() {
16 Serial.print("loop() : running ");
17 Serial.print(loop_cnt++);
18 Serial.println(" .");
19 delay(1000);
20}
21
22/*
23 * For TASK1
24 */
25void loop1() {
26 digitalWrite(13, HIGH);
27 delay(1000);
28 digitalWrite(13, LOW);
29 delay(1000);
30}
31
32int task2_loop_cnt = 0;
33
34/*
35 * For TASK2
36 */
37void loop2() {
38 Serial.print("task2_loop() : running ");
39 Serial.print(task2_loop_cnt++);
40 Serial.println(" .");
41 delay(2000);
42}
43
44int task3_loop_cnt = 0;
45
46/*
47 * For TASK3
48 */
49void loop3() {
50 Serial.print("task3_loop() : running ");
51 Serial.print(task3_loop_cnt++);
52 Serial.println(" .");
53 delay(2000);
54}
55
56int task4_loop_cnt = 0;
57
58/*
59 * For TASK4
60 */
61void loop4() {
62 Serial.print("task4_loop() : running ");
63 Serial.print(task4_loop_cnt++);
64 Serial.println(" .");
65 delay(2000);
66}
67
Note: See TracBrowser for help on using the repository browser.