Buttons

Advice on general approaches or feasibility and discussions about game design

Buttons

Postby cotonswag » Mon Jul 14, 2014 4:51 pm

I'm making my own gamebuino and I'm adding a WiFi module (The CC3000.) in place of uSD card. The uSD slot is broken out on the back of the display which is a 1.8" TFT module in SPI type format. I'm also taking away the FTDI chip because there is an easier and more faster way to program it ( http://hackaday.com/2012/02/21/flash-an ... n-sd-card/). Also I'm replacing the magnetic speaker with a headphone jack so I can listen to music with it. The only problem that I have is that I want to replace the directional buttons and the C button with a 5 way switch. I don't know which pins I connect to the 5-way to have it operate correctly. The switch I'm using is from sparkfun.com and the part number is COM-10063. Does anyone know what pin numbers (e.g BTN0 , BTNB etc.) Go to which buttons. Thanks.
cotonswag
 
Posts: 1
Joined: Mon Jul 14, 2014 4:17 pm

Re: Buttons

Postby rodot » Mon Jul 14, 2014 5:01 pm

Button pins are in the schematics. You can find them in the "hardware" category of the wiki.

The matching between button ID and functionis in arduino/libraries/gamebuino/settings.c :
Code: Select all
//buttons ID
#if DISPLAY_ROT == 0
   #define BTN_UP      1
   #define BTN_RIGHT   2
   #define BTN_DOWN    3
   #define BTN_LEFT    0
#elif DISPLAY_ROT == ROTCCW
   #define BTN_UP      2
   #define BTN_RIGHT   3
   #define BTN_DOWN    0
   #define BTN_LEFT    1
#elif DISPLAY_ROT == ROT180
   #define BTN_UP      3
   #define BTN_RIGHT   0
   #define BTN_DOWN    1
   #define BTN_LEFT    2
#elif DISPLAY_ROT == ROTCW
   #define BTN_UP      0
   #define BTN_RIGHT   1
   #define BTN_DOWN    2
   #define BTN_LEFT    3
#endif
#define BTN_A           4
#define BTN_B           5
#define BTN_C           6
//buttons pins
#define BTN_UP_PIN      9
#define BTN_RIGHT_PIN   7
#define BTN_DOWN_PIN    6
#define BTN_LEFT_PIN    8
#define BTN_A_PIN       4
#define BTN_B_PIN       2
#define BTN_C_PIN       A3
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France


Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 111 guests

cron