GroupA / Mbed 2 deprecated WaG_final

Dependencies:   mbed

Fork of Lab_6_WaG by GroupA

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