@@ -51,8 +51,11 @@ Servo thrusters[8];
51
51
uint16_t microseconds[] = {1500 , 1500 , 1500 , 1500 , 1500 , 1500 , 1500 , 1500 };
52
52
const uint16_t offCommand[] = {1500 , 1500 , 1500 , 1500 , 1500 , 1500 , 1500 , 1500 };
53
53
54
- // creates array for 8 thruster currents
55
- float currents[8 ];
54
+ // creates array for 8 thruster current sensing
55
+ float Tcurrents[8 ];
56
+
57
+ // creates array for 2 battery voltage sensing
58
+ float Bvoltages[2 ];
56
59
57
60
// updates thrusters' pwm signals from array
58
61
void updateThrusters (const uint16_t microseconds[8 ]) {
@@ -98,15 +101,19 @@ void waterInterrupt() {
98
101
while (true ) {}
99
102
}
100
103
101
- void senseCurrent (float currents[]) {
102
- currents[0 ] = ((analogRead (TC_1) * 3.3 ) / 1023 ) / 0.005 ;
103
- currents[1 ] = ((analogRead (TC_2) * 3.3 ) / 1023 ) / 0.005 ;
104
- currents[2 ] = ((analogRead (TC_3) * 3.3 ) / 1023 ) / 0.005 ;
105
- currents[3 ] = ((analogRead (TC_4) * 3.3 ) / 1023 ) / 0.005 ;
106
- currents[4 ] = ((analogRead (TC_5) * 3.3 ) / 1023 ) / 0.005 ;
107
- currents[5 ] = ((analogRead (TC_6) * 3.3 ) / 1023 ) / 0.005 ;
108
- currents[6 ] = ((analogRead (TC_7) * 3.3 ) / 1023 ) / 0.005 ;
109
- currents[7 ] = ((analogRead (TC_8) * 3.3 ) / 1023 ) / 0.005 ;
104
+ void senseCurrent (float Tcurrents[]) {
105
+ Tcurrents[0 ] = ((analogRead (TC_1) * 3.3 ) / 1023 ) / 0.005 ;
106
+ Tcurrents[1 ] = ((analogRead (TC_2) * 3.3 ) / 1023 ) / 0.005 ;
107
+ Tcurrents[2 ] = ((analogRead (TC_3) * 3.3 ) / 1023 ) / 0.005 ;
108
+ Tcurrents[3 ] = ((analogRead (TC_4) * 3.3 ) / 1023 ) / 0.005 ;
109
+ Tcurrents[4 ] = ((analogRead (TC_5) * 3.3 ) / 1023 ) / 0.005 ;
110
+ Tcurrents[5 ] = ((analogRead (TC_6) * 3.3 ) / 1023 ) / 0.005 ;
111
+ Tcurrents[6 ] = ((analogRead (TC_7) * 3.3 ) / 1023 ) / 0.005 ;
112
+ Tcurrents[7 ] = ((analogRead (TC_8) * 3.3 ) / 1023 ) / 0.005 ;
113
+ }
114
+
115
+ void senseVoltage (float voltages[]) {
116
+
110
117
}
111
118
112
119
void setup () {
0 commit comments