View Single Post
  #6   Spotlight this post!  
Unread 08-11-2002, 15:18
Marc P. Marc P. is offline
I fix stuff.
AKA: βetamarc
no team
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Watertown, CT
Posts: 997
Marc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond repute
Send a message via AIM to Marc P.
I believe the output voltage from an analog sensor doesn't go anywhere in particular, it's just used in "if, then" logic sequences within the PBASIC processor, such that "If <condition exists> then <result>, much like the digital sensors, if sw_1 = on, then motor1= off, etc. but rather, if var=127 then pwm1=127, if var=254 then pwm1=254, etc. The changes in voltage are registered as variables in the programming, defined based on the SERIN command upon every program iteration/repetition (which is why it sits at the top of the main program loop). The serin captures whatever the voltage happens to be upon it's execution, whether a sensor (gyrochip) or a potentiometer, and saves it in the program as a variable, until the program loops and it is replaced by the same serin command. This loop cycles anywhere from 50-80 times per second, depending on the length and complexity of the program, resulting in what feels like a real time translation of analog data into action, when really it's cycle based.

Hope that helps.