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: ADXL362 mbed MPL3115A2
Revision 31:c924aad0dc4b, committed 2018-03-09
- Comitter:
- htdoughe
- Date:
- Fri Mar 09 16:21:15 2018 +0000
- Parent:
- 30:9e127911409d
- Child:
- 32:f6664eade7fe
- Commit message:
- report and code tweaks
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| report.txt | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Mar 08 21:52:44 2018 +0000
+++ b/main.cpp Fri Mar 09 16:21:15 2018 +0000
@@ -7,7 +7,7 @@
DigitalOut led3(LED3);
Serial pc(USBTX, USBRX);
-AnalogIn gpio(A4);
+//AnalogIn gpio(D9);
//map of register values and names for the adxl
int aregids[34];
@@ -334,10 +334,10 @@
wait_ms(100);
uint8_t st = pressure.getCTRL_REG1();
uint8_t msk = 0x8f;
- printf("CTL_REG1 = 0x%05x\r\n", st);
+ //printf("CTL_REG1 = 0x%05x\r\n", st);
pressure.setCTRL_REG1(msk);
pressure.activate();
- printf("CTL_REG1 = 0x%05x\r\n", pressure.getCTRL_REG1());
+ //printf("CTL_REG1 = 0x%05x\r\n", pressure.getCTRL_REG1());
//pressure stuff
@@ -347,7 +347,7 @@
//GPIO pin indicates sampling should begin -- if voltage == 3.3, start
while(ind < 900 && !pc.readable()) {
- printf("in the while\r\n");
+ printf("measuring...\r\n");
//then we measure
//pressure and temperature sampled at 10times/second (10 hz)
//LED blinks during sampling at 1 hz (1 time/second)
@@ -384,7 +384,7 @@
in = ch;
}//while
if(in == p) {
- while(pind < pend+1) {
+ while(pind < pend) {
pc.printf("\n\r%f\t%f", data[pind],data[pind+1]);
pind += 2;
ex = true;
--- a/report.txt Thu Mar 08 21:52:44 2018 +0000
+++ b/report.txt Fri Mar 09 16:21:15 2018 +0000
@@ -42,60 +42,64 @@
In addition, our code does not include the GPIO pin at the moment because screen
breaks when it is added.
-
-Example output:
+
+example output:
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98763.000000 22.187500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98749.000000 22.062500
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98797.000000 22.250000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98785.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98794.000000 22.125000
-98842.000000 22.250000
-98842.000000 22.250000
-98842.000000 22.250000
-98842.000000 22.250000
-98842.000000 22.250000
-98842.000000 22.250000
-98842.000000 22.250000
+986.000000 22.250000
+986.000000 22.187500
+986.000000 22.187500
+986.000000 22.125000
+986.000000 22.250000
+986.000000 22.250000
+987.000000 22.312500
+986.000000 22.250000
+986.000000 22.250000
+986.000000 22.250000
+986.000000 22.312500
+987.000000 22.375000
+986.000000 22.125000
+986.000000 22.187500
+987.000000 22.375000
+986.000000 22.187500
+987.000000 22.312500
+986.000000 22.312500
+987.000000 22.312500
+987.000000 22.312500
+986.000000 22.187500
+986.000000 22.125000
+986.000000 22.250000
+986.000000 22.187500
+987.000000 22.250000
+987.000000 22.187500
+986.000000 22.187500
+986.000000 22.125000
+987.000000 22.250000
+987.000000 22.312500
+986.000000 22.125000
+987.000000 22.375000
+987.000000 22.312500
+986.000000 22.187500
+987.000000 22.312500
+987.000000 22.375000
+987.000000 22.250000
+986.000000 22.125000
+986.000000 22.187500
+987.000000 22.375000
+986.000000 22.250000
+986.000000 22.187500
+986.000000 22.125000
+987.000000 22.250000
+987.000000 22.312500
+987.000000 22.375000
+986.000000 22.187500
+987.000000 22.437500
+987.000000 22.250000
+987.000000 22.250000
+987.000000 22.250000
+986.000000 22.250000
+987.000000 22.375000
+986.000000 22.250000
+987.000000 22.312500
+986.000000 22.125000
+
+
\ No newline at end of file