projects
/
contrib
/
mraa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
aio.c: added normalized read returning a float in a 0.0-1.0 range
[contrib/mraa.git]
/
api
/
mraa
/
aio.hpp
diff --git
a/api/mraa/aio.hpp
b/api/mraa/aio.hpp
index
27c6a64
..
d061f9a
100644
(file)
--- a/
api/mraa/aio.hpp
+++ b/
api/mraa/aio.hpp
@@
-66,6
+66,14
@@
class Aio {
return mraa_aio_read(m_aio);
}
/**
return mraa_aio_read(m_aio);
}
/**
+ * Read a value from the AIO pin and return it as a normalized float.
+ *
+ * @returns The current input voltage as a normalized float (0.0f-1.0f)
+ */
+ float readFloat() {
+ return mraa_aio_read_float(m_aio);
+ }
+ /**
* Set the bit value which mraa will shift the raw reading
* from the ADC to. I.e. 10bits
* @param bits the bits the return from read should be i.e 10
* Set the bit value which mraa will shift the raw reading
* from the ADC to. I.e. 10bits
* @param bits the bits the return from read should be i.e 10