Skip to content

Commit 74cc070

Browse files
committed
v1.0.0: update readme with basic example
1 parent 0e65b58 commit 74cc070

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RTO_SDK share the same framework with esp-idf [https://github.com/espressif/esp-
2525

2626
* [Features](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#features)
2727
* [Installation](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#installation)
28+
* [Examples](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#examples)
2829
* [Limitations](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#limitations)
2930
* [To Do List](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#to-do-list)
3031
* [List of remaining core files to adapt test and fix](https://github.com/alexCajas/esp8266RTOSArduCore/tree/main#list-of-core-files-to-adapt-test-and-fix)
@@ -71,6 +72,69 @@ pip3 install -r requirements.txt
7172

7273
* **Now you are ready to write and install sketchs using Arduino IDE or VScode IDE!**
7374

75+
# Examples
76+
77+
* **Basic blink example**
78+
~~~
79+
80+
/*
81+
* Based on arduino esp32 arduino core FreeRTOS.ino example.
82+
*/
83+
84+
#ifndef LED_BUILTIN
85+
#define LED_BUILTIN 2
86+
#endif
87+
88+
// define two tasks for Blink
89+
void TaskBlink( void *pvParameters );
90+
91+
// the setup function runs once when you press reset or power the board
92+
void setup() {
93+
94+
// initialize serial communication at 115200 bits per second:
95+
Serial.begin(115200);
96+
97+
// Now set up tasks to run independently.
98+
xTaskCreatePinnedToCore(
99+
TaskBlink
100+
, "TaskBlink" // A name just for humans
101+
, 1024 // This stack size can be checked & adjusted by reading the Stack Highwater
102+
, NULL
103+
, 2 // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest.
104+
, NULL
105+
, ARDUINO_RUNNING_CORE); // in esp8266 allways is 0
106+
107+
// Now the task scheduler, which takes over control of scheduling individual tasks, is automatically started.
108+
}
109+
110+
void loop()
111+
{
112+
// do nothing.
113+
}
114+
115+
116+
void TaskBlink(void *pvParameters)
117+
{
118+
pinMode(LED_BUILTIN, OUTPUT);
119+
120+
while (true) // A Task shall never return or exit.
121+
{
122+
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
123+
vTaskDelay(pdMS_TO_TICKS(500));
124+
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
125+
vTaskDelay(pdMS_TO_TICKS(500));
126+
}
127+
}
128+
129+
~~~
130+
131+
* More examples in
132+
~~~
133+
~/.arduino15/packages/esp8266RTOS/hardware/esp8266RTOS/1.0.0/libraries/
134+
~~~
135+
136+
![Online code generation tool](assets/img/examples.png)
137+
74138
# Limitations
75139

76140
* The compatibility between libraries of esp8266ArduinoCore based on NONOSDK, and this core, esp8266RTOSArduCore based on FreeRTOS is limited, in general you can use the same esp8266ArduinoCore libraries that have compatibily with esp32 arduino core.
@@ -184,7 +248,7 @@ pip3 install -r requirements.txt
184248
- [ ] Update
185249
- [ ] ArduinoOta
186250
- [ ] EEPROM
187-
- [ ] ESP[32|8266] examples
251+
- [x] ESP[32|8266] examples
188252
- [ ] FFat
189253
- [ ] FS
190254
- [ ] NetBios

assets/img/examples.png

233 KB
Loading

0 commit comments

Comments
 (0)