1 of 1 people found this helpful
To speed-up development process I may suggest using custom rotary encoder and button switch components. The AN for QuadDecoder also includes an example of the 2x16 LCD menu control:
The button switches shown on the picture have quite a bit of ringing and must be debounced. The ButtonSw32 component can handle this issue.
3. The choice of Vref for ADC depends on joystick voltage output range. Typically, internal Vref=1.024V is sufficient. Joystick accuracy is typically low (<8bit), so enabling a bypass pin \Joystick:SAR:Bypass\ for a bypass capacitor is not necessary.
2. UART gives freedom to invent own protocol. Typical approach is to assign a 1-byte prefix for each specific command, followed by a value and termination. For example, let's make 1-byte command prefix id:
J - joystick
B - button (pressed)
b - button (released)
S - start
Then a control message may look like this:
"J" + "10" + "20" + LF+CR (each one is a byte) will send joystick position (10,20). Corresponding HEX string: "0x4A 0x0A 0x14 0x0D 0x0A"
"B" + "2" + LF+CR will send buttons pressed event (bit 2 corresponds to button 2). Corresponding HEX string: "0x42 0x02 0x0D 0x0A"
You can find basic UART Rx demo showing decoding such commands for RGB LED control (like "R128\r\n") here: