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 17:c5a38d01dfbe, committed 2013-08-23
- Comitter:
- vsluiter
- Date:
- Fri Aug 23 17:04:50 2013 +0000
- Parent:
- 16:f0176e9e4a9d
- Child:
- 18:789e9fafa5f6
- Commit message:
- Last update before using GameButton
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Aug 23 13:29:11 2013 +0000
+++ b/main.cpp Fri Aug 23 17:04:50 2013 +0000
@@ -128,7 +128,7 @@
void PushHandler(void);
};
-GameButton::GameButton(PinName pin, float time)
+GameButton::GameButton(PinName pin, float time=0.5)
{
pushflag = false;
intpin = new InterruptIn(pin);
@@ -155,6 +155,12 @@
return m_timeoutactive;
}
+class PongGameButton : public GameButton
+{
+ public:
+ uint8_t paddlepos;
+};
+
void UpdateLEDstrip(void)
{
uint8_t pixelcounter;
@@ -266,6 +272,7 @@
HandleScore(&left_score,&right_score,false, &gametimer);
paddle.position = -paddle.getSize();
naglevel1=naglevel2 = 0;
+ paddle.setSpeed(30);
}
if(paddle.position < -paddle.getSize() && (paddle.direction == 0))
{
@@ -275,6 +282,7 @@
HandleScore(&left_score,&right_score,true, &gametimer);
naglevel1=naglevel2 = 0;
paddle.position = NUMBER_OF_PIXELS;
+ paddle.setSpeed(30);
}
}
if(gametimer.read()>10 && !naglevel1)