analogRead() and PuckJS #1625
Replies: 5 comments
-
Posted at 2022-09-06 by @gfwilliams I'm not 100% sure I understand the question? For single reads, analogRead is easiest. For multiple reads you could use Waveform and I think that should be slightly faster. You can also configure the nRF52 hardware to just take readings automatically which is probably the fastest - see https://www.espruino.com/NRF52LL#read-a-buffer-of-data-from-the-adc |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-06 by @MaBecker
Should NRF.sleep() be called if accurate analogRead() are required?
Ok, have to look into that module |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-06 by @gfwilliams
It may help - I haven't really done any tests. But the NRF52LL module will give you a lot of options - for instance taking slower readings for higher quality - that Espruino doesn't usually expose |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-12 by @MaBecker first test with the NRF52LL module
Is the result a 16 bit signed integer and presenting a -32767 to +32767 digital value ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-09-13 by @gfwilliams
Yes... although the value you get is 14 bits usually (depending on how you configure it). It's a bit odd that you get negative values, but it does happen when you're measuring a value near 0v (it sometimes happens with analogRead too) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-09-05 by @MaBecker
Is analogRead(pin) the quickest way and how accurate is this?
Does switching of NRF improve reads?
Beta Was this translation helpful? Give feedback.
All reactions