![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Code for the Hexiwear sensor system. Requires an Air Quality Click, Carbon Monoxide Click, and Buzzer Click for full functionality. Currently only reads values and displays to the OLED while testing and alerting the user of present threats. Future goals are to incorporate button presses with separate screens to display the data as well as using the KW40 drivers to transmit the data. Still in early stages of development, many unnecessary files will be removed and cleaned up once final product is completed within the next month. Driver.cpp is the main driver for the program and was written for purposes of this project. All other headers and functions were found on mbed.org from other developers repositories or provided by NXP Semiconductors for purposes of this project.
Dependencies: Hexi_KW40Z images
pwm_tone.h@0:f70b1d60f794, 2017-03-15 (annotated)
- Committer:
- Gfolker
- Date:
- Wed Mar 15 19:14:55 2017 +0000
- Revision:
- 0:f70b1d60f794
v1.0 of Hexiwear Sensor system. Currently able to detect air quality and carbon monoxide and display to the screen with alerts on the PWM buzzer click module and RGB LED.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Gfolker | 0:f70b1d60f794 | 1 | /* Includes ------------------------------------------------------------------*/ |
Gfolker | 0:f70b1d60f794 | 2 | #include "mbed.h" |
Gfolker | 0:f70b1d60f794 | 3 | |
Gfolker | 0:f70b1d60f794 | 4 | /* Private typedef -----------------------------------------------------------*/ |
Gfolker | 0:f70b1d60f794 | 5 | /* Private define ------------------------------------------------------------*/ |
Gfolker | 0:f70b1d60f794 | 6 | #define Do3 131 //C octave3 |
Gfolker | 0:f70b1d60f794 | 7 | #define Do3s 139 //C# |
Gfolker | 0:f70b1d60f794 | 8 | #define Re3 147 //D |
Gfolker | 0:f70b1d60f794 | 9 | #define Re3s 156 //D# |
Gfolker | 0:f70b1d60f794 | 10 | #define Mi3 165 //E |
Gfolker | 0:f70b1d60f794 | 11 | #define Fa3 175 //F |
Gfolker | 0:f70b1d60f794 | 12 | #define Fa3s 185 //F# |
Gfolker | 0:f70b1d60f794 | 13 | #define So3 196 //G |
Gfolker | 0:f70b1d60f794 | 14 | #define So3s 208 //G# |
Gfolker | 0:f70b1d60f794 | 15 | #define La3 220 //A |
Gfolker | 0:f70b1d60f794 | 16 | #define La3s 233 //A# |
Gfolker | 0:f70b1d60f794 | 17 | #define Ti3 247 //B |
Gfolker | 0:f70b1d60f794 | 18 | #define Do4 262 //C octave4 |
Gfolker | 0:f70b1d60f794 | 19 | #define Do4s 277 //C# |
Gfolker | 0:f70b1d60f794 | 20 | #define Re4 294 //D |
Gfolker | 0:f70b1d60f794 | 21 | #define Re4s 311 //D# |
Gfolker | 0:f70b1d60f794 | 22 | #define Mi4 330 //E |
Gfolker | 0:f70b1d60f794 | 23 | #define Fa4 349 //F |
Gfolker | 0:f70b1d60f794 | 24 | #define Fa4s 370 //F# |
Gfolker | 0:f70b1d60f794 | 25 | #define So4 392 //G |
Gfolker | 0:f70b1d60f794 | 26 | #define So4s 415 //G# |
Gfolker | 0:f70b1d60f794 | 27 | #define La4 440 //A |
Gfolker | 0:f70b1d60f794 | 28 | #define La4s 466 //A# |
Gfolker | 0:f70b1d60f794 | 29 | #define Ti4 494 //B |
Gfolker | 0:f70b1d60f794 | 30 | #define Do5 523 //C octave5 |
Gfolker | 0:f70b1d60f794 | 31 | #define Do5s 554 //C# |
Gfolker | 0:f70b1d60f794 | 32 | #define Re5 587 //D |
Gfolker | 0:f70b1d60f794 | 33 | #define Re5s 622 //D# |
Gfolker | 0:f70b1d60f794 | 34 | #define Mi5 659 //E |
Gfolker | 0:f70b1d60f794 | 35 | #define Fa5 699 //F |
Gfolker | 0:f70b1d60f794 | 36 | #define Fa5s 740 //F# |
Gfolker | 0:f70b1d60f794 | 37 | #define So5 784 //G |
Gfolker | 0:f70b1d60f794 | 38 | #define So5s 831 //G# |
Gfolker | 0:f70b1d60f794 | 39 | #define La5 880 //A |
Gfolker | 0:f70b1d60f794 | 40 | #define La5s 932 //A# |
Gfolker | 0:f70b1d60f794 | 41 | #define Ti5 988 //B |
Gfolker | 0:f70b1d60f794 | 42 | |
Gfolker | 0:f70b1d60f794 | 43 | /* Private variables ---------------------------------------------------------*/ |
Gfolker | 0:f70b1d60f794 | 44 | /* Private function prototypes -----------------------------------------------*/ |
Gfolker | 0:f70b1d60f794 | 45 | void Tune(PwmOut name, int period, int beat); |
Gfolker | 0:f70b1d60f794 | 46 | void Auto_tunes(PwmOut name, int period, int beat); |
Gfolker | 0:f70b1d60f794 | 47 | void Stop_tunes(PwmOut name); |
Gfolker | 0:f70b1d60f794 | 48 | //void buzzer(PwmOut name, int ppm, float B_4, float B_5); |
Gfolker | 0:f70b1d60f794 | 49 | |
Gfolker | 0:f70b1d60f794 | 50 | /* Private functions ---------------------------------------------------------*/ |