This week's assignment involved application programming. For this, I wanted to play around with making a fun game and connect it to my xiao rp2040 that was connected to the control joystick for direction.
The first game that came across my mind was snakeio where directionality is a very important component so I thought it would be fun to use p5js for this. I began by writing the application.
Next was the embedding process. After wiring a breadboard with the microcontroller and controllers, I wrote a simple code that would replace key inputs in a keyboard with a joystick. However there was an error in code that caused the joystick control to not go through.
Since, it was a simple bug related to tolerance, after toggling values it worked really well.
The PCB milling process was almost the same as week 12 application week for the joystick module so I replaced it with xiao esp32 s3 as a microcontroller. I just made one small change of removing the voltage regulator as the controller does not need a battery. I decided to just connect it directly to the 3V3 supply. Luckily, this really simplified the PCB design.
[LEFT] kicad circuit to export gerber files.
[CENTER] Using flatcam do extract gcode for cnc.
[RIGHT] Candle software for the Lunyee CNC. Mainly used three passes - engrave, drill and cut.
Here it is after milled.
Now here is the final game being played!
Initially since I had to bring a new code, there were some discrepancies with values and as you can see in the centre gif, the interaction from the controller to game was not fully smooth.