sqefqsdf
Dependencies: C12832 EthernetInterface LM75B mbed-rtos mbed
Fork of app-board-LM75B by
Potentiometer.cpp@6:77a4c45f6416, 2017-03-23 (annotated)
- Committer:
- gimohd
- Date:
- Thu Mar 23 12:51:27 2017 +0000
- Revision:
- 6:77a4c45f6416
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gimohd | 6:77a4c45f6416 | 1 | #include "Potentiometer.h" |
gimohd | 6:77a4c45f6416 | 2 | |
gimohd | 6:77a4c45f6416 | 3 | |
gimohd | 6:77a4c45f6416 | 4 | Potentiometer::Potentiometer(PinName pin) :AnalogIn(pin) |
gimohd | 6:77a4c45f6416 | 5 | { |
gimohd | 6:77a4c45f6416 | 6 | |
gimohd | 6:77a4c45f6416 | 7 | } |
gimohd | 6:77a4c45f6416 | 8 | |
gimohd | 6:77a4c45f6416 | 9 | uint8_t Potentiometer::readValue() |
gimohd | 6:77a4c45f6416 | 10 | { |
gimohd | 6:77a4c45f6416 | 11 | float value = this->read(); |
gimohd | 6:77a4c45f6416 | 12 | return (uint8_t) 255*value; |
gimohd | 6:77a4c45f6416 | 13 | } |
gimohd | 6:77a4c45f6416 | 14 |