Skip to content

Commit 98b7e9f

Browse files
committed
empty voltage sensing function
1 parent 2699140 commit 98b7e9f

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Power Board/thrusters.ino

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ Servo thrusters[8];
5151
uint16_t microseconds[] = {1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500};
5252
const uint16_t offCommand[] = {1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500};
5353

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];
5659

5760
// updates thrusters' pwm signals from array
5861
void updateThrusters(const uint16_t microseconds[8]) {
@@ -98,15 +101,19 @@ void waterInterrupt() {
98101
while (true) {}
99102
}
100103

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+
110117
}
111118

112119
void setup() {

0 commit comments

Comments
 (0)