Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
encoders.cpp
00001 #include "encoders.h" 00002 00003 const PinName encoderPinLeftA = p6, // Gray wire 00004 encoderPinLeftB = p7, // White wire 00005 encoderPinRightA = p30, // White wire 00006 encoderPinRightB = p29; // Gray wire 00007 00008 PololuEncoderBuffer encoderBuffer; 00009 PololuEncoder encoderLeft(encoderPinLeftA, encoderPinLeftB, &encoderBuffer, ENCODER_LEFT); 00010 PololuEncoder encoderRight(encoderPinRightA, encoderPinRightB, &encoderBuffer, ENCODER_RIGHT); 00011 00012 void encodersInit() 00013 { 00014 DigitalIn(encoderPinLeftA).mode(PullNone); 00015 DigitalIn(encoderPinLeftB).mode(PullNone); 00016 DigitalIn(encoderPinRightA).mode(PullNone); 00017 DigitalIn(encoderPinRightB).mode(PullNone); 00018 wait_us(50); 00019 encoderLeft.init(); 00020 encoderRight.init(); 00021 }
Generated on Sun Jul 17 2022 15:55:09 by
1.7.2
