Hallo
I am writing here beacause i have problem with my program. I am debuging in 
cloud9 ide. Program is running through few seconds, they works, but later i 
have this error. "timers.js:103
            if (!process.listeners('uncaughtException').length) throw e;" . Can 
anyone help me.

> var b = require('bonescript');
>
> var k = 63;    
>
> var  f = 174.5;     
>
> var  re = 130;
>
> var  rf = 119.5;
>
> var sqrt3 = Math.sqrt(3);
>
> var sin120 = sqrt3/2.0;   
>
> var cos120 = -0.5;        
>
> var duty_min = 0.1250;
>
> b.pinMode('P9_14', b.OUTPUT);
>
> b.pinMode('P9_14', b.OUTPUT);
>
> b.pinMode('P9_14', b.OUTPUT);
>
> check();
>
> function check(){
>
> var analogone =(120*b.analogRead('P9_40')-60).toFixed(2);
>
> var analogtwo =(120*b.analogRead('P9_39')-60).toFixed(2);
>
> var analogthree =(80*b.analogRead('P9_38')-180).toFixed(2);
>
> console.log([analogone,analogtwo,analogthree]);
>
> calcinverse(analogone,analogtwo,analogthree);
>
> }
>
> function updateDuty(thetaone,thetatwo,thetathree) {
>
>     var duty_cycleone = (thetaone*(-0.0006944))+duty_min;
>
>     var duty_cycletwo = (thetatwo*(-0.0006944)) + duty_min;
>
>     var duty_cyclethree = (thetathree*(-0.0006944)) + duty_min;
>
>     b.analogWrite('P9_14', duty_cycleone, 60);
>
>     b.analogWrite('P9_21', duty_cycletwo, 60);
>
>     b.analogWrite('P8_13', duty_cyclethree, 60);
>
>     console.log([duty_cycleone,duty_cycletwo,duty_cyclethree]);
>
>     check();
>
> }
>
> function theta(x0,y0,z0)
>
> {
>
>     var y1 = (-0.5) * 0.57735 * f;
>
>     var y2 = y0 - (0.5 * 0.57735 * k);
>
>     var  a = (x0*x0 + y2*y2 + z0*z0 +rf*rf - re*re - y1*y1)/(2*z0);
>
>     var b = (y1-y2)/z0;
>
>     var d = -(a+b*y1)*(a+b*y1)+rf*(b*b*rf+rf); 
>
>      if (d.value < 0)
>
>      {
>
>     return;
>
>      }
>
>      var yj = (y1 - a*b - Math.sqrt(d))/(b*b + 1);
>
>      var zj = a + b*yj;
>
>      var h;
>
>      if (yj>y1)
>
>      {
>
>       h=180;
>
>      }
>
>      else
>
>      {
>
>      h=0;
>
>      }    
>
>    var thetaa = (180.0*Math.atan(-zj/(y1 - yj))/Math.PI)+h ;
>
>    return thetaa;
>
> }  
>
>     function calcinverse(x0, y0, z0)
>
>     {
>
>      var thetaone =theta(x0,y0,z0);
>
>      var thetatwo= theta(x0*cos120 + y0*sin120, y0*cos120-x0*sin120, z0);
>
>      var thetathree= theta(x0*cos120 - y0*sin120, y0*cos120+x0*sin120, z0);
>
>      console.log([thetaone,thetatwo,thetathree]);
>
>      updateDuty(thetaone,thetatwo,thetathree);
>
>  }
>
>                                                                       ^"

-- 
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/groups/opt_out.

Reply via email to