i am not sure but i think buried somewhere in the BBB service reference manual
( i think that is the right name ) it mentions something that made me think,
there is only one A/D converter and the other inputs are multiplexed. Another
thing to check might be the pin you are trying to use maybe already used by
some other device or service. I am using an LCD 7 which consumes four of the
A/D inputs.
hope that helps !
On Thursday, September 24, 2015 4:17 PM, 'Don Terry' via BeagleBoard
<[email protected]> wrote:
#yiv2740866424 p {margin-bottom:0.1in;line-height:120%;}I have
searchedBeagleBoard forums for this answer but only found single A/Dresponses.
Since I already have a single A/D channel working this wasno help.
I am trying to readtwo analog pins but I get the following error message: var r
=binding.read(fd, buffer, offset, length, position); ^Error: EAGAIN,resource
temporarily unavailable atObject.fs.readSync (fs.js:481:19)
atObject.fs.readFileSync (fs.js:315:28)
atObject.exports.readAIN(/usr/local/lib/node_modules/bonescript/hw_capemgr.js:214:30)
atObject.f.analogRead(/usr/local/lib/node_modules/bonescript/index.js:229:15)
The code below isfrom the 'fade' demo example. I can read either one at a time
butwhen both are in the loop the error occurs after a while. Is the ADCstill
busy when the second analogRead occurs?
Linux beaglebone3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l
GNU/LinuxBeagleBone Black rev00C0 running BoneScript 0.2.4
var b =require('bonescript');
// setup startingconditionsvar awValue = 0.01;var awDirection = 1;var awPin =
"P9_14";var AnaloginputPin ="P9_38";var MyTargetVoltage= 0;var
PWMAnalogVoltage= "P9_36";var PWMAnalogVoltVal= 0;var Analogvalue = 0;
// configure pin b.pinMode(awPin,b.ANALOG_OUTPUT);
// call function toupdate brightness every 10mssetInterval(fade,100);
// function toupdate brightnessfunction fade() {b.analogWrite(awPin, awValue);
awValue = awValue +(awDirection*0.01); Analogvalue
=b.analogRead(AnaloginputPin); MyTargetVoltage =Analogvalue *
1.803;console.log(MyTargetVoltage); PWMAnalogVoltVal
=b.analogRead(PWMAnalogVoltage) * 1.803;console.log(PWMAnalogVoltVal);
if(awValue >1.0) { awValue = 1.0; awDirection = -1; } else if(awValue <=0.01) {
awValue = 0.01; awDirection = 1; }}
output is
0.203338333333333340.442736666666666670.185308333333333320.442736666666666670.196326666666666650.4417350.181301666666666640.442736666666666670.233388333333333340.4417350.221368333333333330.442736666666666670.19332166666666664…
until error message
Thanks
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.