évitement d obstacles

Dependencies:   Motor 16_Channel_Analog VL53L0X

Revision:
0:324dc73a5829
Child:
1:53b992a47b28
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 17 09:29:10 2020 +0000
@@ -0,0 +1,30 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2019 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+#include "perceptron.h"
+#include <vector>
+#include <iostream>
+#include <stdio.h>
+
+int main()
+{
+    printf("debut\r\n");
+    vector<float> Wg = {1,1,-1,-1};
+    perceptron perceptronG(Wg);
+    
+    vector<float> Wd = {1,-1,-1,1};
+    perceptron perceptronD(Wd);
+    
+    vector<int> X = {1,1,1};
+    
+    printf("X=%d,%d,%d\r\n",X[0],X[1],X[2]);
+    
+    int Vg=perceptronG.predict(X);
+    int Vd=perceptronD.predict(X);
+    
+    printf("Vg=%d\r\n",Vg);
+    printf("Vd=%d\r\n",Vd);
+}