gcormier / megadesk

Open-source IKEA Bekant controller board
GNU General Public License v3.0
719 stars 53 forks source link

Serial rework with human-readable option and Tone command #70

Closed philwmcdonald closed 3 years ago

philwmcdonald commented 3 years ago

Added Tone command to play tones over serial.

Added #define option for human-readable serial output. Note that this almost maxes out the available flash.

Reworked serial so that commands can be viewed/controlled char-by-char by humans. try these example commands: <T2000,255 <=3000,. <C0.0. <+200,0. <L.2. <C.. <R,0 <R.34

Avoid processing anything if currentHeight =0. This situation uncovered with serial monitoring. outputs: <=x,0 <-x,0 <=0,0, <+x,0 <=x,0 at the end of memory-moves.

Various memory savings.

Avoid bad targetHeight values which can happen if bad data is read from eeprom.

Without serial: RAM: [==== ] 41.6% (used 213 bytes from 512 bytes) Flash: [======== ] 84.5% (used 6924 bytes from 8192 bytes)

with regular serial: RAM: [====== ] 55.1% (used 282 bytes from 512 bytes) Flash: [========= ] 93.3% (used 7640 bytes from 8192 bytes)

with human-readable serial: RAM: [====== ] 56.1% (used 287 bytes from 512 bytes) Flash: [==========] 98.4% (used 8062 bytes from 8192 bytes)