This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

finding pin assignment for unknown beacon.

Hi,

I bought an nrf51822 beacon from ebay, it has an LED and a button. I am trying to figure out what pins the LED and the button are connected to, without much success. For a start, I was hoping the code below would blink the led, but it doesn't. The beacon works fine, I can run other code on it, and the LED did work with the original firmware. Any other ideas?

for (int pin_number = 1; pin_number <= 31; pin_number++) {
	nrf_gpio_cfg_output(pin_number);    //config pin as output
}

while (true) {
	for (int pin_number = 1; pin_number <= 31; pin_number++) {
		nrf_gpio_pin_toggle(pin_number);
		nrf_delay_ms(500);
	}
}

Thanks!

Parents
  • You are right, that code should work. I would anyway do two things:

    1. Try it on nRF5x DK first (there should be 4 LEDs to play with and it should work there as well).
    2. I would modify the code to work only with single output PIN at the time. E.g. to go PIN by PIN and spend 500-2000ms on each, alternatively to try blinking each of them to signal which position you are at (e.g. 500ms long periods to signal tens and 150ms short periods to signal 1-9 digits, that will be easier to read then 27 short blinks;)
Reply
  • You are right, that code should work. I would anyway do two things:

    1. Try it on nRF5x DK first (there should be 4 LEDs to play with and it should work there as well).
    2. I would modify the code to work only with single output PIN at the time. E.g. to go PIN by PIN and spend 500-2000ms on each, alternatively to try blinking each of them to signal which position you are at (e.g. 500ms long periods to signal tens and 150ms short periods to signal 1-9 digits, that will be easier to read then 27 short blinks;)
Children
No Data
Related