File tree 1 file changed +0
-13
lines changed
examples/RoboHeartBLECarControl 1 file changed +0
-13
lines changed Original file line number Diff line number Diff line change @@ -100,17 +100,6 @@ void bleConnected() {
100
100
heart.motorC .sleep (false );
101
101
}
102
102
103
- int battery_percent (){
104
- float raw_value = analogRead (BATTERY_PIN);
105
- float voltage_level = ((raw_value * 3.3 )/ MAX_ANALOG_VAL )* 2 ; // multiply the analogRead value by 2x to get the true battery
106
- // Serial.println(voltage_level);
107
- float battery_fraction = voltage_level / MAX_BATTERY_VOLTAGE;
108
- float voltage_range = voltage_level - MIN_BATTERY_VOLTAGE;
109
- int percent = (voltage_range / BATTERY_RANGE) * 100 ;
110
- return percent;
111
- }
112
-
113
-
114
103
void setup () {
115
104
Serial.begin (115200 );
116
105
@@ -136,12 +125,10 @@ void setup() {
136
125
137
126
void loop () {
138
127
139
- int percent = battery_percent ();
140
128
// Send some information to the ble
141
129
if (bleDeviceConnected) {
142
130
blePackage[0 ]++;
143
131
ble.sendNotifyChar2 (blePackage);
144
- ble.sendNotifyChar3 ((uint8_t *)(&percent));
145
132
delay (3 ); // bluetooth stack will go into congestion, if too many packets
146
133
// are sent, in 6 hours test we were able to go as low as 3ms
147
134
}
You can’t perform that action at this time.
0 commit comments