If your platform does not have access to "atomic.h" (and so you get an error message), you can use the alternative version of the code that has been uploaded to the repository. It is labeled "_NoAtomic".
Learn how to control the speed of a DC motor with an encoder using a PID controller. In this video, I walk you through several important steps in this process: 0. Hardware 1. Velocity measurements 2. Measurement filtering 3. PI control 4. Variations
For more information about how an encoder works, see our video "How to control a DC motor with an encoder." https://youtu.be/dTGITLnYAY0
To learn about low-pass filtering, see our video "How to design and implement a digital low-pass filter on an Arduino." https://youtu.be/HJ-C4Incgpw
Parts used in this video: 1. DC Motor - 19:1 Metal Gearmotor 37Dx68L mm 12V with 64 CPR Encoder: https://www.pololu.com/product/4751 2. Motor Driver - VNH5019 Motor Driver Carrier: https://www.pololu.com/product/1451 3. Microcontroller - Arduino Uno: https://store.arduino.cc/usa/arduino-uno-rev3