PBasic ?

What are these varibles use for?

c_delta_t CON 0
c_packet_num CON 0
c_res01 CON 0

If you set the constant to any of those variables to 1, it means that you want to read it. You must still add it to the appropriate place in the sering command. Not sure if that is what you want, or actually what those variables measure.

delta_t tells you how many radio packets the robot has missed since the last good packet. If your program is really complex, it may be possible to still be processing and miss a packet.

packet_num gives you the number of the current packet, which is a count since the controller was turned on.

I don’t know what res01 does.

*Originally posted by ttedrow *
**What are these varibles use for?

c_delta_t CON 0
c_packet_num CON 0
c_res01 CON 0 **

These c_“something” CONstants (not variables) apprear in a section which will tell the input micro which of up to 26 variables you choose to read in, from a list of 32. Looking further down, TempA,B,C, and D are made up of these constants, and on powerup, these 4 bytes are sent to the input micro.

c_delta_t CON 0 disallows, and 1 allows delta_t in via the serin statement in the Mainloop. It has to go to some appropriate sized variable, so you have to take the ’ away from the variable declaration (“uncomment it”).

Each set of data the OI sends has a serial number, just an up-counter that rolls over to 0, at 255. This is the packet_num. Delta_t is the difference between the current packet_num and what it was on the last successfully received packet.

Haven’t used res01, so have no info on it.