For a dynamic bell curve, i'm using a standard formula on the teensy and a line command to the nextion display (maxed on 115200 baud).
It works, but the 'line' command is quite long, and seems to slow things down when one parameter changes.
i'm only passing the changed pixels of the bell curve (2 commands: one to clear the old, and one the put in the new) when turning knobs.
for example:
line 100,199,100,199,BLACK (to clear the old pixel)
line 100,200,100,200,RED (for the new pixel)
I'd rather just pass the parameters (bell center height, bell width and position on x-axis of the bell center) once so the nextion can calculate the bell curve itself because it isn't a hard formula to crunch, but my probem is:
nextion can't handle the exp() function.
this is a simplified example of the formula. The Teensy is obviously fast enough, just the serial communication too slow for so many pixel commands.
exp(-0.5 * (i - freq) *(i-freq)/(Q*Q)) / (5*sqrt(2*M_PI)); (where i is the position on the x axis (eg from 0 to 320).
Any thoughts?
It works, but the 'line' command is quite long, and seems to slow things down when one parameter changes.
i'm only passing the changed pixels of the bell curve (2 commands: one to clear the old, and one the put in the new) when turning knobs.
for example:
line 100,199,100,199,BLACK (to clear the old pixel)
line 100,200,100,200,RED (for the new pixel)
I'd rather just pass the parameters (bell center height, bell width and position on x-axis of the bell center) once so the nextion can calculate the bell curve itself because it isn't a hard formula to crunch, but my probem is:
nextion can't handle the exp() function.
this is a simplified example of the formula. The Teensy is obviously fast enough, just the serial communication too slow for so many pixel commands.
exp(-0.5 * (i - freq) *(i-freq)/(Q*Q)) / (5*sqrt(2*M_PI)); (where i is the position on the x axis (eg from 0 to 320).
Any thoughts?