L'équipe robotique FIP a pour but de participer à la Coupe de France de Robotique (http://www.planete-sciences.org/robot/?section=pages&pageid=79). L'équipe est composée d'étudiants de l'école d'ingénieur Télécom Bretagne en filière par partenariat. Nous utilisons comme plateforme les microcontrôleurs STM32 associés aux cartes NUCLEO.

Dependencies:   mbed HC_SR04_Ultrasonic_Library Nucleo_Sensor_Shield VL6180x_lib

Fork of Coupe Robotique FIP by Julien Tiron

We are a team of students building an autonomous robot which will compete in the French Robotic Cup.

main.cpp

Committer:
julientiron
Date:
2015-03-31
Revision:
2:32226f1d12e5
Parent:
1:c6105db4ad17
Child:
4:149c4509b35d
Child:
7:dc76d89a8d51

File content as of revision 2:32226f1d12e5:

#include "mbed.h"
#include "ultrasonic.h"

 void dist(int distance)
{
    //put code here to happen when the distance is changed
    printf("Distance changed to %dmm\r\n", distance);
}

ultrasonic mu(D8, D9, .1, 1, &dist);    //Set the trigger pin to D8 and the echo pin to D9
                                        //have updates every .1 seconds and a timeout after 1
                                        //second, and call dist when the distance changes

int main()
{
    mu.startUpdates();//start mesuring the distance
    while(1)
    {
        //Do something else here
        mu.checkDistance();     //call checkDistance() as much as possible, as this is where
                                //the class checks if dist needs to be called.
    }
}