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.
Dependents: Barros_Assignment4
Diff: physics_ball.cpp
- Revision:
- 1:a2dda7baafaa
- Parent:
- 0:9591bae8d04c
- Child:
- 2:6ba843cde0bb
--- a/physics_ball.cpp Tue Oct 31 12:59:49 2017 +0000
+++ b/physics_ball.cpp Tue Oct 31 14:51:13 2017 +0000
@@ -36,14 +36,14 @@
speedy = speedy_in;
}
-void physics_ball::update( float time_step_in , int posx, int posy, int speedx, int speedy, MMA8452Q & accel)
+void physics_ball::update( float time_step_in , MMA8452Q & accel)
{
time_step = time_step_in;
posx = posx - (speedx * accel.readY());
posy = posy - (speedy * accel.readX());
- //Ball 1 Physics
+ //Ball Physics
if ((posx <= radius) || (posx >= 128-radius)){
speedx = -1 * speedx;
}
