ROBOTC.net forums
http://www.robotc.net/forums/

Way to Tell if SMUX is Not Responding? Battery Level?
http://www.robotc.net/forums/viewtopic.php?f=52&t=10232
Page 2 of 2

Author:  Synergists [ Sat Jan 17, 2015 12:33 pm ]
Post subject:  Re: Way to Tell if SMUX is Not Responding? Battery Level?

Also, here is another scrapped down version taking the battery bool. It works without the sensor MUX, I have yet to test it today to confirm it can 'see' the sensor MUX.
Code:
      if(HTSMUXreadPowerStatus(S2) == true) //Checking Battery in Sensor Port...Returning True means problem w/Battery
      {//Print SMUX: OFF
         sprintf(sSMUXStat,sSMUXOFF);      
      }
      else
      {//Print SMUX: ON
         sprintf(sSMUXStat,sSMUXConnected);
      }
         nxtDisplayString(5, "SMUX: %s", sSMUXStat);


Author:  mightor [ Sat Jan 17, 2015 1:18 pm ]
Post subject:  Re: Way to Tell if SMUX is Not Responding? Battery Level?

You could probably shorten that to something like:
Code:
displayString(5, "SMUX: %s", HTSMUXreadPowerStatus(S2) ? "OFF" : "ON");

= Xander

Page 2 of 2 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/