We're trying to work on our acceleration algorithm. At first we were going to go with the accelerometer, but the thing is actually a lot more unpredictable than we thought, so we now want to use just a straight line for acceleration, something like y=mx+b. Only problem is, we can't seem to figure out how to store the previous y, since y will become b the next time around the loop. I know how to do this in php, but I have NO idea about LabVIEW.
Since what I just said could be kinda confusing, here's how I would have coded it if robots could run php:
PHP Code:
<?
$override = false; // This would become true if the pilot presses a button, for taking turns or suddenly going in reverse to brake.
$current_speed = 0;
$wants_to_go = 1;
$acceleration = 0.05;
while(true){
if(!$override){
while($current_speed <= $wants_to_go){
$current_speed = $current_speed + $acceleration;
}
}else{
$current_speed = $wants_to_go;
}
}
?>