Go to Post make sure to make it look really cool, it makes it easier for teams to remember you, which comes in handy for alliance selections ;) - Holtzman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 14-01-2003, 08:01
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
The RC program must loop through the "Do ... Loop" about once every 40 ms. It may be looosing sync with the OI with the time you are wasting, because, for each packet-loop, you're counting to 150, and for each count value you're sending a debug message and re-setting p1_y to a value without leaving your "count-loop". For each packet-loop. you're also doing the processing of the "Do ... Loop".

Now, the OI sends a new buch of values to the Serin line every few ms. each with a (no pun inteded) serial number, called a packet number which the default program ignores.

If you allow the RC to read packet_num (uncomment the declaration of packet_num near the end of declarations, near the start of the program, set c_packet_num CON 1 (changed from 0), and put packet_num in the correct place in the serin line) then you can store the packet number in a variable like "start_packet_num", and set p1_y to your value until you have gone 150 loops.

if auton_mode = 0 then fugeddabahtit

if packet_num = 0 then pack_count_zero = pack_count_zero + 1
'you have to declare the variables like pack_count_zero and temp (seen below)

if packet_num < start_packet_no then it_overflowed
temp = packet_num - start_packet_num
goto to checked_p_num

it_overflowed:
temp = (((2000 + packet_num + 256) - start_packet_num) - 2000)
'if the start_packet_num is more than 105, then in 150 loops it will roll over to a numer smaller than that. this cures the problem for loop counts of less than 256

checked_p_num:
if temp < 151 then p1_y = (your value)

fugeddabahtit:

BTW, 150 counts is only a few seconds in the above. I'm sure someone will call me a doddering old fool or worse for not remembering whether you get an update 25 or 40 times per second. A quick perusal of the 2003 OI manual yields no info.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Code From Experience EbonySeraphim Programming 7 14-03-2003 21:56
Autonomous code tutorial miketwalker Programming 2 23-02-2003 12:28
Overcomplicated Autonomous Code EbonySeraphim Programming 33 20-02-2003 21:53
Autonomous Code Adrian Wong Robotics Education and Curriculum 1 18-11-2002 22:34


All times are GMT -5. The time now is 00:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi