loading
 
vbsript setprecision
Sam from United States  [4 posts]
15 year
I'm trying to use my arduino board in addition to some servos I have hooked up to it while running roborealm.  I'm using the serial module to deliver the stream to the arduino board.  My problem is that the data spit out by the serial module are longs not ints and the arduino board is flips out if it gets something other than a whole number.  Can I use setprecision somehow within the vbscript to drop the decimals? I'm using the .robo file from the object tracking tutorial.
Anonymous 15 year
Take a look at CInt or CLng in vbscript that shoud drop the decimals

Dim MyDouble, MyInt
MyDouble = 2345.5678     ' MyDouble is a Double.
MyInt = CInt(MyDouble)   ' MyInt contains 2346.
Sam from United States  [4 posts] 15 year
That fixed it thanks!

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index