Quote:
|
Originally Posted by UCMHSrobotics
I checked the programming guide, and I couldn't find anything on the current sensor. It would be great if someone could explain the programming to me or just give me some code for the current sensors. Thanks!
|
I have written some code for the current sensor, but it doesn't do anything but display the sensor's data. You can put this in the final lines of user_routines_fast.c where your own code for every loop can be placed:
Code:
/* The formula comes from the equation of the line from the data by Willy C */
/* For this to work, the current sensors must be connected to Analog Inputs 1 and 2 */
#define Amps1 (rc_ana_in01 * 30) - 75
#define Amps2 (rc_ana_in02 * 30) - 75
printf("1st Sensor: %d\n", Amps1);
printf("2nd Sensor: %d\n", Amps2);
__________________
2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed