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: BLE_API mbed nRF51822 circular_buffer
main.cpp@9:3708b94b2312, 2016-03-08 (annotated)
- Committer:
- agufal
- Date:
- Tue Mar 08 15:33:13 2016 +0000
- Revision:
- 9:3708b94b2312
- Parent:
- 8:e7cafda76315
- Child:
- 11:27f2850b9388
Creada la clase AccelService, que se encarga de mandar por Bluetooth la informaci?n del aceler?metro. ; OJO: parece que env?a, pero no se si los datos que se mandan est?n bien.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| agufal | 6:fa74a43cae81 | 1 | /* |
| agufal | 6:fa74a43cae81 | 2 | * Esto es para la placa Xtrinsic-Sense Board de element14, mas |
| agufal | 6:fa74a43cae81 | 3 | * concretamente para el acelerometro MMA8491Q |
| agufal | 6:fa74a43cae81 | 4 | */ |
| agufal | 0:c123bc196680 | 5 | #include "mbed.h" |
| agufal | 8:e7cafda76315 | 6 | #include "Acelerometro.h" |
| agufal | 9:3708b94b2312 | 7 | #include "AccelService.h" |
| agufal | 0:c123bc196680 | 8 | |
| agufal | 0:c123bc196680 | 9 | Serial pc(p9, p11); |
| agufal | 4:a743917cd04c | 10 | |
| agufal | 9:3708b94b2312 | 11 | int main() { |
| agufal | 8:e7cafda76315 | 12 | |
| agufal | 9:3708b94b2312 | 13 | Acelerometro acc; |
| agufal | 9:3708b94b2312 | 14 | AccelService acc_service; |
| Alexisfdi | 3:80ceedd5ffac | 15 | |
| agufal | 9:3708b94b2312 | 16 | while(1) { |
| Alexisfdi | 3:80ceedd5ffac | 17 | |
| agufal | 4:a743917cd04c | 18 | pc.printf("-----------------------------------------\n"); |
| agufal | 8:e7cafda76315 | 19 | Vector v = acc.leer(); |
| agufal | 9:3708b94b2312 | 20 | acc_service.updateAccelState(v); |
| agufal | 8:e7cafda76315 | 21 | pc.printf(" X: %i\n Y: %i\n Z: %i\n", v.x, v.y, v.z); |
| agufal | 5:d5dba5370918 | 22 | |
| Alexisfdi | 3:80ceedd5ffac | 23 | } |
| agufal | 0:c123bc196680 | 24 | } |
