Vinícius Alves
/
MenuLCD_copy
Então PARA...
menbed/menbedMenuParam.cpp@0:92357d1220f3, 2017-05-19 (annotated)
- Committer:
- ViniR
- Date:
- Fri May 19 13:07:52 2017 +0000
- Revision:
- 0:92357d1220f3
Ent?o PARA...
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ViniR | 0:92357d1220f3 | 1 | #include "mbed.h" |
ViniR | 0:92357d1220f3 | 2 | #include "include/menbedMenuParam.h" |
ViniR | 0:92357d1220f3 | 3 | #include <string> |
ViniR | 0:92357d1220f3 | 4 | |
ViniR | 0:92357d1220f3 | 5 | MenbedMenuParam::MenbedMenuParam ( |
ViniR | 0:92357d1220f3 | 6 | float (*initValFcn)(void), void (*finalValFcn)(float), |
ViniR | 0:92357d1220f3 | 7 | bool liveUpdate, float min, float max, |
ViniR | 0:92357d1220f3 | 8 | float inc) : |
ViniR | 0:92357d1220f3 | 9 | initValFcn(initValFcn), finalValFcn(finalValFcn), _liveUpdate(liveUpdate), |
ViniR | 0:92357d1220f3 | 10 | _min(min), _max(max), _inc(inc) |
ViniR | 0:92357d1220f3 | 11 | { |
ViniR | 0:92357d1220f3 | 12 | } |
ViniR | 0:92357d1220f3 | 13 | |
ViniR | 0:92357d1220f3 | 14 | |
ViniR | 0:92357d1220f3 | 15 | float MenbedMenuParam::getVal (void) |
ViniR | 0:92357d1220f3 | 16 | { |
ViniR | 0:92357d1220f3 | 17 | if (initValFcn == NULL) |
ViniR | 0:92357d1220f3 | 18 | return 0.0; |
ViniR | 0:92357d1220f3 | 19 | |
ViniR | 0:92357d1220f3 | 20 | return initValFcn(); |
ViniR | 0:92357d1220f3 | 21 | } |
ViniR | 0:92357d1220f3 | 22 | |
ViniR | 0:92357d1220f3 | 23 | void MenbedMenuParam::setVal (float v) |
ViniR | 0:92357d1220f3 | 24 | { |
ViniR | 0:92357d1220f3 | 25 | if (finalValFcn == NULL) |
ViniR | 0:92357d1220f3 | 26 | return; |
ViniR | 0:92357d1220f3 | 27 | |
ViniR | 0:92357d1220f3 | 28 | finalValFcn(v); |
ViniR | 0:92357d1220f3 | 29 | } |