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: HEPTA_EPS HEPTA_SENSOR mbed
main.cpp@2:6fdd18473e85, 2022-08-18 (annotated)
- Committer:
- csmk18112
- Date:
- Thu Aug 18 12:45:14 2022 +0000
- Revision:
- 2:6fdd18473e85
- Parent:
- 0:dd7652191c4d
- Child:
- 3:ffb2234dadb7
gh
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| csmk18112 | 0:dd7652191c4d | 1 | #include "mbed.h" |
| csmk18112 | 0:dd7652191c4d | 2 | #include "HEPTA_EPS.h" |
| csmk18112 | 0:dd7652191c4d | 3 | #include "HEPTA_SENSOR.h" |
| csmk18112 | 0:dd7652191c4d | 4 | |
| csmk18112 | 0:dd7652191c4d | 5 | Serial pc(USBTX, USBRX); |
| csmk18112 | 0:dd7652191c4d | 6 | HEPTA_EPS eps(p16,p26); |
| csmk18112 | 0:dd7652191c4d | 7 | HEPTA_SENSOR sensor(p17, |
| csmk18112 | 0:dd7652191c4d | 8 | p28,p27,0xD0,0x18, |
| csmk18112 | 0:dd7652191c4d | 9 | p13, p14,p25,p24); |
| csmk18112 | 0:dd7652191c4d | 10 | |
| csmk18112 | 0:dd7652191c4d | 11 | int main() |
| csmk18112 | 0:dd7652191c4d | 12 | { |
| csmk18112 | 0:dd7652191c4d | 13 | pc.baud(9600); |
| csmk18112 | 2:6fdd18473e85 | 14 | float mx,my,mz; |
| csmk18112 | 2:6fdd18473e85 | 15 | pc.printf("Magnetometer Mode\r\n"); |
| csmk18112 | 0:dd7652191c4d | 16 | for(int i = 0; i<50; i++) { |
| csmk18112 | 2:6fdd18473e85 | 17 | sensor.sen_mag(&mx,&my,&mz); |
| csmk18112 | 2:6fdd18473e85 | 18 | pc.printf("mag : %f,%f,%f\r\n\r\n",mx,my,mz); |
| csmk18112 | 0:dd7652191c4d | 19 | wait(1.0); |
| csmk18112 | 0:dd7652191c4d | 20 | } |
| csmk18112 | 0:dd7652191c4d | 21 | } |