2/13/14 – Code (Version 2.1)

#include <FEHLCD.h>

#include <FEHIO.h>
#include <FEHUtility.h>
#include <FEHMotor.h>

int main(void)
{
    FEHMotor dcmotorL(FEHMotor::Motor0);
    FEHMotor dcmotorR(FEHMotor::Motor1);
    ButtonBoard buttons(FEHIO::Bank3);
    AnalogInputPin CdS(FEHIO::P0_0);
    while(1==1)
    {

        if(buttons.MiddlePressed())
        {
            while(1==1)
            {
                if(CdS.Value()<0.290)
                {
                dcmotorL.SetPercent(-75);
                dcmotorR.SetPercent(50);
                Sleep(2.5);
                dcmotorL.SetPercent(0);
                dcmotorR.SetPercent(0);
                Sleep(500.0);
                }
            }
        }
    }

}

Leave a Reply

Your email address will not be published. Required fields are marked *