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.

27 lines
537B

  1. #pragma once
  2. #include <stdint.h>
  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. private:
  16. float threshold;
  17. bool triggered;
  18. bool lastTriggered;
  19. float lastValue;
  20. uint32_t triggerIntervalCount;
  21. uint32_t lastTriggerInterval;
  22. uint32_t triggerCount;
  23. };
  24. }