Go to Post This is the first (and, if this stuff keeps up, last) time FIRST has allowed high-speed projectiles in years. Please use some common sense, people. - Madison [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 29-11-2002, 14:03
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
I'll se what I can do:

1) Two's complement: Two's complement is a way of representing negative numbers in binary. It comes from the way processors work and generally makes life very easy as it allows you to just add two numbers and ignore their signs. For example:
The two's complement of -1 (in eight bits) is: 11111111. Adding 1 yields 100000000. However, because we are only dealing with eight-bit numbers, that leading 1 is chopped off and you get 0, as it should be. Likewise, adding -1 and -1 gives 111111110. Drop the leading one and you get 11111110, which is -2. To convert a positive number to its negative, invert all the bits and add 1. The only thing you really need this for is to realize that the Stamp processors will interpret -1 as 65000 something.

2) Short answer: no, the processor only has 26 bytes worth of registers. Long answer: see answer to question 3.

3) Put will place a value in scratchpad. The scratchpad is basically a 64-byte block of memory where you can store stuff you aren't using at that particular moment. For example, if you want to store two bytes of data between loops, but you only have enough space for one variable, you could "put" these two values on scratchpad and retrieve them when you need them, one at a time. Note that you must do a "get" to fetch the value you put on scratchpad into a variable so you can use it in calculations.

4)EEPROM is where your program is stored, but you can also put data there. However, it is very slow to Read/write (the eeeprom equivalents of get/put) and writing to an individual location more than 1000000 times could cause that location to go bad. A lot of people use eeprom to store large tables of data as it is 2048 bytes. Also take a look at the "data" command if you are interested in doing this and the normal lookup/lookdown doesn't meet your needs.

5) ~ will compute the bitwise-not of a number, meaning each individual bit will be inverted. You shouldn't use it unless this is what you want. Instead, do something like: "if not (p1_x = 127)..." ALWAYS use parenthesis with "not" as you could get some very unexpected results otherwise.

<shameless plug>
If you haven't already, try download RoboEmu, either for Windows or Linux. It supports everything mentioned above and will let you play with all these commands without the need for an actual RC/OI at your house.
</shameless plug>
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
 


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
I'll delete this in a couple of hours. hixofthehood Chit-Chat 9 04-02-2003 23:26
couple of questions... archiver 2001 5 23-06-2002 22:48
A couple of problems I observed at the MAR archiver 2000 3 23-06-2002 22:27
Couple other thank yous Jason Haaga Thanks and/or Congrats 0 29-04-2002 03:29
A Couple Questions about Chairman's Award ben_whly Chairman's Award 4 26-01-2002 18:24


All times are GMT -5. The time now is 04:25.

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