Let's Make Robots!

No Decimals

So I'm testing my ultrasonic sensor for mmy turret and I have run across a problem. This is that there are only 27 word (w0,w1,w2) varriables. So I have to use byte variables (b0,b1,b2). The ultrasonic read the range into a word variable, so then I have to convert this big number down to the size that can fit into a byte. So I used division. b0 = w0 / 100. Then I ran into another problem. The Picaxe takes the next varriable b1 to fill it up with the deciaml place. So 19.24 would be b0=19 and b1 = 2. Now I don't want this because I need to use b2 and I need all those 50 varriables. Is there a way to get rid of the deciaml places.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

b0=w0/100 --No go

W0 is made up of b0 and b1. If you are using w0 as a variable, you can't also use b0 or b1. Manual 1, page 10.

And the fact that picaxes don't do floating point... Manual 1, page 20.