David's line following code from the LVBots competition, 2015.
Dependencies: GeneralDebouncer Pacer PololuEncoder mbed
Fork of DeadReckoning by
buttons.cpp@11:bd14d512340a, 2014-02-22 (annotated)
- Committer:
- DavidEGrayson
- Date:
- Sat Feb 22 04:53:35 2014 +0000
- Revision:
- 11:bd14d512340a
- Child:
- 16:8eaa5bc2bdb1
Added a button on p13. This will be helpful in a bit for testing my algorithms when there are two stages involved.
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 | } |