Skip to main content

Posts

codeBox.js

ESP32-CAM: Stream Video with an Asynchronous Web Server

  Introduction This project was developed under two main characteristics: efficiency and scalability. The original example available on the Arduino IDE, "ESP32/Camera/CameraWebServer.ino" is a great example for beginners and runs well. However, a problem arises when I tried to escalate the project. I decided to rebuild the entire application to adjust to my necessities, rewrite the code, delete unnecessary parts, create a directory, and keep single files (.cpp, .h, .html, .css, .js, etc.) I used  PlarformIO with VSCode to create the project structure, for directory management. I adapted the server code to run with an asynchronous web server, this gives me the ability to handle multiple connections from different clients simultaneously without blocking the main program flow. The frontend was developed using responsive design to adapt to different screens, additional for mobile devices was implemented a full-screen mod...

ESP32 SPI Master - Slave

The SPI (Serial Peripheral Interface) acts as a synchronous data bus used to send data between microcontrollers and small peripherals that use separate lines for data and a clock that keeps both sides in perfect sync. In SPI only one side generates the clock signal ( SCK for serial clock). The side that generates the clock is called the Controller or the Master, and the other side is called the Peripheral or the Slave. There is always only one Controller , but there can be multiple Peripherals . Data sharing from the  Controller to the  Peripheral is sent on a data line called COPI (Controller Output Peripheral Input). If the Peripheral  needs to send a response back to the Controller data is sent on the line called CIPO (Controller Input Peripheral Output). The last line is called CS (Chip select) or SS (Slave select). This tells the peripheral that it should wake up and receive/send data and is also used when multip...