You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
551B

  1. #pragma once
  2. #include <cstdint>
  3. namespace SynthDevKit {
  4. class CV {
  5. public:
  6. CV (float);
  7. bool newTrigger( );
  8. void update (float);
  9. void reset ( );
  10. float currentValue ( );
  11. uint32_t triggerInterval ( );
  12. uint32_t triggerTotal ( );
  13. bool isHigh ( );
  14. bool isLow ( );
  15. protected:
  16. bool triggered;
  17. bool lastTriggered;
  18. uint32_t triggerCount;
  19. private:
  20. float threshold;
  21. float lastValue;
  22. uint32_t triggerIntervalCount;
  23. uint32_t lastTriggerInterval;
  24. };
  25. }