test

Dependencies:   mbed

Dependents:   MouseHybridSenseCode

findLineFunc.cpp

Committer:
JamieBignell
Date:
2018-04-28
Revision:
7:11dd5581c763
Parent:
6:a652deaae134

File content as of revision 7:11dd5581c763:

#include <mbed.h>
#include <funcdef.h>

void findLineFunc()
{
    //TURN RIGHT UNTIL SENSOR A6, POSITION 6, BEATS THERSHOLD
    leftMotorVal.pulsewidth_us(350); 
    rightMotorVal.pulsewidth_us(0);     
    
    while (((sensorPin[0]).read_u16()>>4) < (sensorThreshold[0]))  
    {
                 
    }
    
    //CONTINUE FOR A BIT, THEN STOP MOTORS AND RETURN
    wait_ms(10);
    
    return;       
}