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: mbed
Fork of el17ajf by
Diff: Input/Input.cpp
- Revision:
- 31:69fedaa9b171
- Parent:
- 25:bf47fe41883a
--- a/Input/Input.cpp Sat Apr 13 09:29:37 2019 +0000
+++ b/Input/Input.cpp Sat Apr 13 09:53:39 2019 +0000
@@ -3,29 +3,34 @@
namespace Input {
- SampledIn aButton(PTB9);
- SampledIn bButton(PTD0);
- SampledIn xButton(PTC17);
- SampledIn yButton(PTC12);
- SampledIn lButton(PTB18);
- SampledIn rButton(PTB3);
- SampledIn backButton(PTB19);
- SampledIn startButton(PTC5);
+ SampledIn a_button(PTB9);
+ SampledIn b_button(PTD0);
+ SampledIn x_button(PTC17);
+ SampledIn y_button(PTC12);
+ SampledIn l_button(PTB18);
+ SampledIn r_button(PTB3);
+ SampledIn back_button(PTB19);
+ SampledIn start_button(PTC5);
bool buttonHit(Button button) {
switch (button) {
case LEFT:
- return aButton.hit_frame();
+ return a_button.hit_frame();
case RIGHT:
- return yButton.hit_frame();
+ return y_button.hit_frame();
case UP:
- return xButton.hit_frame();
+ return x_button.hit_frame();
case DOWN:
- return bButton.hit_frame();
+ return b_button.hit_frame();
case START:
- return startButton.hit_frame();
+ return start_button.hit_frame();
default:
return false;
}
}
+
+ int getSeed() {
+ AnalogIn noise(PTB11); // get noise from joystick horizontal axis
+ return noise.read_u16();
+ }
};
\ No newline at end of file
