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
buttons.cpp@14:c8cca3687e64, 2014-02-24 (annotated)
- Committer:
- DavidEGrayson
- Date:
- Mon Feb 24 00:07:54 2014 +0000
- Revision:
- 14:c8cca3687e64
- Parent:
- 11:bd14d512340a
- Child:
- 16:8eaa5bc2bdb1
Started doing an experiment to see what dA really is.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DavidEGrayson | 11:bd14d512340a | 1 | #include <mbed.h> |
DavidEGrayson | 11:bd14d512340a | 2 | #include "buttons.h" |
DavidEGrayson | 11:bd14d512340a | 3 | |
DavidEGrayson | 11:bd14d512340a | 4 | DigitalIn button1(p13); |
DavidEGrayson | 11:bd14d512340a | 5 | |
DavidEGrayson | 11:bd14d512340a | 6 | void buttonsInit() |
DavidEGrayson | 11:bd14d512340a | 7 | { |
DavidEGrayson | 11:bd14d512340a | 8 | button1.mode(PullUp); |
DavidEGrayson | 11:bd14d512340a | 9 | } |
DavidEGrayson | 11:bd14d512340a | 10 | |
DavidEGrayson | 11:bd14d512340a | 11 | bool button1IsPressed() |
DavidEGrayson | 11:bd14d512340a | 12 | { |
DavidEGrayson | 11:bd14d512340a | 13 | return button1.read() == 0; |
DavidEGrayson | 11:bd14d512340a | 14 | } |