1 millisecond Timer

1 millisecond Timer is similiar to GPT but ticks only every 1 millisecond. It does not have any restriction or conflicts with PWM pins. It allows to measure relatively big delays to control time critical processes as well as contolling servo motors. To set up a user handler function use ZUNO_SETUP_ISR_1MSTIMER macro to as describted here.
ZUNO_SETUP_ISR_1MSTIMER(m1ms_handler);

unsigned long count_1ms = 0;

void m1ms_handler() {
    count_1ms++;
}

void setup() {
    Serial.begin(115200);
}

void loop() {
    Serial.println(count_1ms);
    delay(1000);
}


Reference Home

Corrections and documentation improvements are accepted via fork & pull-request on GitHub. Suggestions and feature requests are welcome to the Forum.

The text of the Z-Uno reference is based on Arduino Reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

×

Uploading the sketch to your Z-Uno:

Use this QR-code to include your device using Z-Wave Smart Start or triple click BTN button