I2C producer consumer pattern for MCP23008 and Arduino

20 views
Skip to first unread message

Stefan Stefan

unread,
Jan 24, 2016, 5:24:41 PM1/24/16
to Pi4J
Hi,

Can someone help me implement producer consumer pattern for i2c ?
Right now i am working on a project which includes a little meteo station and a controller for light controlled from web.
As technologies i use spring, angularJS and mysql.
My app has a scheduler witch is running at 4 seconds to get data from an arduino. Arduino provide temperatures. I put it at 4 seconds because it's getting 30 samples of data with a delay of 200ms between them and than it makes the average so in the end it takes 10 seconds between two final values for temperatures.
On i2c i also have an expander(MCP23008) for controlling relays.
The problem is sometimes raspberry doesn't send commands to expander because it's reading from arduino.
My project is hosted on github at: https://github.com/todo87/RaspberryPiWebApp


Reply all
Reply to author
Forward
0 new messages