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 ll16j23s_test_docs
Diff: Food/Food.cpp
- Revision:
- 7:dd84e0fab346
- Parent:
- 6:6c9453397f4a
- Child:
- 8:bcc3403d7e79
diff -r 6c9453397f4a -r dd84e0fab346 Food/Food.cpp
--- a/Food/Food.cpp Sat May 23 20:01:00 2020 +0000
+++ b/Food/Food.cpp Sun May 24 22:18:55 2020 +0000
@@ -13,8 +13,8 @@
//deconstructor
}
-void Food::init(FXOS8700CQ &mag)
-{
+void Food::init(FXOS8700CQ &mag) {
+
mag.init();
Data _values = mag.get_values();
_seed = 1000000*(_values.mx + _values.my + _values.mz);
@@ -22,14 +22,14 @@
}
-void Food::rand_pos(Gamepad &pad, int &_x, int &_y) {
+void Food::rand_pos(Gamepad &pad) {
_x = 2 * (rand() % 42); //selects random x cell
//printf("Food x: %d\n", _x);
_y = 2 * (rand() % 24); //selects random y call
//printf("Food y: %d\n", _y);
- pad.led(3,1);
+ pad.led(3,0.1);
}