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: sgam_mdw sgam_mdw_NUCLEOF429ZI_impl Cayenne-LPP
main.cpp@21:1a2ecd140da8, 2019-07-11 (annotated)
- Committer:
- AndersonIctus
- Date:
- Thu Jul 11 22:39:47 2019 -0300
- Revision:
- 21:1a2ecd140da8
- Parent:
- 18:b6197f50dce6
- Child:
- 22:b69940ec3452
Revis?o anulada: 8ec6bdff6f67
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| AndersonIctus | 12:2109a8bc8848 | 1 | // #define DEBUG_SGAM |
| AndersonIctus | 0:5d86284beacd | 2 | |
| AndersonIctus | 12:2109a8bc8848 | 3 | #include "mbed.h" |
| AndersonIctus | 7:cabeef41022a | 4 | #include "sgam_mdw.h" |
| AndersonIctus | 10:cb7a807b5225 | 5 | |
| AndersonIctus | 7:cabeef41022a | 6 | #include "ControlImpl.h" |
| AndersonIctus | 7:cabeef41022a | 7 | #include "Gyroscope.h" |
| AndersonIctus | 7:cabeef41022a | 8 | |
| AndersonIctus | 7:cabeef41022a | 9 | ControlImpl ctrl; |
| AndersonIctus | 7:cabeef41022a | 10 | |
| AndersonIctus | 12:2109a8bc8848 | 11 | #define D_LOG(args...) printf(args) |
| AndersonIctus | 12:2109a8bc8848 | 12 | |
| AndersonIctus | 0:5d86284beacd | 13 | int main() { |
| AndersonIctus | 12:2109a8bc8848 | 14 | D_LOG("=============== INICIO ===============\r\n"); |
| AndersonIctus | 7:cabeef41022a | 15 | |
| AndersonIctus | 7:cabeef41022a | 16 | Control* control = ctrl.getControler(); |
| AndersonIctus | 12:2109a8bc8848 | 17 | control->initialize(); |
| AndersonIctus | 7:cabeef41022a | 18 | |
| AndersonIctus | 21:1a2ecd140da8 | 19 | int count = 0; |
| AndersonIctus | 10:cb7a807b5225 | 20 | |
| AndersonIctus | 21:1a2ecd140da8 | 21 | Sensor<float>* temp = (Sensor<float>*) control->getSensor("Temperature"); |
| AndersonIctus | 21:1a2ecd140da8 | 22 | // Sensor<GyroscopeData>* gyro = (Sensor<GyroscopeData>*) control->getSensor("Gyroscope"); |
| AndersonIctus | 21:1a2ecd140da8 | 23 | |
| AndersonIctus | 21:1a2ecd140da8 | 24 | while( count++ < 10) { |
| AndersonIctus | 21:1a2ecd140da8 | 25 | float* f = temp->getValue(); |
| AndersonIctus | 21:1a2ecd140da8 | 26 | D_LOG("Temperatura => %f \r\n", *f); |
| AndersonIctus | 18:b6197f50dce6 | 27 | |
| AndersonIctus | 21:1a2ecd140da8 | 28 | // GyroscopeData* data = gyro->getValue(); |
| AndersonIctus | 21:1a2ecd140da8 | 29 | // D_LOG("Gyro (X) => %d \r\n", data->gx); |
| AndersonIctus | 21:1a2ecd140da8 | 30 | // D_LOG("Gyro (Y) => %d \r\n", data->gy); |
| AndersonIctus | 21:1a2ecd140da8 | 31 | // D_LOG("Gyro (Z) => %d \r\n", data->gz); |
| AndersonIctus | 21:1a2ecd140da8 | 32 | // D_LOG("***********************************\r\n"); |
| AndersonIctus | 7:cabeef41022a | 33 | |
| AndersonIctus | 21:1a2ecd140da8 | 34 | wait(1.5); |
| AndersonIctus | 21:1a2ecd140da8 | 35 | } |
| AndersonIctus | 7:cabeef41022a | 36 | |
| AndersonIctus | 10:cb7a807b5225 | 37 | control->finalize(); |
| AndersonIctus | 12:2109a8bc8848 | 38 | D_LOG("=============== FINAL ===============\r\n"); |
| AndersonIctus | 7:cabeef41022a | 39 | return 1; |
| AndersonIctus | 0:5d86284beacd | 40 | } |