summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJoshua Drake <Joshua.Ellis.Drake@gmail.com>2024-06-14 02:19:51 -0500
committerJoshua Drake <Joshua.Ellis.Drake@gmail.com>2024-06-14 02:19:51 -0500
commit00f8c8b96c4a73fdac7b2ebe31408ee502a315cd (patch)
tree58b62cb19c5067f9ac2b35949d22658779c2e739 /main.c
parented2644ef4e934f2f7cf93890760737790925a1c8 (diff)
Added ability to control power as a percentage and added controller feedback.HEADmaster
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index ca5aa4b..8f9700c 100644
--- a/main.c
+++ b/main.c
@@ -58,6 +58,7 @@ int main(void)
if (relay_delay)
{
active(activeResistors);
+ setI2CArray(2,activeResistors[0] | (activeResistors[0]<<4));
if (*timeoutcounter < 2)
{
_LATB8 = 1;
@@ -79,7 +80,8 @@ int main(void)
}
else //Open contactors if I2C communication is broken.
{
- if (relay_delay) Message_OUT(activeResistors[0] - 1, activeResistors[1] - 1, 0);
+ if ((activeResistors[0] > 0) || (activeResistors[1] > 0)) Message_OUT(activeResistors[0] - 1, activeResistors[1] - 1, 0);
+ else Message_OUT(0, 0, 0);
_LATB7 = 1; //Make sure activity light is off
_LATB8 = 0;
//Message_HWCROCL();