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 Lab_6_WaG by
Diff: wag.cpp
- Revision:
- 71:6ced854bebb2
- Parent:
- 69:1b7271bd4a75
- Child:
- 72:aec869655869
--- a/wag.cpp Mon Apr 23 20:04:11 2018 +0000
+++ b/wag.cpp Mon Apr 23 20:16:41 2018 +0000
@@ -19,6 +19,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
Timer t;
extern spi_cfg as1107;
@@ -38,7 +39,7 @@
if (sensor_no == 0)
whacker_no = 8;
-
+ srand(time(NULL));
for (int i = 0; i < 15; i++) {
pc.printf("Round %d\n", i + 1);
a_num = rand() % 8; // create random number 0-7
