Wearable Project 2 - Nucleo STM32F401 / STM32F401RET6 64 PINS Board: NUCLEO-F401RE

Dependencies:   mbed-os XBeeLib SDFileSystem

Hallo Putacos!

TODO List:

  1. - Create main file
  2. - Learn AnalogIn Microphone Handling I/O's
  3. - Learn DigitalOut LEDs Handling I/O's
  4. - Learn Serial (Xbee) and (PC) Debug More about Serial and also Digi International Inc. / XBeeLib
  5. - Learn SPI (IMU) More about SPI | Hey guys., also check out MPU9250AHRS by Kris Winer
  6. - Learn SPI (SD Card) More about SPI
  7. - Learn Task Scheduler (Tasks) More about Managing tasks
  8. - Learn Timer (time-stamp) More about Timers

Further information see mbed OS API

Team / Los Putacos
Los Putacos @ MCI Mechatronik & Smart Technology Master

https://upload.wikimedia.org/wikipedia/en/9/9b/Yoda_Empire_Strikes_Back.png

https://i.pinimg.com/736x/40/03/d9/4003d95cd255de04ea0fa0b4785324e1--star-wars-t-shirts-t-shirt-art.jpg

Files at this revision

API Documentation at this revision

Comitter:
gusteibolt
Date:
Thu Oct 12 14:32:34 2017 +0000
Parent:
6:939df52d75c9
Child:
8:ba93a973f967
Commit message:
Separated event from main.cpp, still a bug on that!

Changed in this revision

event.cpp Show annotated file Show diff for this revision Revisions of this file
event.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
pin.h Show annotated file Show diff for this revision Revisions of this file
--- a/event.cpp	Thu Oct 12 13:26:59 2017 +0000
+++ b/event.cpp	Thu Oct 12 14:32:34 2017 +0000
@@ -7,5 +7,19 @@
 *       Date: 12-Oct-2017
 *    Version: V0.1
 */
+#include "mbed.h"
 
-//-----------------------------------------------------------------
+extern Serial pc;
+
+
+void print_stinrg(char c = '*') {
+    pc.putc(c);
+}
+
+void print_event(void const *argv) {
+    pc.printf((const char*)argv);
+}
+
+void blink_event(DigitalOut pin){
+    pin = 1;
+}
\ No newline at end of file
--- a/event.h	Thu Oct 12 13:26:59 2017 +0000
+++ b/event.h	Thu Oct 12 14:32:34 2017 +0000
@@ -12,21 +12,11 @@
 #ifndef EVENT_H_
 #define EVENT_H_
 
+void print_stinrg(void);
+void print_event(void);
+void blink_event(void);
+
 // Your code here!
-void print_stinrg(char);
-void print_thread(void const);
-
-void print_stinrg(char c = '*')
-{
-    pc.putc(c);
-}
-
-void print_thread(void const *argv)
-{
-    pc.printf((const char*)argv);
-}
-
-
     
 #endif // EVENT_H_
 //-----------------------------------------------------------------
\ No newline at end of file
--- a/main.cpp	Thu Oct 12 13:26:59 2017 +0000
+++ b/main.cpp	Thu Oct 12 14:32:34 2017 +0000
@@ -20,20 +20,13 @@
 #include "mbed_events.h"
 
 #include "configuration.h"
+#include "event.h"
+#include "pin.h"
 #include "MPU9250.h"
 //-----------------------------------------------------------------
 
 //-----------------------------------------------------------------
 // Declarations
-
-//Analog Input
-
-AnalogIn   micro(A0);
-
-//Digital Input
-
-DigitalOut led1(LED1);
-
 Timer t; //Timer ┬ÁS time-stamp
 
 EventQueue queue(32 * EVENTS_EVENT_SIZE); //Event
@@ -49,7 +42,7 @@
 //-----------------------------------------------------------------
 
 //-----------------------------------------------------------------
-void Setup(){
+void setup(){
     
     // PC Serial (Debug) baudrate
     pc.baud(9600);
@@ -58,7 +51,8 @@
     // Task queue
     int task1_id = queue.call_every(1000, printf, "called every 1 seconds\n");
     int task2_id = queue.call_every(2500, printf, "called every 2.5 seconds\n");
-    int task3_id = queue.call_every(3000, print_thread, (void *)"called every 3 seconds\n");
+    //int task3_id = queue.call_every(3000, print_event, (void *)"called every 3 seconds\n");
+    //int task4_id = queue.call_every(50, blink_event, led1);
 }
 //-----------------------------------------------------------------
 
@@ -76,7 +70,7 @@
 //-----------------------------------------------------------------
 int main()
 {
-    Setup(); // Initial setups
+    setup(); // Initial setups
     
     
     //Reading the analog input (Microphone)  array = micro.read_u16();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pin.h	Thu Oct 12 14:32:34 2017 +0000
@@ -0,0 +1,24 @@
+/*
+* Los Putacos
+* Copyright (C) 2017, All rights reserved.
+* ________________________________________ 
+*
+* Created by: Gustavo Campana, Michael Schmidt, Miguel Lopez
+*       Date: 12-Oct-2017
+*    Version: V0.1
+*/
+
+//-----------------------------------------------------------------
+#ifndef PIN_H_
+#define PIN_H_
+
+//Analog Input
+AnalogIn   microphone(A0);
+
+//Digital Input
+DigitalOut led1(LED1);
+
+// Your code here!
+    
+#endif // PIN_H_
+//-----------------------------------------------------------------
\ No newline at end of file