~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to RMM/dragon/tk-calibration.h

  • Committer: Selene Scriven
  • Date: 2018-07-05 10:22:48 UTC
  • mto: This revision was merged to the branch mainline in revision 209.
  • Revision ID: bzr@toykeeper.net-20180705102248-4157s7ly7ascx0w3
Forked Bistro as a base for Dragon.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 */
23
23
 
24
24
/********************** Voltage ADC calibration **************************/
25
 
// 5 values are form Dale's wight+1 driver measurements, commented out are values measured using RMM's FET+7135
 
25
// These values were measured using RMM's FET+7135.
26
26
// See battcheck/readings.txt for reference values.
27
27
// the ADC values we expect for specific voltages
28
 
 
29
 
#define ADC_44     205
30
 
#define ADC_43     201
31
 
#define ADC_42     196  //100%
32
 
#define ADC_41     191
33
 
#define ADC_40     187  // 75%
34
 
#define ADC_39     182
35
 
#define ADC_38     177   //50%
36
 
#define ADC_37     172
37
 
#define ADC_36     168
38
 
#define ADC_35     163   //25%
39
 
#define ADC_34     158
40
 
#define ADC_33     153
41
 
#define ADC_32     149
42
 
#define ADC_31     144
43
 
#define ADC_30     135 //   0%
44
 
#define ADC_29     132
45
 
#define ADC_28     130  //---
46
 
#define ADC_27     125  //---
47
 
#define ADC_26     120
48
 
#define ADC_25     116
49
 
#define ADC_24     111
50
 
#define ADC_23     106
51
 
#define ADC_22     101
52
 
#define ADC_21     97
53
 
#define ADC_20     92
54
 
 
55
 
#define ADC_100p   ADC_40  // the ADC value for 100% full (resting)
56
 
#define ADC_75p    ADC_39  // the ADC value for 75% full (resting)
57
 
#define ADC_50p    ADC_37  // the ADC value for 50% full (resting)
 
28
#define ADC_44     194
 
29
#define ADC_43     189
 
30
#define ADC_42     184
 
31
#define ADC_41     178
 
32
#define ADC_40     173
 
33
#define ADC_39     168
 
34
#define ADC_38     163
 
35
#define ADC_37     158
 
36
#define ADC_36     152
 
37
#define ADC_35     147
 
38
#define ADC_34     142
 
39
#define ADC_33     137
 
40
#define ADC_32     131
 
41
#define ADC_31     126
 
42
#define ADC_30     121
 
43
#define ADC_29     116
 
44
#define ADC_28     111
 
45
#define ADC_27     105
 
46
#define ADC_26     100
 
47
#define ADC_25     95
 
48
#define ADC_24     90
 
49
#define ADC_23     84
 
50
#define ADC_22     79
 
51
#define ADC_21     74
 
52
#define ADC_20     69
 
53
 
 
54
#define ADC_100p   ADC_42  // the ADC value for 100% full (resting)
 
55
#define ADC_75p    ADC_40  // the ADC value for 75% full (resting)
 
56
#define ADC_50p    ADC_38  // the ADC value for 50% full (resting)
58
57
#define ADC_25p    ADC_35  // the ADC value for 25% full (resting)
59
58
#define ADC_0p     ADC_30  // the ADC value for 0% full (resting)
60
59
#define ADC_LOW    ADC_30  // When do we start ramping down
71
70
#define CAP_SHORT           190
72
71
// The OTC value 1.5s after being disconnected from power
73
72
// Between CAP_MED and CAP_SHORT is a "medium press"
74
 
#define CAP_MED             93
 
73
#define CAP_MED             94
75
74
// Below CAP_MED is a long press
76
75
#else
77
76
// The OTC value 1.0s after being disconnected from power