ignasxvv / master-of-education

Interactive learning Project based on Reactino (Arduino-serial, React and NodeJS)
https://react-master-of-education1.vercel.app/
1 stars 1 forks source link

Serial Data structure #40

Open ignasxvv opened 3 months ago

ignasxvv commented 3 months ago

The Potentiometer and buttons follow the following structure;

struct Button {
  int previousVal = 0;
  int currentVal = 0;
  int pin;
  String label;

  Button() {} 

...

}

The following are the labels for the Potentiometers; ( X, Y, Z, A, B, C ) String pontMeterLabels[NUM_OF_POTMETERS] = {"X", "Y", "Z", "A", "B", "C"};

Whenever one of the analogRead() value of any button changes, the serial send out a string of all the data, in the format of label:value {X:27},{Y:0},{Z:0},{A:0},{B:60},{C:84}

The other approach will be only sending the data that changed..

let me know what will you prefer