Skip to content

Commit 3ff4f57

Browse files
committed
dumbburn
1 parent 2e4f276 commit 3ff4f57

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

src/flight-software/repl.py

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from lib.adafruit_mcp230xx.mcp23017 import (
2121
MCP23017, # This is Hacky V5a Devel Stuff###
2222
)
23-
from lib.adafruit_mcp9808 import MCP9808 # This is Hacky V5a Devel Stuff###
2423
from lib.adafruit_tca9548a import TCA9548A # This is Hacky V5a Devel Stuff###
2524

2625
# from lib.pysquared.Big_Data import AllFaces ### This is Hacky V5a Devel Stuff###
@@ -37,6 +36,7 @@
3736
from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager
3837
from lib.pysquared.hardware.radio.manager.sx1280 import SX1280Manager
3938
from lib.pysquared.hardware.radio.packetizer.packet_manager import PacketManager
39+
from lib.pysquared.hardware.temperature_sensor.manager.mcp9808 import MCP9808Manager
4040
from lib.pysquared.logger import Logger
4141
from lib.pysquared.nvm.counter import Counter
4242
from lib.pysquared.protos.power_monitor import PowerMonitorProto
@@ -99,6 +99,13 @@
9999
100000,
100100
)
101101

102+
i2c0 = initialize_i2c_bus(
103+
logger,
104+
board.SCL0,
105+
board.SDA0,
106+
100000,
107+
)
108+
102109
sleep_helper = SleepHelper(logger, config, watchdog)
103110

104111
uhf_radio = RFM9xManager(
@@ -135,15 +142,6 @@
135142
)
136143

137144

138-
## Initializing the Burn Wire ##
139-
ENABLE_BURN_A = initialize_pin(
140-
logger, board.FIRE_DEPLOY1_A, digitalio.Direction.OUTPUT, True
141-
)
142-
ENABLE_BURN_B = initialize_pin(
143-
logger, board.FIRE_DEPLOY1_B, digitalio.Direction.OUTPUT, True
144-
)
145-
146-
147145
def dumb_burn(duration=5) -> None:
148146
"""
149147
This function is used to test the burn wire.
@@ -154,13 +152,13 @@ def dumb_burn(duration=5) -> None:
154152
Returns:
155153
None
156154
"""
157-
ENABLE_BURN_A.value = False
158-
ENABLE_BURN_B.value = False
155+
burnwire_heater_enable.value = False
156+
burnwire1_fire.value = False
159157
logger.info("Burn Wire Enabled")
160158
time.sleep(duration)
161159
logger.info("Burn Wire Disabled")
162-
ENABLE_BURN_A.value = True
163-
ENABLE_BURN_B.value = True
160+
burnwire_heater_enable.value = True
161+
burnwire1_fire.value = True
164162

165163

166164
## Initializing the Heater ##
@@ -220,11 +218,11 @@ def all_faces_off():
220218
"""
221219
This function turns off all of the faces. Note the load switches are disabled low.
222220
"""
223-
FACE0_ENABLE.value = True
224-
FACE1_ENABLE.value = True
225-
FACE2_ENABLE.value = True
226-
FACE3_ENABLE.value = True
227-
FACE4_ENABLE.value = True
221+
FACE0_ENABLE.value = False
222+
FACE1_ENABLE.value = False
223+
FACE2_ENABLE.value = False
224+
FACE3_ENABLE.value = False
225+
FACE4_ENABLE.value = False
228226

229227

230228
def all_faces_on():
@@ -253,7 +251,12 @@ def all_faces_on():
253251
light_sensor4 = VEML7700Manager(logger, tca[4])
254252

255253
## Onboard Temp Sensor ##
256-
mcp1 = MCP9808(i2c1, address=30) # Not working for some reason
254+
temp_sensor0 = MCP9808Manager(logger, tca[0], addr=27)
255+
temp_sensor1 = MCP9808Manager(logger, tca[1], addr=27)
256+
temp_sensor2 = MCP9808Manager(logger, tca[2], addr=27)
257+
temp_sensor3 = MCP9808Manager(logger, tca[3], addr=27)
258+
temp_sensor4 = MCP9808Manager(logger, tca[4], addr=27)
259+
257260

258261
try:
259262
battery_power_monitor: PowerMonitorProto = INA219Manager(logger, i2c1, 0x40)
@@ -273,10 +276,3 @@ def all_faces_on():
273276
antenna_deployment = BurnwireManager(
274277
logger, burnwire_heater_enable, burnwire1_fire, enable_logic=True
275278
)
276-
277-
278-
## Initialize the MCP23017 GPIO Expander and its pins ##
279-
GPIO_RESET = initialize_pin(
280-
logger, board.GPIO_EXPANDER_RESET, digitalio.Direction.OUTPUT, True
281-
)
282-
mcp2 = MCP23017(i2c1)

0 commit comments

Comments
 (0)