David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.

Dependencies:   PololuEncoder Pacer mbed GeneralDebouncer

Files at this revision

API Documentation at this revision

Comitter:
DavidEGrayson
Date:
Sat Feb 22 04:53:35 2014 +0000
Parent:
10:e4dd36148539
Child:
12:835a4d24ae3b
Commit message:
Added a button on p13. This will be helpful in a bit for testing my algorithms when there are two stages involved.

Changed in this revision

buttons.cpp Show annotated file Show diff for this revision Revisions of this file
buttons.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buttons.cpp	Sat Feb 22 04:53:35 2014 +0000
@@ -0,0 +1,14 @@
+#include <mbed.h>
+#include "buttons.h"
+
+DigitalIn button1(p13);
+
+void buttonsInit()
+{
+    button1.mode(PullUp);
+}
+
+bool button1IsPressed()
+{
+    return button1.read() == 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/buttons.h	Sat Feb 22 04:53:35 2014 +0000
@@ -0,0 +1,5 @@
+#pragma once
+
+void buttonsInit();
+
+bool button1IsPressed();
\ No newline at end of file