1 .How does the Arduino yun hardware interface communicate with the GPIO of the yun
The Yun has two processors.
One processor is a System on a Chip (SoC) that runs the OpenWRT Linux -> and our node.js server.
A second processor is a MCU that runs the Arduino Code.
Both processors communicate via a serial Interface.
The GPIO’s are connected with the MCU so that you can program them with the Arduino IDE.
The Arduino Library communicates with the server (runing on the SoC) to add new I/O points and send data for these points back and forth.
In the case of a raspberry pi , there is only one processor so to create an interface for the pi , we would have to create a library similar to the arduino hybrid object library for sending and receiving data , as well as the interface code for gpio, ?
Hi, @valentin,
Can I setup HIGH or LOW to a pin, says PIN 12, in Arduino and read the status of the PIN 12 in server.js?
Yes you can!
Use digital read and write to read/write the values and then send it to the server
You can setup the pins in the setup() of arduino sketch as usual
Hi, @V_Mohammed_Ibrahim,
Thanks.
I know there is a way to issue command from Linux to Arduino via bridge.
In my case, the bridge function is disabled, so I would like to know if there something like,
fs.writeFile(“/sys/devices/platform/leds-gpio/leds/ds:green:usb/brightness”, 0, “utf8”, function () {});
to read write all digital PINs status from server.js.
However, I only see the path of led-gpio. I did not find the paths of other digital PINs.
Do you have any idea?
Ivan
@ivanlin i have seen this similar code for blinking the onboard green LED to indicate that the server is working,
you might find something helpful if you check out the /sys/class/gpio
for the linino processor , i haven’t tried anything with it yet