View unanswered posts | View active topics It is currently Tue Oct 21, 2014 4:17 pm






Reply to topic  [ 3 posts ] 
HT Sensor MUX powered up or not? 
Author Message
Rookie

Joined: Wed Jul 21, 2010 11:23 pm
Posts: 39
Post HT Sensor MUX powered up or not?
Is there a way to programmatically confirm that the HT sensor mux is responding to interrogations? More specifically, can the program tell whether the SMUX has been correctly powered up by the drive team?

My tests with an SMUX and HTGYRO combination appears to give large negative numbers (-621) when the SMUX is powered off or disconnected, versus more normal gyro values of -15 to -22 when it is functional, so I'm hoping it would be safe to assume that if the first read of the gyro at power up but before calibration returns more than 50 (either + or -) then it is probably not a good value and the autonomous program can sound an alarm for them.

On a related question, is there a way to interrogate the voltage of the SMUX 9VDC battery?


Thu Jan 26, 2012 11:16 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3225
Location: Rotterdam, The Netherlands
Post Re: HT Sensor MUX powered up or not?
Hiya Ron,

In HTSMUX-driver.h there is a function called HTSMUXreadPowerStatus(). It can only tell you if the battery is still OK, not what level it is at. I have some pretty detailed documentation about the SMUX's functionality and I can assure you that there is no mention of retrieving the actual power level.

Code:
/**
 * Check if the battery is low
 *
 * @param link the SMUX port number
 * @return true if there is a power source problem
 */
bool HTSMUXreadPowerStatus(tSensors link) {
  if ((HTSMUXreadStatus(link) & HTSMUX_STAT_BATT) == HTSMUX_STAT_BATT)
    return true;
  else
    return false;
}


- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 27, 2012 2:41 am
Profile WWW
Rookie

Joined: Wed Jul 21, 2010 11:23 pm
Posts: 39
Post Re: HT Sensor MUX powered up or not?
Nice. Thanks Xander.


Fri Jan 27, 2012 3:04 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.