start hoverbrett visualization
This commit is contained in:
parent
1c8c75ce57
commit
373dca44d6
5 changed files with 416 additions and 0 deletions
17
visualizationtest/testsender/testsender.ino
Normal file
17
visualizationtest/testsender/testsender.ino
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
float voltage=50.2;
|
||||
float current=0;
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN));
|
||||
voltage=constrain(voltage+random(-10,11)/100.0, 10*3.3,12*4.2);
|
||||
current=constrain(current+random(-40,41)/10.0, 0,50);
|
||||
|
||||
Serial.write((uint8_t *) &voltage, sizeof(voltage));//float 4bytes
|
||||
Serial.write((uint8_t *) ¤t, sizeof(voltage));//float 4bytes
|
||||
delay(20);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue