10 Replies Latest reply on Feb 3, 2015 1:07 PM by Intel_Alvarado

    Using PWM on any port reboot the board

    zzarbi

      Hi,

       

      I'm new to this platform, at first I was perplexed to why so much power but now that I can develop in Node JS Instead of C, I'm pretty grateful.

       

      I've been trying to use with Cylon.Js to manipulate two continuous-servos, here my sample code:

      var Cylon = require('cylon');

       

      Cylon.robot({

        connections: {

          edison: { adaptor: 'intel-iot' }

        },

       

        devices: {

          mLeft: {driver:'servo', pin: 3},

          mRight: {driver:'servo', pin: 6}

        },

       

        work: function(my) {

            var stop = function(){

                    my.mLeft.angle(85);

                    my.mRight.angle(83);

                };

       

            my.mLeft.angle(180);

            my.mRight.angle(0);

           

            setTimeout(function(){

                stop();

            }, 1000);

        }

      }).start();

      Sometime when I run this, the servos would be going the way I want and stop normally, but right after the board crash and reboot by itself.

      Some other time, it will crash and reboot before the servos move.

       

      I also tried to implement this CPP example upm/hcsr04.cxx at master · intel-iot-devkit/upm · GitHub with Node JS:

      var mraa = require('mraa'),

          hcsr = require('jsupm_hcsr04'),

          interrup = function interrupt () {

              sonar.ackEdgeDetected();

          },

          sonar = new hcsr.HCSR04(12, 13, interrup);

       

       

      setInterval(function(){

          console.log("Distance: "+sonar.getDistance());

      }, 1000);

       

      Which crash and reboot the board.

       

      Is there a way somewhere I can get some log of why the board crashes? I think it's related to Pulse signal but I might be wrong. Any help would be appreciated.