-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pinMode fails on PocketBeagle #182
Comments
As a try, I modified /usr/local/lib/node_modules/bonescript/src/bone.js as follows
Then tried again with following.
Now I do not have error, but digitalWrite high/low still does not work. Is this just with P1.02 of PB (other pins should be fine)? Anyway, the latest bonescript should be fine with the usage like below?
BTW, Looks like bonscript example using USR0, USR1, USR2, USR3 LEDs working find without modification on PB. |
The issue here is that "P1_2" is defined twice in bone.js. Once here and a second time here. The one found by Although it's a bit of a hack, the following code will set P1_2 on a PocketBeagle high for a fraction of a second. var b = require('bonescript');
b.pinMode("p8_29", b.OUTPUT);
b.digitalWrite("p8_29", b.HIGH);
b.digitalWrite("p8_29", b.LOW); If you're using an LED it may be necessary to set P1_2 high for a longer period of time in order to see the LED turn on: var b = require('bonescript');
b.pinMode("p8_29", b.OUTPUT);
b.digitalWrite("p8_29", b.HIGH);
setTimeout(function () {
b.digitalWrite("p8_29", b.LOW);
}, 1000); |
Thanks it did work. So I should be doing is to find corresponding BeagleBone pin number, and use it as the pin name to be passed to bonescript. What I am not sure is the numbers like GPIO87. Is it AM335x signal name or OSD335x name? PB schematics: P1.2 -> AN6/GPIO87 |
The bug that you detected only exists for P1_2 on the PocketBeagle. Unfortunately, P1_2 is defined twice in bone.js, it should only be defined once. For all other pins using Pn.m should function correctly on the PocketBeagle. The corresponding pin on the BeagleBone Black can be found the way you suggest.
The numbers like GPIO87 are required for Linux. They are Linux numbers. There are files in directory
I use the images here for the BeagleBone Black and the image here for the PocketBeagle. |
Hello.
I am using PocketBeagle.
I am trying gpio operation using BoneScript.
But, I get the following error when I try to set p1_2 gpio pin to output.
I tried other names as 'gpio_87', etc. but they also did not work.
Whereas, I have no such problem with config-pin command.
$ config-pin p1_2 output
$ config-pin p1_2 hi
$ config-pin p1_2 lo
...
i.e.
In comparison, using config-pin command on PocketBeagle, I can set p1_2 pin ho/low properly). But using bonescript I cannot.
The text was updated successfully, but these errors were encountered: