What if you want to be able to control the LED both via Website and Serial?
This is where low.js shines. Everything is done asyncronly, so you can just paste the content of both
/index.js together, remove duplicate lines such as duplicate requires and one of the two
let state = 0; lines, and it just works.
Even more examples
Please take a look at our examples GitHub repository.
Interfacing sensors and modules
A great IoT project needs more than just an on-board LED. For example, to build an autonomous car, you most probably would interface:
- One motor via motor driver for driving forward or backwards and braking
- One servo motor for the steering
- Distance sensor to detect walls
- GPS module
This is what microcontrollers like the ESP32 are made for. For information on how to use the ESP32 peripherials available on the board, please take a look at the low.js for ESP32 API documentation.
The basics on how to interface, such as the basics of electronics and the different bus systems and protocols, are not low.js specific and thus are not handled here.
If you want to learn about both thoroughly, please take a look at the neonious IoT Electronics Kit.