...
MCP3008 Pin | Rasp Pi Signal | TestBoard Pin (see Test+Board+BB Line) |
---|
VDD | +3.3V+3.3V Power Rail | | VREF | +3.3V+3.3V Power Rail | | AGND | GNDGND Power Rail | | CLK | SCLK | 47 | DOUT | MISO | 49 | DIN | MOSI | 51 | CS /SHDN | CE0 | 48 | DGND | GNDGND Power Rail | |
| Image Removed Image Added
| |
CH<number> pins get connected to the AnalogOUT of the analog circuits
Analog Circuits
Force-sensitive Resistor
Image Added
Image Removed
Photocell
Image Removed
Image Added
Potentiometer (Variable Resistor)
Image Removed
Image Added
Running SPI Sample
First build the dio-spi.jar file: Then copy ../../build/jar/dio-spi.jar to the board. | (On the Pi/iMX6) For this example you should have SPIDevice entry in your dio.properties file like this example for the raspberry pi: 12 = deviceType: spibus.SPIDevice, name:SPI_Slave, deviceNumber: 0 , address: 0 , csActive: 1 , wordLength: 8 , clockFrequency: 500000 , clockMode: 1 , bitOrdering: 1
|
Note that these are the current values in the repo which reflect a recent update. Older dio.peprties versions will not work. sudo $JAVA_HOME/bin/java -Djava.library.path=. -Djava.security.policy=./java.policy -classpath .:./dio.jar:dio-samples.jar:dio-spi.jar -Djdk.dio.registry=./dio.properties -Ddeviceaccess.uart.prefix=/dev/ttyAMA dio.spi.MCP3008Sample 12 4 |
Note that "12" is the device manager ID number of the SPIDevice in the example property line shown above. "4" selects the channel on the MPC3008. You should use the channel number connected to the analog circuit you're trying to read. |