0

Edge Badge Issues
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Edge Badge Issues

by jcafiero86 on Sun May 09, 2021 9:30 am

Hi all,

Not sure if I'm placing this in the right location but I'll ask anyways.

I Just got my hands on a Adafruit Edge Badge and managed to load some NES games. It loads up fine but the badge is cusing issue, on the screen the selected option keeps moving like if the directional key is pressed when is not. The physical part of the buttons appear fine but it acts like the up key is pressed. Did I get a diffective badge?

jcafiero86
 
Posts: 10
Joined: Thu Apr 15, 2021 7:05 pm

Re: Edge Badge Issues

by blnkjns on Sun May 09, 2021 12:36 pm

Just check with some code, for example this Arduino script, if the up-button is stuck.
Code: Select all | TOGGLE FULL SIZE
boolean buttonMap[8];
#define BUTTON_CLOCK 48
#define BUTTON_DATA  49
#define BUTTON_LATCH 50

void readButtons(){
  digitalWrite(BUTTON_LATCH, HIGH);
  for(int i=0;i<8;i++){
    digitalWrite(BUTTON_CLOCK, LOW);
    buttonMap[i]=digitalRead(BUTTON_DATA);
    digitalWrite(BUTTON_CLOCK, HIGH);
  }
  digitalWrite(BUTTON_LATCH, LOW);
}

void setup(){
  Serial.begin(9600);
  while (!Serial){}
{

void loop(){
  readButtons();
  for (byte n=0;n<8;n++){
    Serial.print(buttonMap[i]);
    Serial.print("  ");
  }
  Serial.print("\n");
  delay(200);
}

Watch the Serial Monitor and look for any strange output of the buttons.

blnkjns
 
Posts: 610
Joined: Fri Oct 02, 2020 3:33 am

Re: Edge Badge Issues

by jcafiero86 on Sun May 09, 2021 10:11 pm

Unfortunatly the code you provided did not work, spit out (a function-definition is not allowed here before '{' token) error. I tried the badge once more and not one directional keys is working at all but the upwards movement when in the game stopped. just trying to reset the badge and start from scrtch for the 10th time

jcafiero86
 
Posts: 10
Joined: Thu Apr 15, 2021 7:05 pm

Re: Edge Badge Issues

by blnkjns on Mon May 10, 2021 12:37 am

Wrong direction of the bracket at the end of Setup and n should be i (did type it here, not in the IDE):
Code: Select all | TOGGLE FULL SIZE
boolean buttonMap[8];
#define BUTTON_CLOCK 48
#define BUTTON_DATA  49
#define BUTTON_LATCH 50

void readButtons(){
  digitalWrite(BUTTON_LATCH, HIGH);
  for(int i=0;i<8;i++){
    digitalWrite(BUTTON_CLOCK, LOW);
    buttonMap[i]=digitalRead(BUTTON_DATA);
    digitalWrite(BUTTON_CLOCK, HIGH);
  }
  digitalWrite(BUTTON_LATCH, LOW);
}

void setup(){
  Serial.begin(9600);
  while (!Serial){}
}

void loop(){
  readButtons();
  for (byte n=0;n<8;n++){
    Serial.print(buttonMap[n]);
    Serial.print("  ");
  }
  Serial.print("\n");
  delay(200);
}

blnkjns
 
Posts: 610
Joined: Fri Oct 02, 2020 3:33 am

Re: Edge Badge Issues

by jcafiero86 on Mon May 10, 2021 2:26 pm

Not entierly sure but after sevral fresh resets I was able to get it to work. I got a .nes file with a mario game and loaded it. it appears to work fine now, I'm gessing ether the rom's wher bad or i must have been skiping a step at some point. Anyways Now I got one game on here I need to see if I can expand the memory becouse with only 2mb to add roms not sure what else i can add.
Thank you for the assist you tried to give.

jcafiero86
 
Posts: 10
Joined: Thu Apr 15, 2021 7:05 pm

Please be positive and constructive with your questions and comments.