Skip to content

Commit 9220c13

Browse files
author
Deng Bo
committed
BBB has 12‐bit ADCs (2^12 = 4,096), meaning a value between 0 and 2^12 − 1 (0 to 4,095), read() should return the raw value devide by 4095.
1 parent d1e8dc1 commit 9220c13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/py_adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static PyObject *py_read(PyObject *self, PyObject *args)
8686
}
8787

8888
//scale modifier
89-
value = value / 1800.0;
89+
value = value / 4095.0;
9090

9191
py_value = Py_BuildValue("f", value);
9292

0 commit comments

Comments
 (0)