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 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * config.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 __CONFIG_H__
  22. #define __CONFIG_H__
  23. // --------------------------------------
  24. #define VERSION "0.0.1"
  25. // --------------------------------------
  26. #define SENSOR_DISTANCE 70.0 /* in mm */
  27. #define BB_WEIGHT 0.25 /* in g */
  28. #define BB_WEIGHTS { 0.20, 0.23, 0.25, 0.28, 0.475 } /* in g */
  29. // --------------------------------------
  30. // which unit to show on history screen
  31. #define METRIC 0
  32. #define IMPERIAL 1
  33. #define JOULES 2
  34. #define PREFERRED_UNITS METRIC
  35. // --------------------------------------
  36. // order and duration of screens
  37. #define SCREEN_CURRENT 0
  38. #define SCREEN_MIN 1
  39. #define SCREEN_AVERAGE 2
  40. #define SCREEN_MAX 3
  41. #define SCREEN_HISTORY 4
  42. #define SCREEN_ROTATION { \
  43. SCREEN_CURRENT, \
  44. SCREEN_CURRENT, \
  45. SCREEN_MIN, \
  46. SCREEN_AVERAGE, \
  47. SCREEN_MAX, \
  48. SCREEN_HISTORY, \
  49. SCREEN_HISTORY \
  50. }
  51. #define SCREEN_TIMEOUT 2500 /* in ms */
  52. #define FLIP_SCREEN 0
  53. // --------------------------------------
  54. // lcd config
  55. #define LCD_TYPE U8G2_SSD1306_128X64_NONAME_F_HW_I2C
  56. #define HEADING_FONT u8g2_font_VCR_OSD_tr
  57. #define TEXT_FONT u8g2_font_NokiaLargeBold_tr
  58. #define SMALL_FONT u8g2_font_helvB08_tr
  59. // --------------------------------------
  60. // history for graph of speeds.
  61. // should not be too big!
  62. #define HISTORY_BUFFER 50
  63. // --------------------------------------
  64. #define IR_LED_PIN 4
  65. #define UV_LED_PIN 5
  66. // --------------------------------------
  67. // with a prescaler of 1, we can measure from 17m/s to 1120000m/s
  68. // with a prescaler of 8, we can measure from 2.14m/s to 140000m/s
  69. // with a prescaler of 64, we can measure from 0.27m/s to 17500m/s
  70. // see comment in ticks.cpp
  71. // allowed values: 1, 8, 64, 256, 1024
  72. #define TIMER_PRESCALER 64
  73. // values outside this range will be ignored
  74. #define MIN_SPEED 0.3 /* in m/s */
  75. #define MAX_SPEED 2000.0 /* in m/s */
  76. // enable to keep UV LED on 100x as long
  77. //#define DEBUG_LONG_UV_TIME
  78. // --------------------------------------
  79. // placeholder data for debugging purposes
  80. #define DEBUG_TICK_COUNT 0
  81. #define DEBUG_TICK_DATA {}
  82. //#define DEBUG_TICK_COUNT 8
  83. //#define DEBUG_TICK_DATA { 8000, 10000, 9000, 11000, 8500, 9500, 10000, 7000 }
  84. // --------------------------------------
  85. #endif // __CONFIG_H__