I am wondering how i can program formulas in easy c so that the robot can automatically make the calculations and report the product back to the computer.
I want to make a speed sensor that has 2 red lasers on either side and 2 light sensors on either side and an ultrasonic sensor to sense incoming rc cars. When you break the first beam it starts a timer and when you hit the second beam it stops the timer. I want the robot to take the time that it took and the distance (which i will have to measure) and find the speed of the rc car. If the speed is to fast a set of metal barriers will pop up and cause the rc car to crash, but if it is obeying the speed limit it will allow the robot to pass through.
I really want to get green lasers for this, but red lasers will have to do.
I also do not have 2 light sensors, i only have 1 but i think that i can have the first beam be the laser and for the second a set of limit switches or bumper switches under a thin plate that the car would drive over thus tripping the speed trap.
Basically what i really want to know is.
How do i take 2 integer variables in the program and put them in a formula for multiplication, as far as i know there is no function block that allows this to happen in easy c v2. Can i program in c in easy cv2 because i know how to do it in c, i have made many programs that calculate differnt things.