5.2 Implementation
In this demo, a 7 x 7 LED matrix is used as a display to show the snake and the food dot. A suitable LED driver/multiplexer is used to drive the LEDs via I2C serial communication. To input the navigation commands, the demo will use a 4 x 4 capacitive touch surface that supports tap, swipe, wheel, and other 2D gestures. To change the snake’s direction, the following gestures need to be used on the touch surface: Up, down, left, and right swipe. The application code is run on an AVR DA microcontroller. The built-in PTC peripheral and the Microchip Touch Library enable the easy integration of the touch surface for 2D gesture recognition.
The AVR128DA48 microcontroller is used for the demo, but it can also be realized through other microcontrollers of the AVR DA family.