View Single Post
  #4   Spotlight this post!  
Unread 01-02-2008, 01:54
Mr. Freeman Mr. Freeman is offline
Put better title here.
AKA: Kellan
no team (CSM Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Colorado
Posts: 198
Mr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to beholdMr. Freeman is a splendid one to behold
Re: setting the team number for the OI

Quick explanation: Start from the left and work to the right, flipping a switch from 0 to 1 whenever that place value will divide into your number with or without a remainder.

Better explanation:Base ten works by setting each place value equal to 10^n, where n starts at 0 and increases sequentially from there.

Thus, you end up with the following place values in a base 10 number
1000 -- 100 -- 10 ---- 1
10^3 - 10^2 - 10^1 - 10^0

So, to set my team number, 1552, into base 10 let's work from the left to the right. (You should start at the right and work left, but it's easier to think of this way)

In the 1000s place we see that 1552 has 1. In the 100s place we see that 1552 has 5, in the 10s it has 5, and in the 1s it has 2. Simple enough.


In binary (base 2), it's the same thing except that you use 2^n instead of 10^n.

Thus:
1024-512-256-128-64-32-16-8-4-2-1
2^10 - 2^9 - 2^8 ... 2^0
Now, with base 10 you can set each place value to 0,1,2,3,4,5,6,7,8, or 9. With base 2, it can only be 0 or 1.

Thus, setting the dip switches on the OI indicates which place values (in binary) should be set to 0 and which should be set to 1.

To set team 1552, you would set the place values for 1024, 512, and 16 to 1. The number (in binary) for 1552 is: 11000010000
The OI converts this to decimal (base 10) when it displays it on that LED display.
__________________
"Time is an illusion, lunchtime doubly so."
-Douglas Adams
“Why is it that I can walk into Wal-Mart and buy boxes of bullets and black powder, but I can’t buy potassium perchlorate to do science because it can also be used to make explosives?”
-Theodore Gray