ACC TEAM / Mbed 2 deprecated ACCPROJECT

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
eitanallal
Date:
Thu Mar 19 07:31:08 2020 +0000
Commit message:
YO

Changed in this revision

fonction.c Show annotated file Show diff for this revision Revisions of this file
fonction.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fonction.c	Thu Mar 19 07:31:08 2020 +0000
@@ -0,0 +1,21 @@
+#include "fonction.h"
+
+// Calcul de l'état à l'instant t+dt
+
+void sortiex(int posx,int accx){
+    posx=posx+accx*TMP*TMP;
+}
+
+void sortiey(int posy,int accy){
+    posy=posy+accy*TMP*TMP;
+}
+
+void listex(int* matx,int entreex,int rang){
+    int* p=matx+rang+1;
+    *p=entreex;
+}
+
+void listey(int* maty,int entreey,int rang){
+    int* p=maty+rang+1;
+    *p=entreey;
+}    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fonction.h	Thu Mar 19 07:31:08 2020 +0000
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+#define TMP 0.00001
+
+void sortiex(int,int);
+void sortiey(int,int);
+void listex(int*,int,int);
+void listey(int*,int,int);
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 19 07:31:08 2020 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "fonction.h"
+#include "fonction.c"
+
+DigitalOut myled(LED1);
+
+int main() {  
+    BSP_LCD_Init();
+    BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS);
+    BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
+
+    while (1) {S
+        BSP_LCD_Clear(LCD_COLOR_BLACK);
+        BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
+        BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
+        BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE);
+
+        BSP_LCD_DisplayStringAt(0, 1, (uint8_t *)"Bienvenue sur notre projeeeeetttttt !!!", CENTER_MODE);
+        HAL_Delay(5000);
+
+        
+/*    while(1) {
+        myled = 1; // LED is ON
+        wait(0.2); // 200 ms
+        myled = 0; // LED is OFF
+        wait(1.0); // 1 sec
+    }*/
+    int posx=0;
+    int posy=0;
+    int* matx=NULL;
+    int* maty=NULL;
+    int rang=0;
+    while(1){
+        //L'acceleromètre doit donner accx et accy
+        int accx=0;
+        int accy=0;
+        sortiex(posx,accx);
+        sortiey(posy,accy);
+        wait(TMP);
+        rang=rang+1;
+        }
+    return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 19 07:31:08 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file