In the cloud9 ide I'm working on the bonescript shiftout
<http://beagleboard.org/support/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.
<https://lh3.googleusercontent.com/-RXJdoAswfIU/WWaj9dL28nI/AAAAAAAABO0/x3j6C4RLfzMJGx3O4EOkVwRXYGgXr-FuACLcBGAs/s1600/DS1Z_QuickPrint7.png>
in the shiftOut documentation I read;
Return value
- true <http://beagleboard.org/Support/BoneScript/#true> if successful
- false <http://beagleboard.org/Support/BoneScript/#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
<https://github.com/jadonk/bonescript/blob/master/src/index.js> which
contains the shiftOut.js
<https://github.com/jadonk/bonescript/blob/master/src/index.js#L284-L340>
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?
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/3a6024c2-2f9b-46c1-89eb-6278bcff25c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.