Thread: Current Sensor
View Single Post
  #5   Spotlight this post!  
Unread 11-02-2004, 20:37
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
Re: Current Sensor

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);
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed