Skip to content

Refactor the serial communication of ESP32 and Mega to be content agnostic #2

@Recelis

Description

@Recelis

Currently, the communication between the ESP32 is the {...weatherforecast, location, dayOfWeek} and the Arduino Mega consumes this and converts it into LCDBoxes to be displayed on the screen.

This is an issue when I want to start displaying temperature values from other ESP32Monitoring systems.

To fix this:

  • generalise and standardise the communication between ESP32 to Mega.
    • This can be of the form: {box_n: [{text, size?, colour?}]}
      • this logic will have to take place in the ESP32 side.
    • There may be a mapping needed for the ESP32Monitoring device and the box_n so that the order of the different ESP32Monitoring devices remains the same
      • {box_n: esp32monitoring_id or esp32monitoring_mac_address (default = null)}
  • On the mega side, refactor to read values in and for each line in the box_n array.
  • automatically calculate the x and y positions of each box and write to the screen.
    • for box n,
      • x = round((n % 4 ) * WINDOW_X_SIZE / 4 + X_OFFSET);
      • y = round(n/4 * WINDOW_Y_SIZE / 2 + Y_OFFSET);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions