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

Setup timer on ARDUINO NANO 33 BLE nRF 52840.

Hi I am having trouble setting up a timer and interrupt on the Arduino side & was hoping some one might help

here is my code so far

Thanks so much 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// constants won't change. Used here to set a pin number:
const int ledPin = LED_BUILTIN;// the number of the LED pin
// Variables will change:
int ledState = LOW; // ledState used to set the LED
volatile int flag = 0;
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated
// constants won't change:
const long interval = 1000; // interval at which to blink (milliseconds)
void setup() {
setupSerial();
// set the digital pin as output:
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH );
start_timer();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX