Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Data_Clock_Pair Seeed_Chainable_LED Seeed_Four_Digit_Disp Seeed_IR_Temp_Sensor Seeed_Led_Bar
Fork of Seeed_Grove_4_Digit_Display_Clock by
Revision 16:cebc9f55d2a6, committed 2017-05-18
- Comitter:
- tulanthoar
- Date:
- Thu May 18 10:48:12 2017 -0600
- Parent:
- 15:abda719ba6e6
- Child:
- 17:71c14845db51
- Commit message:
- supplimental files to previous commit
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DataClockPair.h Thu May 18 10:48:12 2017 -0600
@@ -0,0 +1,10 @@
+#ifndef DATA_CLOCK_PAIR_H
+#define DATA_CLOCK_PAIR_H
+#include "mbed.h"
+struct DataClockPair{
+ typedef PinName ClockPin;
+ typedef PinName DataPin;
+ ClockPin clockPin;
+ DataPin dataPin;
+};
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/SeeedIRTempSensor.h Thu May 18 10:48:12 2017 -0600
@@ -0,0 +1,43 @@
+/* #include <cmath> */
+#include "mbed.h"
+namespace IRTempSensor{
+#define SUR_TEMP_PIN PA_3 // Analog input pin connect to temperature sensor SUR pin
+#define OBJ_TEMP_PIN PC_0 // Analog input pin connect to temperature sensor OBJ pin
+
+double measuresureTemp(PinName surPin) {
+ AnalogIn surTPin(surPin);
+ float volts, resistance, temperature;
+ volts = 0;
+ for (int i = 0; i < 100; i++) {
+ volts += surTPin.read();
+ wait_us(10);
+ }
+ volts *= 3.3/100;
+ resistance = 2000000*volts/(2.5-volts);
+ temperature = 1/(log(resistance/100000)/3964 +(1/298.15)) - 273.15;
+ return temperature;
+}
+
+float measureObjectTemp(PinName surPin, PinName objPin) {
+ AnalogIn objTPin(objPin);
+ float objV = 0;
+ for (int i = 0; i < 100; i++) {
+ objV += objTPin.read();
+ wait_us(10);
+ }
+ objV *= 3.3/100;
+ /* float pileSignal= objV - 2.5*17.4/(17.4+64); */
+ float pileSignal = objV - 0.52;
+ pileSignal *= 0.01;
+ float ts = measuresureTemp(surPin) + 273.15;
+ /* float calib = 1+(298.15 - ts)*0.0011; */
+ float calib = 1;
+ float k = 3.45*pow(10,-13)*calib;
+ float kRecip = 2976078405624.9985;
+ float kRecipAmp = kRecip * 0.01;
+ /* float objT = (pileSignal*kRecip + ts*ts*ts*ts); */
+ float objT = (objV*kRecipAmp -0.51*kRecipAmp + ts*ts*ts*ts);
+ return pow(objT,0.25) - 273.15;
+ /* return pileSignal*1000; */
+ /* return objV*100; */
+}};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/develop.json Thu May 18 10:48:12 2017 -0600
@@ -0,0 +1,16 @@
+{
+ "GCC_ARM": {
+ "common": ["-c", "-Wall", "-Wextra",
+ "-Wno-unused-parameter", "-Wno-missing-field-initializers",
+ "-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
+ "-ffunction-sections", "-fdata-sections", "-funsigned-char",
+ "-MMD", "-fno-delete-null-pointer-checks",
+ "-fomit-frame-pointer", "-Os"],
+ "asm": ["-x", "assembler-with-cpp"],
+ "c": ["-std=gnu99"],
+ "cxx": ["-std=gnu++11", "-fno-rtti", "-Wvla"],
+ "ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
+ "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r",
+ "-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit"]
+ }
+}
