Report Bugs Here

Moderator: Mmiscool

User avatar
By Mmiscool
#34376 All numbers in the basic interpreter are floating point.

Don't have a quick fix for that.

The first iteration of the loop the value for x is simply set to what ever number or variable is supplied. It dose no conversion of the data. Just shoves it in to the variable.

if you did
for x = 1.00 to 5 it would work as expected.
User avatar
By forlotto
#34388 No I would like to see a good example of a for loop in basic preferably one that reads the status of all pins I am with you have spent about an hour one day and could not get it right lol anyhow a for loop I guess of any kind would help really...

But preferably I would like to see it doing something beyond just spitting out numbers or something simplistic.
User avatar
By Mmiscool
#34389 Its not really possible to loop threw querying each in as there is a gap in the range of pins that can be use.

Would be better just to use a bunch of pi commands and grab the data you want.
User avatar
By forlotto
#34461 Oh so you can't do like an array of different things to check for .

Put 1 2 4 6 7 9 11 12 13 into an array somehow and cycle through these values performing the routine hrmmm interesting I suppose that is one slight disadvantage of basic.

Do you have an example of one using a performing an action in a function other than say like simple math or lets just have a hypothetical here lets just say for the kicks of it you could read all the pins in order...

Lets say the pins were 0-16 what would an example of the code look like?

Again not real hypothetical.

I would think you could check the value of x and then skip the read using an if statement for instance and just skip the pins you can't read it would likely still result in a lot tighter cleaner code if this is possible errr I'm not a GURU of code but just thinking out loud here. Keeping things tight there is always some interesting method to shave lines of code or save on resources it seems.