Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 2 months ago.
nRF51822 Ticker
Hi,
I'm working with nRF51822-EK and I want to use Tickers in my project. When i'm using only one ticker then it works fine. But when I'm using two tickers then my program hang after executing first ticker callback. Here is example code:
#include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); void periodicCallback1(void) { led1 = !led1; } void periodicCallback2(void) { led2 = !led2; } int main() { led1 = 0; led2 = 0; Ticker ticker_led1; ticker_led1.attach(periodicCallback1, 1); Ticker ticker_led2; ticker_led2.attach(periodicCallback2, 1); while(1); }
It seems that my prevous question was related to ticker problem issue because I have in my program one ticker and one more ticker was used by PinDetect. Is there a way to fix tickers code?
If I create tickers outside of main then it works fine and don't hang.
posted by Nikita Polotnyanko 30 Aug 2014Getting problems here also when I have more than 2 Tickers. See code below. Note: I am not using one of the published nRF51822 platforms at the moment. My board has no mbed interface. Programming is done through SWD. The board does have a lot of LEDs which have been tested and work fine.