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: mbed
Revision 1:3c24e35d6d62, committed 2019-02-07
- Comitter:
- Danyal
- Date:
- Thu Feb 07 11:41:45 2019 +0000
- Parent:
- 0:99404616b1d5
- Commit message:
- new projekt
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Feb 07 09:06:43 2019 +0000
+++ b/main.cpp Thu Feb 07 11:41:45 2019 +0000
@@ -129,6 +129,7 @@
char temp[MESSPUNKTE];
char light1[MESSPUNKTE];
char light2[MESSPUNKTE];
+ int16_t light[MESSPUNKTE];
// Chip must be deselected
cs = 0;
spi.write(0x03); // read instruction
@@ -142,6 +143,7 @@
wait_ms(1);
int x = 0;
// now send all data in seperated array´s
+ // send data to temp array
for (int i = 0;i<leng;i=i+ADDRESSINCREASE) {
//pc.printf("%d : %x\n",x,buffer[i]);
temp[x] = buffer[i];
@@ -149,6 +151,7 @@
}
x=0;
wait_ms(1);
+ // send data to stunden array
for (int i = 1;i<leng;i=i+ADDRESSINCREASE) {
// pc.printf("%d : %x\n",x,buffer[i]);
stunden[x] = buffer[i];
@@ -156,6 +159,7 @@
}
x=0;
wait_ms(1);
+ // send data minuten
for (int i = 2;i<leng;i=i+ADDRESSINCREASE) {
//pc.printf("%d : %x\n",x,buffer[i]);
minuten[x] = buffer[i];
@@ -175,10 +179,20 @@
light2[x] = buffer[i];
x++;
}
+ // Volatge Ausgabe in Prozent.
+ for (int i = 0;i<MESSPUNKTE;i++){
+ uint16_t l1 = light1[i];
+ uint16_t ltemp = 0;
+ ltemp =l1<<8;
+ uint16_t ltemp2 = light2[i];
+ light[i] =(ltemp + ltemp2)/655;
+
+ //light[i] = light[i]/65535;
+ }
// print all messures. step by step
for (int i = 0;i<counter;i++) {
- pc.printf("Messung: %d Temperatur: %d Uhrzeit: %x:%x Voltage:%x%x \n",i+1,temp[i],stunden[i],
- minuten[i],light1[i],light2[i]);
+ pc.printf("Messung: %d Temperatur: %d Uhrzeit: %x:%x Voltage: %d Prozent \n",i+1,temp[i],stunden[i],
+ minuten[i],light[i]);
}
}