Although the hardware setup and software examples on Sensitronics web site shows 5-consecutive GPIO pins, I'm not sure that they have to be consecutive.
If I am looking at the right thing (here) then the code actually treats all 5-Pins as discrete pins, and I see nothing that treats them as a bus (consecutive pins).
Therefore I think it should be a reasonably straighforward job to map the pins to any convenient Edison GPIO pins.
If I am looking at the wrong code, then it may be a different story.
** CORRECTION ***
I see in their shift code that they are using math on pins numbers!
digitalWrite(PIN_MUX_INHIBIT_0 + current_enabled_mux, LOW);
so I don't think this would work on Edison - but all you'd have to do is re-write that function to use logic rather than math to get the name of the next pin.
Some thing like....
if (current_enabled_mux == 0)
else if (current_enabled_mux == 1)
Thankyou for your quick reply!
So if i map the pins over from what they are on the arduino to what they relate to on the edison, they should work regardless of them not being consecutive?
Yes that seems right to change them to logic, in your code you set them both to low? Would it not have to be set to high, then to low?
As far as I can see, the only reason they need to be consecutive is so they can do the math on the pin numbers.
If you change to using logic to select a pin then I don't see any reason why they should be consecutive.
You may well be right about the high/low - I didn't examine the code too carefully, but it seems that you know what you are doing! :-)
Hello again, i was wondering if you would be able to help me again, i managed to get the code working but i was meant with a constat stream of 0's in my serial monitor. After tracking everything back and running a few tests ive narrowed it down to one cable, A0.
I put an ossiliscope on the cable and i can see the analog readings being sent to the edison but nothing in the serial monitor, for testin purposes i opened up the analog read example and ran that with an arduino uno and it brought back results no problem. I ran the same code on the edison using GP44 which maps to A0 and i get 0's asif its not reading what is coming through.
do you have any advice or knowledge on this? does the edison need telling its an analog pin and not a GPIO?
Thanks again, lewis.
This message was posted on behalf of Intel Corporation
I tested the AnalogReadSerial example in the Intel Edison Kit for Arduino* since I don’t have access to the SparkFun Block for Intel® Edison – GPIO. I followed this basic guide http://www.intel.com/content/www/us/en/support/boards-and-kits/000006276.html and didn’t experience any issues. As you can check, an unmodified AnalogReadSerial is used, which means that there is no need to tell the Edison that A0 is an analog pin and not a GPIO.
I’m assuming the issue might be related to the GPIO block, have you check this link that discusses the recommended console communication block and how to use the GPIO Block as an input device: https://learn.sparkfun.com/tutorials/sparkfun-blocks-for-intel-edison---gpio-block?_ga=2.176152418.1738329009.1496171127-222343974.1481842962?
Since I can’t reproduce the issue, I’ll recommend you to post your inquiry in SparkFun’s forum (https://forum.sparkfun.com/) or contact their technical support team (https://www.sparkfun.com/support).
Have a nice day.