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.
Revision 5:a95a6243c118, committed 2014-10-21
- Comitter:
- Throwbot
- Date:
- Tue Oct 21 21:29:54 2014 +0000
- Parent:
- 4:0eeea5f05e28
- Commit message:
- Initial (Test) Commit
Changed in this revision
| robot.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/robot.cpp Tue Oct 14 17:54:20 2014 +0000
+++ b/robot.cpp Tue Oct 21 21:29:54 2014 +0000
@@ -12,8 +12,8 @@
//*********************************CONSTRUCTOR*********************************//
HC05 bt(tx_bt,rx_bt,EN_BT);
//QEI wheel (PTA16, PTA17, NC, 24);
-QEI right (PTA16, PTA17, NC, 150, QEI::X4_ENCODING);
-QEI left (PTA14, PTA13, NC, 150, QEI::X4_ENCODING);
+QEI right (PTA16, PTA17, NC, 300, QEI::X4_ENCODING);
+QEI left (PTA14, PTA13, NC, 300, QEI::X4_ENCODING);
//Serial bt(rx_bt,tx_bt);
//MPU6050 mpu(PTE0, PTE1);
DigitalOut myled(myledd);
@@ -235,8 +235,8 @@
void encoder_thread(void const *args)
{
while(true) {
- left_current_reading=left.getPulses()*(-1)/5;
- right_current_reading= right.getPulses()/5;
+ left_current_reading=left.getPulses()*(-1)/9.85;
+ right_current_reading= right.getPulses()/10;
left_change = left_current_reading- left_prev_read;
right_change =right_current_reading- right_prev_read;
left_prev_read=left_current_reading;