Posted: 08:31am 17 Jan 2026 Copy link to clipboard
karlelch Guru
I got one. It is really small but has nice buttons (not too clicky) and a nice joystick. Here is code (generated with a little help by Gemini):
' Test program for Adafruit Mini I2C Gamepad with seesaw ' ----------------------------------------------------------------------- Option EXPLICIT Option DEFAULT INTEGER
' Gamepad data type Type TGamePad joyX As Integer ' Joystick values joyY As Integer StartBtn As Integer ' Buttons SelBtn As Integer BtnA As Integer BtnB As Integer BtnX As Integer BtnY As Integer End Type
' ----------------------------------------------------------------------- Dim gpData As TGamePad
Do gpData = SeesawGamePad()
Print @(0,0) "Joystick x=";Str$(gpData.joyX, 4, 0); Print " y=";Str$(gpData.joyY, 4, 0);" "; Print "Buttons: "; If gpData.StartBtn Then Print "START " Else Print "_____ "; If gpData.SelBtn Then Print "SEL "; Else Print "___ "; If gpData.BtnA Then Print "A "; Else Print "_ "; If gpData.BtnB Then Print "B "; Else Print "_ "; If gpData.BtnX Then Print "X "; Else Print "_ "; If gpData.BtnY Then Print "Y "; Else Print "_ "; Print
Pause 50 Loop End
' ======================================================================= ' Gamepad function ' ----------------------------------------------------------------------- Function SeesawGamePad() As TGamePad ' Reads out the connected Adafruit Mini I2C Gamepad with seesaw ' On the first call, it initializes the GamePad Static Integer isFirst = 1, rBuf(3), buttons
If isFirst Then ' Configure I2C Print "Initializing I2C ..." SetPin GPAD_SDA_PIN, GPAD_SCL_PIN, I2C I2C OPEN 400, 500
' Create Pin Mask for all buttons. This tells the controller which ' pins we are configuring. Seesaw expects 4 bytes (32-bit word), ' Big Endian (MSB first), hence mask bytes: 00, 01, 00, 67 Print "Configuring Gamepad ..." ' 1. Set Direction to INPUT (DIRCLR) I2C WRITE GPAD_ADDR, 0, 6, GPAD_REG_GPIO, GPIO_DIRCLR, 0, 1, 0, &H67 Pause 10 ' 2. Enable Pull-up resistors (PULLENSET) I2C WRITE GPAD_ADDR, 0, 6, GPAD_REG_GPIO, GPIO_PULLEN, 0, 1, 0, &H67 Pause 10 ' 3. Set Pull-ups High (GPIO_SET) I2C WRITE GPAD_ADDR, 0, 6, GPAD_REG_GPIO, GPIO_SET, 0, 1, 0, &H67 Pause 10 Print "Done." IsFirst = 0 EndIf