View Single Post
  #7   Spotlight this post!  
Unread 29-01-2003, 18:38
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by mjt902
So what you are suggesting this guy do is not put SERIN in the mainloop??
That makes sense and clears me up on a few things. Thaks for the gentle and insightful correction.
NO!!!!! If you don't do a SERIN, delta_t will never get updated. Nor will any of your sensors, etc.

All I'm saying is that as long as you don't do a SERIN between the p1_y=150 and the SEROUT, p1_y can be used as a normal variable. For example:

DO
SERIN...

if rc_sw15 = 1 then p2_y=150
if rc_sw16 = 1 then p4_y=150

SEROUT...
LOOP

Until the code reaches the next SERIN, p2_y/p4_y will still have the values 150.


Back to the problem: my guess is that you have the incorrect sensor wire hooked up. You can use either, but your code needs to match. To see if this is the problem, try doing a debug? rc_sw15 right after the SERIN and see if it changes.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php