RSS
Sort by » date activity comments

3 blog posts tagged with arduino

10
comments
by schef

Using millis() like in Arduino.

Here are two simple functions to use when you want to use timestamps for time measurement.

uint32_t millis(void)
{
  return(app_timer_cnt_get() / 32.768);
}

and for comperison of current with given timestamp with rollover correction (thanks to Nicolas Brunner for the correction):

#define OVERFLOW ((uint32_t)(0xFFFFFFFF/32.768))

uint32_t compareMillis(uint32_t previousMillis, uint32_t currentMillis)
{
  if(currentMillis < previousMillis) return(currentMillis + OVERFLOW + 1 - previousMillis);
  return(currentMillis - previousMillis);
}

You can use it like:

uint32_t myTimeStamp = millis();
//... some code here
if(compareMillis(myTimeStamp, millis()) > 2000)
{
  printf("2 seconds have passed\n");
}

Here are unit tests https://github.com/schef/nrf_millis

1
comment
by Wayne

Toys 2.0: Smart Toy Robots use the nRF51 based Cannybot Brain

The Cannybot Brain is a robotics controller board that uses the Nordic Semiconductor nRF51822 at its core. The board has been developed by Cannybots Limited in Cambridge, UK.

One of Cannybots core values is connecting kids to the modern technology they find around them in their daily life. We believe that basing the Brain on the kind of technology that they would also find at the heart of a smartphone or tablet is an important connection we want to make to help demystify modern technology.

The Cannybot Brain has been developed as the controller board for the Cannybots Robot Building...

1
comment
by Stefan Birnir Sverrisson

Debugging Arduino project with Atmel Studio

When using nRF8001 with an Arduino board, Atmel Studio is a good free tool to use for development of your firmware. The following video shows a procedure in Atmel Studio in order to enable debugging of Arduino code. It was created with Atmel Studio 6.1 and Visual Micro (Arduino plugin for Atmel Studio)

image description

image description

image description

1

Tags