Releases: NodeppOfficial/nodepp-arduino
Releases · NodeppOfficial/nodepp-arduino
Nodepp : Stable Release : V1.3.0
- 📌: Node.js-like API: Write C++ code in a syntax and structure similar to Node.js, making it easier to learn and use.
- 📌: Embedded-compatible: Compatible with several devices like Arduino UNO | Esp8266 | Esp32 | Stm32
- 📌: High-performance: Leverage the speed and efficiency of C++ for demanding applications.
- 📌: Scalability: Build applications that can handle large workloads and grow with your needs.
- 📌: Open-source: Contribute to the project's development and customize it to your specific requirements.
improvements
- 📌: unix char decorator have been removed from
console.handconio.h. - 📌: events now are hard erased instead of soft erased to reduce memory usage.
- 📌: stream objects like
serial_torfile_thave been refined for better control and stability. - 📌:
promise_thave been refined and now are supported by coroutines for better asynchronous performance.
Articles
Example
#include <nodepp/nodepp.h>
#include <nodepp/timer.h>
#include <nodepp/promise.h>
using namespace nodepp;
void onMain() { Serial.begin( 9600 );
promise_t<int, except_t> delayed_promise([=](res_t<int> res, rej_t<except_t> rej) {
console::log("Promise started, waiting for 1 second...");
timer::timeout([=]() { res(10); }, 1000);
});
delayed_promise.emit(); // Start the asynchronous task immediately
process::add( coroutine::add( COROUTINE(){
coBegin
console::log("Coroutine started. Pausing until promise settles...");
coWait( delayed_promise.is_pending() );
console::log("Promise settled! Checking result...");
if ( delayed_promise.is_resolved() ) {
console::done( "Resolved value:", delayed_promise.get_value().value() );
} elif ( delayed_promise.is_rejected() ) {
console::error("Rejected with error:", delayed_promise.get_value().error() );
} else {
console::error("Something Went Wrong");
}
coFinish
}));
}Nodepp : Stable Release : V1.2.0
- 📌: Node.js-like API: Write C++ code in a syntax and structure similar to Node.js, making it easier to learn and use.
- 📌: Embedded-compatible: Compatible with several devices like Arduino UNO | Esp8266 | Esp32 | Stm32
- 📌: High-performance: Leverage the speed and efficiency of C++ for demanding applications.
- 📌: Scalability: Build applications that can handle large workloads and grow with your needs.
- 📌: Open-source: Contribute to the project's development and customize it to your specific requirements.
#include <nodepp.h>
using namespace nodepp;
void onMain(){
for( auto x: ptr_t<uchar>({ 12, 13 }) ){
pinMode( x, OUTPUT );
}
process::add( coroutine::add( COROUTINE(){
static bool state = false;
coBegin
for(;;){
digitalWrite( 12, state );
coDelay(300); state =! state; }
coFinish
}));
process::add( coroutine::add( COROUTINE(){
static bool state = false;
coBegin
for(;;){
digitalWrite( 13, state );
coDelay(1000); state =! state; }
coFinish
}));
}