Comments: SparkFun Blocks for Intel® Edison - Pi Block
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
Can you guys help me out with connecting sensors with the pi block in python? (HC-SR04 and HMC5883L)
The HC-SR04 is actually very difficult (if not impossible) to control from the Edison directly, as the Edison relies on Linux for its OS, which means some of the precise timing for the SR04 will be missed and your readings will be way off (see more: https://communities.intel.com/thread/57376).
For the HMC5883L, you just need to communicate with it using I2C. There are some examples of using that sensor with Python here: https://github.com/rm-hull/hmc5883l.
If you need further assistance, I recommend reaching out to our tech support staff: https://www.sparkfun.com/technical_assistance.
There's a Fritzing diagram in the C++ Examples section of this tutorial, but I don't see the Pi Block in the Sparkfun Fritzing library. Am I just overlooking it?
You are correct in that the part is not in our Fritzing library. For this guide, I quickly hacked up a drawing of the Pi Block to work with Fritzing, but I never got around to making it fit to our library's standards. You are welcome to have it (link: https://cdn.sparkfun.com/assets/learn_tutorials/4/1/2/SparkFun_Block_for_Intel_Edison_-_Pi.fzpz), but note that the connections are misnamed, and the schematic/PCB outlines are incorrect.
Thanks!
In the LED breadboard circuit, I don't see what the blue jumper from the GP46 pin of the Pi Block connects to. There's nothing else connected on that side of row 9, as far as I can see.
The diagram has been fixed.
Oops! That's supposed to be connected to the next row over--the one attached to the switch. Thanks for pointing that out.
Is there an example anywhere of using a SPI device with this block?
SPI on edison is kind of borked (see primiano's comments in the edison community boards for some coloring https://communities.intel.com/message/315677 ) There are also other informative posts by folks who have worked to get DooM running on the Edison over an SPI display https://communities.intel.com/thread/57693
Yup! I put together a tutorial on using an LCD with the Edison and Pi Block. Keep in mind that, at least as of right now, Yocto release 2.1 for the Edison has an issue with SPI in that it's super slow. I know that Intel is working on making it faster for (hopefully) the next release.
I've got the MAX31855 hooked up, and am requiring jsupm_max31855. I see that the library is setting the chip select to low before the read, but I get a 0 for the temperature value. If I ground the CS pin manually right before I attempt a read, the Edison (through the Pi Block) reads the temperature fine. In the LCD tutorial it didn't look like you had to do anything special with the CS pin with the ILI9341 Module, is that correct?
The MAX31855 source: https://github.com/intel-iot-devkit/upm/blob/master/src/max31855/max31855.cxx
Update: I'm using the Adafruit MAX31855 breakout because Sparkfun's was on backorder at the time of my order. I saw this morning that it was back in stock so I ordered one and I'll see if it works any differently.
I didn't use the CS pin with the LCD, since it was the only device I had on the SPI bus. If the Edison's SPI library is having trouble setting CS in time, then I recommend grounding it manually like you said (i.e. set a GPIO pin to LOW before reading/writing on SPI).
Awesome, thanks @ShawnHymel . How slow is "super slow"? I'm trying to read from a MAX31855 breakout board. Do you think it will take several seconds to read the value?
No, you should be fine with reading sensor values. It took 20 seconds to refresh an entire LCD, but that was a lot of data to push out.
Thanks for the help.