firmware.ino 730 B

123456789101112131415161718192021222324252627282930
  1. #include "firmware.h"
  2. void setup() {
  3. // Begin serial communication.
  4. Serial.begin(230400); // 115200
  5. // Initialize the camera model.
  6. initialize_camera_model();
  7. // Initialize the camera configuration.
  8. initialize_camera_config();
  9. // Initialize the camera.
  10. initialize_camera();
  11. }
  12. // Main loop of the program.
  13. void loop() {
  14. if (camera_model.isStreamEnabled) {
  15. camera_fb_t* frame_buffer = esp_camera_fb_get();
  16. if (frame_buffer) {
  17. process_image(frame_buffer);
  18. // Return the frame buffer back to the camera driver.
  19. esp_camera_fb_return(frame_buffer);
  20. }
  21. delay(50);
  22. }
  23. handle_flash_state();
  24. process_serial_commands();
  25. }