Close

Use custom polledSerial serial port class rather than Arduino.Serial

A project log for Wind sensor using car reversing kit

A wind speed and direction sensor from an Ebay car reversing kit and an Arduino

kwikiuskwikius 10/08/2021 at 12:100 Comments

The windsensor project is very critical on interrupt timing  to capture the pulse length. Looking at the Arduino.Serial code, it does (of course) use interrupts and even disables the global interrupts during a write. In this application a simple polled serial port will do the job without globally disabling interrupts and without serial write interrupt getting in the way of the envelope detect or zero crossing interrupts, so the Arduino code was modified to use the custom polledSerial class.

https://github.com/kwikius/ultrasonic_wind_sensor/blob/master/libraries/polled_serial/polled_serial.cpp

Discussions