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.

config.h 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * config.h
  3. *
  4. * OpenChrono BB speed measurement device.
  5. *
  6. * Copyright (c) 2022 Thomas Buck <thomas@xythobuz.de>
  7. */
  8. #ifndef __CONFIG_H__
  9. #define __CONFIG_H__
  10. // --------------------------------------
  11. #define VERSION "0.0.1"
  12. // --------------------------------------
  13. #define SENSOR_DISTANCE 70.0 /* in mm */
  14. #define BB_WEIGHT 0.25 /* in g */
  15. #define BB_WEIGHTS { 0.20, 0.23, 0.25, 0.28, 0.475 } /* in g */
  16. // --------------------------------------
  17. // which unit to show on history screen
  18. #define METRIC 0
  19. #define IMPERIAL 1
  20. #define JOULES 2
  21. #define PREFERRED_UNITS METRIC
  22. // --------------------------------------
  23. // order and duration of screens
  24. #define SCREEN_CURRENT 0
  25. #define SCREEN_MIN 1
  26. #define SCREEN_AVERAGE 2
  27. #define SCREEN_MAX 3
  28. #define SCREEN_HISTORY 4
  29. #define SCREEN_ROTATION { \
  30. SCREEN_CURRENT, \
  31. SCREEN_CURRENT, \
  32. SCREEN_MIN, \
  33. SCREEN_AVERAGE, \
  34. SCREEN_MAX, \
  35. SCREEN_HISTORY, \
  36. SCREEN_HISTORY \
  37. }
  38. #define SCREEN_TIMEOUT 2500 /* in ms */
  39. #define FLIP_SCREEN 0
  40. // --------------------------------------
  41. // lcd config
  42. #define LCD_TYPE U8G2_SSD1306_128X64_NONAME_F_HW_I2C
  43. #define HEADING_FONT u8g2_font_VCR_OSD_tr
  44. #define TEXT_FONT u8g2_font_NokiaLargeBold_tr
  45. #define SMALL_FONT u8g2_font_helvB08_tr
  46. // --------------------------------------
  47. // history for graph of speeds.
  48. // should not be too big!
  49. #define HISTORY_BUFFER 50
  50. // --------------------------------------
  51. #define IR_LED_PIN 4
  52. #define UV_LED_PIN 5
  53. // --------------------------------------
  54. // with a prescaler of 1, we can measure from 17m/s to 1120000m/s
  55. // with a prescaler of 8, we can measure from 2.14m/s to 140000m/s
  56. // with a prescaler of 64, we can measure from 0.27m/s to 17500m/s
  57. // see comment in ticks.cpp
  58. // allowed values: 1, 8, 64, 256, 1024
  59. #define TIMER_PRESCALER 64
  60. // values outside this range will be ignored
  61. #define MIN_SPEED 0.3 /* in m/s */
  62. #define MAX_SPEED 2000.0 /* in m/s */
  63. // --------------------------------------
  64. // placeholder data for debugging purposes
  65. #define DEBUG_TICK_COUNT 0
  66. #define DEBUG_TICK_DATA {}
  67. //#define DEBUG_TICK_COUNT 8
  68. //#define DEBUG_TICK_DATA { 8000, 10000, 9000, 11000, 8500, 9500, 10000, 7000 }
  69. // --------------------------------------
  70. #endif // __CONFIG_H__