I didn't know whether to put this in absolute beginners or here..
anyways, what i'm trying to do is use my ADC port to get some values from one of my sensors and once i've done this i want this value to be displayed on a three digit seven segment display. I know how to right single numbers on the 7-segment display, but i wouldn't know how to deal with, say, a three digit number.
So i thought it might come in very handy to separate the ADC value in three parts. Example: say readadc gives 234, i want to have 3 variables which are equal to 2, 3 and 4. I know how to do it with other languages but not with basic. Not only though. I also wanted to ask you if any command you actually use with BASIC can also be used by the BASIC offered by the picaxe. (or can i only use the commands listed on the manual?)
You can just write yourself out of it, knowing all non-integers are lost.
I would have to think about it but to give you a clue;
X = your number (234)
Y = x / 10 (y=23)
Y = Y * 10 (Y=230)
Z = x - Y (Z = 4, so Z = the rightmost number)
You may have to enter some if > 5 etc to make it all work But there may very well be a very simple form waiting for you once you get started to look for it
To answer your second question, you can only use BASIC commands that PicAxe understands.
But, you are in luck. The PicAxe has a modulus operator. The ‘%’ symbol is used to return the remainder of an integer division. So in your example above …
X = 234
C = X % 10 ’ 234 / 10 = 23 with remainder 4, so C = 4