In the cloud9 ide I’m working on the bonescript shiftout on a BBB
`
jeffa@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-03-19
jeffa@beaglebone:~$ uname -a
Linux beaglebone 4.4.54-ti-r93 #1 SMP Fri Mar 17 13:08:22 UTC 2017 armv7l GNU/Linux
jeffa@beaglebone:~$
`
The shiftOut.js is not working for me. To verify that I hooked up the pins correctly I made a quick test program to toggle the four lines. Yup square wave on all four.
`
while (true) {
b.digitalWrite(sData, b.LOW);
b.digitalWrite(sClock, b.LOW);
b.digitalWrite(sLatch, b.LOW);
b.digitalWrite(sClear, b.LOW);
b.digitalWrite(sData, b.HIGH);
b.digitalWrite(sClock, b.HIGH);
b.digitalWrite(sLatch, b.HIGH);
b.digitalWrite(sClear, b.HIGH);
}
`
I’m only seeing the sClear P9_15 toggle with the shiftOut.js example and that pin is not used in the shiftOut.js function call. It really just could be wired high in the schematic as it’s never used other than to set it high during initialization. I’m not seeing any clock or serial in.
in the shiftOut documentation I read;
Return value- true if successful
- false on failure
callback(x)- x.err: error status message
I attempt to check the return value ;
`
var isShiftOutSuccessful = false;
// […]
// b.shiftOut(sData, sClock, b.MSBFIRST, segments[digit], doLatch);
isShiftOutSuccessful = b.shiftOut(sData, sClock, b.MSBFIRST, segments[digit], doLatch);
`
Setting breakpoints before the b.shiftOut I verify that isShiftOutSuccessful is boolean and false. I step over and isShiftOutSuccessful is now unDefined. Is this a valid way for my code to see the return value? Or do I need some fancy Dan callback fu? I briefly looked at the shiftOut source and don’t see how anything is being returned anyway… ???
I decide to attempt to debug step in to the shiftOut.js however I get an error
`
Could not open file: /usr/local/lib/node_modules/bonescript/src/index.js
The file could not be found on the file system.
`
Yet the file exists.
`
jeffa@beaglebone:~$ ll /usr/local/lib/node_modules/bonescript/src/index.js
-rw-r–r-- 1 debian debian 19675 Mar 1 08:41 /usr/local/lib/node_modules/bonescript/src/index.js
jeffa@beaglebone:~$
`
However it only has a few lines in it relative to this index.js on github which contains the shiftOut.js
I figure it’s time to ask for help.
-
What’s (maybe) wrong with my shiftOut testing?
-
How can I setup cloud9 so I could step in to shiftout for continued debugging?