Propeller newbie needs help with rr.random
blake_macho
Posts: 5
Hey guys,
I am playing with my first Propeller project and it's extremely fun. Only issue I've had so far (there will be many, many more I'm sure) is that I'm trying to get some random numbers going on, and failing.
I created this function (after some searching around here):
Any reason why this wouldn't work? Everything compiles fine, I just get the distinct impression I am not getting correct values back (since my servos are sittin' pretty). I'm passing in values like 130, 180. If this is the wrong implementation can you point me in the right direction? Thanks!
I am playing with my first Propeller project and it's extremely fun. Only issue I've had so far (there will be many, many more I'm sure) is that I'm trying to get some random numbers going on, and failing.
I created this function (after some searching around here):
PUB RandRange(Minimum, Maximum) result := (rr.random // (Maximum - Minimum)) + Minimum
Any reason why this wouldn't work? Everything compiles fine, I just get the distinct impression I am not getting correct values back (since my servos are sittin' pretty). I'm passing in values like 130, 180. If this is the wrong implementation can you point me in the right direction? Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod $50CAN has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module.