incrementing question..
Rontopia
Posts: 139
hi all its been a while.. Ive been super busy. I could explain but it would take longer then the question i have.. so.. I wont[noparse]:)[/noparse]
so I have this problem of not being able to find how to itterate a var. at least not in spin. Im use to something like
i = i ++
.. what im trying to do is find out how many pings I can do in 1 second using the ping.spin object. so im thinking something like
OBJ ''define the objects used.
rPing : "Ping"
Debug : "FullDuplexSerialPlus"
VAR
long i '' variable for incrementing
PUB Main ''define the repeat loop.
repeat until cnt := cnt + 12_000_000 ''using default clock speed
rPing.Ticks(16) '' using the ping object and passing pin 16 to it.
for i = i++ '' this is where I would increment i, but I dont know what operator to use..please advise
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
IC layout designer
Austin Texas
so I have this problem of not being able to find how to itterate a var. at least not in spin. Im use to something like
i = i ++
.. what im trying to do is find out how many pings I can do in 1 second using the ping.spin object. so im thinking something like
OBJ ''define the objects used.
rPing : "Ping"
Debug : "FullDuplexSerialPlus"
VAR
long i '' variable for incrementing
PUB Main ''define the repeat loop.
repeat until cnt := cnt + 12_000_000 ''using default clock speed
rPing.Ticks(16) '' using the ping object and passing pin 16 to it.
for i = i++ '' this is where I would increment i, but I dont know what operator to use..please advise
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
IC layout designer
Austin Texas
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
IC layout designer
Austin Texas
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
IC layout designer
Austin Texas
Which is the spin equivelent of the C/C++:
or the general
And to show the formatting - use the # on the toolbar of the reply/post form
Javalin
Edit - Ooops.· Was thinking in the wrong language..!
Post Edited (Javalin) : 1/8/2008 9:39:03 PM GMT
But it is i:= i + 1
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Javalin