Moving the i2c and SPI physical pin location on Beaglebone Black - beagleboneblack

I have found descriptions on how to use the GPIO on Beaglebone, but what I am looking for is how to re-assign the pinout of P8 and P9.
I want to assign the SPI to a different pin set to what it already is. I wish to group the PWM's in one area, (as they are currently spread all over the board) and I wish to assign the I2C bus to a different pinset. any ideas?
Thanks Phil

That's not possible. Each pin may have multiple modes that you can enable but that set of modes is fixed for each pin and you can't move them around arbitrarily.

Related

Is it possible to use beaglebone (black) analog pins as GPIOs?

Analog pins of arduino boards can be used as GPIO but is it also possible for the beaglebone boards ? Especially the black model.
And if it is possible, how to do it ?
Please refer to e.g. the BBB SRM (System Reference Manual), specifically: 7.1.2 Connector P9 or "Table 13. Expansion Header P9 Pinout" in the PDF version.
tl;dr: no
Please also note that those pins only tolerate up to 1.8V. Applying any higher voltage will destroy the ADC and possibly affect the whole chip.

Why is NodeMCU triggering gpio in reverse when using Lua?

When using Lua and the GPIO module with my NodeMCU, my the high and low values are occurring in reverse.
I downloaded my build from NodeMCU custom builds: Link
To turn on the blue LED on the ESP8266, normally you set GPIO pin 0 to high. What's happening for me is I have to set it to low.
This is what I'm executing in the serial console to light up the blue LED:
gpio.write(0, gpio.LOW)
If I take this pin and directly connect it to ground, it also lights up the blue LED which I believe is correct.
What's causing my low and high values to be read incorrectly in NodeMCU?
This is normal - the on-board LED turns on with a LOW value and turns off with a HIGH value.
I've programmed these both in Lua and Arduino and the on-board LED works the same way.
Try attaching a regular LED to the same pin. You'll notice that it's inverse -- it will turn on with a HIGH value and off with a LOW value.
HIGH means the pin is set to supply voltage (it is "sourcing" voltage) and LOW means it is set to 0V (it is "sinking" voltage).
Assuming this board is wired like most of them, this is the rough schematic of the LED (note that "0" in gpio.write refers to GPIO16 hardware pin per the diagram here):
Diagram of the GPIO16 pin
You can see the diode is "pointing" in the direction that current should flow through it for the diode to light, which is "towards" GPIO16. So to get current to flow you need to set GPIO16 to LOW (0V) so there is a voltage difference. Otherwise both sides of the diode are at 3.3V and no current flows.

BBB: GPIO signal won't stay high

So I have a BeagleBone Black board, and I want to be able to set some GPIO pin from a low value to a high value.
For achieving this I'm using the BlackLib1 library (a C++ library that offers general access to all beaglebone's pins).
That library haves a class called BlackGPIO that offers the functionality that I want.
BlackLib::BlackGPIO NSLP_pin(BlackLib::GPIO_61, BlackLib::output, BlackLib::SecureMode);
auto NSLP_pinMode = NSLP_pin.getValue();
NSLP_pin.setValue(BlackLib::low);
I expect that this lines of code will set the signal from a low value to a high one (the signal is low by default).
The problem is that the signal goes high only for about ~10ms (measured on a scope), and after that it goes low again.
What I do wrong?
How can I set the some GPIO pin at a certain value, and remain like that until I change it?
[1] link
The link specifies to export the BBB pins from command line and to set it HIGH or LOW. You can develop a small C++ function to send those commands to kernel to export, ON/OFF the BBB pins. I'm using the same method in my C application and it works perfect.
Example code snippet in C to Enable the pin:
FILE *GPIO;
GPIO = fopen("/sys/class/gpio/gpio65/direction", "w");
fseek(GPIO,0,SEEK_SET);
fprintf(GPIO,"61");
fflush(GPIO);
fclose(GPIO);

How to build inhouse map navigation for iOS application?

I have a requirement mentioned below:
Already have a floor plan map image
First detect current location on floor
Then select the destination location using floor plan map image
Now application should provide direction & distance for that source to destination path
This is like how google direction works, but its in-house map require.
For example,
- Current position of user is: At his desk
- Where is Meeting Room #11
- So application should provide direction and distance updates on the map/floor plan image.
Any kind of suggestions/help would be great.
Thanks in advance
Couple of points...
You could create various audio files and play them as way points based on routing. Same principal as 'turn right at the next light'.
Definitely want to set your accuracy to: kCLLocationAccuracyBest. But this will still probably only get you accuracy of around +/- 10 meters at best.
Do a floor plan overlay using MapOverlayView.
If you are indoor, iPhone uses cell towers or WIFI for a location fix. This might be a problem for you because if you are looking to map multiple floors, only GPS can give you altitude readings - ground floor, second floor, etc...
I don't want to pour cold water on your idea but I have not heard of anyone successfully doing an indoor navigation app on an iPhone using standard stuff. If you really wanted to move forward on this project, your best accuracy might be using indoor bluetooth transmitters as navigational beacons...?
What you want is path-planing in the map, is that? If so, there is lot of algoritms you can use. You can choose a block size based on your map and resolution needs, divide de map into this, amd mark each block as navegable or not. Then getting from the first block trying in the direction of the destionation block, check if the neighboor block is blocked or not, and get going, until you reach (or not, if its not reacheable) the destination block.
Thats a pseudo-implementation, you have some option to do it, if I understand your needs.
(I dont know your hardware as said by others, with simple GPS and indoor navigation, assuming a 15m resolution is a good balance between optimistic/pesimistc signal, If its for robot-navigation, its not a goos approach in the GPS terms, but the algorimt is).

Is it possible to use 1 wifi access point to locate android mobile or would i need 3 to triangulate?

I'm working on a project but i want to try if i can locate my position using 1 wifi access point because i only have 1 at home, or would i need to go somewhere where there are atleast 3?
It depends on how accurate you need the reading to be. A typical wi-fi point will have a range of something like 30m indoors or 90m outdoors.
So, if you can actually locate the wi-fi point perfectly and you don't need better than 90m resolution (although, technically, that's probably an up-to-180m error), one should be fine.
If you need more resolution, the more points you can get (assuming of course the points aren't sitting on top of one another in a rack or something) should allow you to refine your position.
It is like xyz coordinate system. With one Wifi AP you will know the distance from the AP but not the direction. With two wifi APs you will know the location within a 2d plane (only the positive plane). You will need a third wifi AP for the 3rd dimension.

Resources