Thanks Jason,

I don't currently need javascript; I'm just exploring the examples. I may 
need it in the future for some things, TBD. :) 

> reset.js just contains this:
>
>  

> //# fekerr 20180227
> //# 
> https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual#221_PocketBone
>
> var b = require('bonescript');
>
> var LE = "P2_33" ; // GPIO45
> var SPI = "P2_25"; // MOSI
> var CLK = "P2_29"; // CLK
>
> var chip = [0, 0, 0, 0, 0, 0]; // 44 outputs, 5 1/2 chips
>
> // Configure pins as outputs
> b.pinMode(LE, b.OUTPUT);
> b.pinMode(SPI, b.OUTPUT);
> b.pinMode(CLK, b.OUTPUT);
>
> // initial states
> b.digitalWrite(LE, b.LOW);
> b.digitalWrite(SPI, b.LOW);
> b.digitalWrite(CLK, b.LOW);
>
> doUpdate();
>
> function doUpdate()
> {
>     var i;
>     b.digitalWrite(LE, b.LOW);
>     for(i=0; i<6; ++i)
>     {
>         b.shiftOut(SPI, CLK, b.MSBFIRST, chip[i]);
>     }
>     b.digitalWrite(LE, b.HIGH);
> }
>
>  
>
> debian@beaglebone:/usr/local/lib/node_modules/bonescript/src$ ls -rtl
total 232
-rw-r--r-- 1 debian debian  6000 Jan 12 21:11 socket_handlers.js
-rw-r--r-- 1 debian debian  2190 Jan 12 21:11 server.js
-rw-r--r-- 1 debian debian   680 Jan 12 21:11 serial.js
-rw-r--r-- 1 debian debian  1639 Jan 12 21:11 rc.js
-rw-r--r-- 1 debian debian  3777 Jan 12 21:11 parse.js
-rw-r--r-- 1 debian debian 17253 Jan 12 21:11 my.js
-rw-r--r-- 1 debian debian  1063 Jan 12 21:11 iic.js
-rw-r--r-- 1 debian debian  9873 Jan 12 21:11 hw_universal.js
-rw-r--r-- 1 debian debian  2940 Jan 12 21:11 hw_simulator.js
-rw-r--r-- 1 debian debian  6039 Jan 12 21:11 hw_oldkernel.js
-rw-r--r-- 1 debian debian 13019 Jan 12 21:11 hw_mainline.js
-rw-r--r-- 1 debian debian 14571 Jan 12 21:11 hw_capemgr.js
-rw-r--r-- 1 debian debian  4349 Jan 12 21:11 functions.js
-rw-r--r-- 1 debian debian 11980 Jan 12 21:11 eeprom.js
-rw-r--r-- 1 debian debian   393 Jan 12 21:11 constants.js
-rw-r--r-- 1 debian debian  4596 Jan 12 21:11 bonescript.js
-rw-r--r-- 1 debian debian 69177 Jan 12 21:11 bone.js
-rw-r--r-- 1 debian debian  4394 Jan 12 21:11 autorun.js
-rw-r--r-- 1 debian debian 19763 Feb 28 00:26 index.js

...

index.js, lines 1-5:
 // Copyright (C) 2011 - Texas Instruments, Jason Kridner
  2 //
  3 //
  4 var fs = require('fs');
  5 var child_process = require('child_process');
...
lines pi-hundred to 333:

         } else if(clock == 2) {
315             i++;
316             clock = 0;
317             f.digitalWrite(clockPin, g.LOW, next);
318         }
319     }
320 
321     if(callback) {
322         next();
323     } else {
324         for(i = 0; i < 8; i++) {
325 //fekerr 20180227            if(bitOrder == b.LSBFIRST) {
326             if(bitOrder == g.LSBFIRST) {
327                 bit = val & (1 << i);
328             } else {
329                 bit = val & (1 << (7 - i));
330             }
331 
332             if(bit) {
333                 f.digitalWrite(dataPin, g.HIGH);


-- 
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/fb99d181-0e09-4e0d-bfff-e1f4fa8ca065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to