Fabio Faria / Mbed 2 deprecated DEEC_STM32_for_Romi

Dependencies:   mbed

main.cpp

Committer:
fabiofaria
Date:
2019-02-21
Revision:
1:1e85a02fe11a
Parent:
0:4d8b265728c9
Child:
4:4b9d96e6c509

File content as of revision 1:1e85a02fe11a:

#include "mbed.h"
#include "Robot.h"

Serial pc(SERIAL_TX, SERIAL_RX);

int main() {
    while(1) {
        getCountsAndReset(); // Call getCountsAndReset() to read the values of encoders
                             // and reset them. The values become available on variables
                             // "countsLeft" and "countsRight".
        
        // setSpeeds(20, 50); // Uncomment to set a speed of 20 for the
                              // left motor and 50 for the right motor.
        
        pc.printf("Encoders: Left=%d   Right=%d\n", countsLeft, countsRight);
        
        wait(0.5); // Delay of 0.5 seconds.
    }
}