ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jgb

Dependencies:   mbed

Revision:
21:a0f3651f56c4
Parent:
13:cfdfe60a2327
Child:
22:7406068f6c59
diff -r 6db651a3cfec -r a0f3651f56c4 Pup/Pup_test.h
--- a/Pup/Pup_test.h	Fri May 22 14:06:35 2020 +0000
+++ b/Pup/Pup_test.h	Sat May 23 13:59:51 2020 +0000
@@ -9,7 +9,26 @@
  */
  
  
- 
+ bool Spikes_test_initial()
+{
+    // Initialise
+    Pup pup;
+    pup.init(); //_x = 0 _y = 0
+
+    // Read the position
+    Vector2D read_pos_1 = spikes.get_pos();
+    printf("%f, %f\n", read_pos_1.x, read_pos_1.y);
+
+    // Now check that both the position is as expected
+    bool success_flag = true;
+    
+    // Fail the test if the initial position is wrong
+    if (read_pos_1.x != 0 || read_pos_1.y != 0) {
+        success_flag = false;
+    }
+
+    return success_flag;
+}
 
  
 #endif
\ No newline at end of file