Uncaught InternalError: Timeout on ADC #354
Replies: 8 comments
-
Posted at 2015-04-09 by @gfwilliams Ahh, that's frustrating. It's because you're using an analog input while the Waveform is also trying to use it. I'll file a bug for that and will try and fix it. Right now your best solution would be to just forget about the analogVRef and hard-code the voltage:
Either that or work it out beforehand:
Or... you could not use the double-buffer but instead just use a single buffer that stops reading when it is full:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-09 by @allObjects ...where is the n in line 6 come from / defined? - I assumed this is the buffer size... (see example in post). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-09 by @allObjects @gordon, are you saying there is a lower limit for the sampling/output rate in WafeForm? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-10 by @gfwilliams Yes, looks like n needs to change, but that's not the issue here. It's not that waveform has a lower limit, it's that it is using the adc in the background. If you use it and then access the adc with analogRead, occasionally they may try and use it at the same time, and you'll have problems |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-10 by @allObjects #ADC #conflict
Espruino has 3 ADCs... does the user have control over which ADC is mapped to which port?... or from your wording: is only one ADC available to Javascript? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-10 by @gfwilliams I think there are only 2 ADCs? But yes, only one ADC is available. While switching to ADC2 for Waveform would be a simple fix, unfortunately the F401 in the Pico only has 1 ADC, so I need to come up with a fix that works for both. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-10 by d0773d @gordon I was playing around with waveform and I see two major improvements: the IDE is still responsive and the code seems to run quicker than my original temp code. Thank you for the help and the recommendation to use waveform :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-10 by @gfwilliams No problem! Glad it helped :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-04-09 by d0773d
I am receiving this error and don't know why or how to fix this:
Code:
Console output:
Beta Was this translation helpful? Give feedback.
All reactions