3D printed Arduino Airsoft Chronograph
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.

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * ticks.h
  3. *
  4. * OpenChrono BB speed measurement device.
  5. *
  6. * Copyright (c) 2022 Thomas Buck <thomas@xythobuz.de>
  7. *
  8. * OpenChrono is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * OpenChrono is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with OpenChrono. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __TICKS_H__
  22. #define __TICKS_H__
  23. extern uint16_t tick_history[];
  24. extern uint8_t tick_count;
  25. void tick_new_value(uint16_t ticks);
  26. uint16_t tick_average();
  27. uint16_t tick_max();
  28. uint16_t tick_min();
  29. double tick_to_metric(uint16_t ticks);
  30. double metric_to_imperial(double speed);
  31. double metric_to_joules(double speed, double mass);
  32. #endif // __TICKS_H__