zotbins/ZotbinsCore

Create interface for distance sensor

Closed this issue · 0 comments

Description

Create an interface class for the distance sensor called IDistance. We are creating an interface, so we can create two classes for our mock distance sensor MockDistance class, and our real hardware ultrasonic sensor UltrasonicDistance class. We are having the mock distance sensor so we can easily create unit tests without relying on real hardware.

Even though we use the ultrasonic sensor, it's called Distance in the off-chance we change sensors to something that does not use ultrasonic like LIDAR or LED, etc.

Requirements

  • Create a folder inside lib called Fullness(All of the fullness related classes will go here) with the file IDistance.hpp
  • Create a class called IDistance
  • The class should have a pure virtual function called getDistance() that returns a int32_t (you might need to #include <cstdint>)