Arduboy game moving on its own

Hi, i made an arduboy using Arduino pro micro with an I2C OLED display.

All works fine but when i upload this code below the game just moves own its own. Any solution on how to fix it?
Thank you.

arduino_code_.zip (11.6 KB)

looks like the problem is this code:

/* button setup for Arduboy Production */
uint8_t pin_up = 3;
uint8_t pin_down = 4;
uint8_t pin_fire = 5;

The pin numbering is incorrect, try:

/* button setup for Arduboy Production */
uint8_t pin_up = A0;
uint8_t pin_down = A3;
uint8_t pin_fire = 7;

alternatively you could also use pin 8 for fire (B- button instead of A-button)

1 Like

Thanks alot it works now

1 Like

is there a way to disable Auto Fire in this code?

You could try changing

st_Step(y, /* is_auto_fire */ 0, /* is_fire */ digitalRead(pin_fire));

to

st_Step(y, /* is_auto_fire */ 1, /* is_fire */ digitalRead(pin_fire));

(Line 1700)

1 Like

Thanks, it works now