Good day all. I would like to know when checking for a remainder using modulus is this correct: -
"var MOD 2 =0"? This would check for even numbers. If this is not right could someone give an example.
Thanks in advance
Ondra
Using modulus
Re: Using modulus
Hi ondra, i used it in my servo program , this is what i used :
servo_val = ( servo_pos[port_counter] )
servo_l = ( servo_val MOD 3 ) * 85
servo_h = 31 + ( servo_val / 3 )
servo_val = ( servo_pos[port_counter] )
servo_l = ( servo_val MOD 3 ) * 85
servo_h = 31 + ( servo_val / 3 )
Re: Using modulus
Hi ondra, i thought i would go one better than my last post. i have put a demo simple maths routine together, dowload the program `mod` and just run it so that you can see flowcode variables.
- Attachments
-
- mod.fcf
- (3.5 KiB) Downloaded 327 times