My setup is as follows: there is a master Arduino Mega that has a range finder wired up to it. It takes the range values and sends them to a slave Arduino Uno. The Uno has an LCD housed on it, and the LCD is to display something based on the range values it receives. HOWEVER--the LCD display will not show things while data is being transmitted, and data won't transmit while the LCD is displaying things. (one thing happens somewhat randomly although i can sometimes switch the function by pressing reset on one Arduino).
Technically, these two things don't need to happen at the same time, but it would be nice. At the least I want to be able to switch between the two modes as I wish and store the value from the transmitting phase to use in the displaying phase. Please help!
Never call a writing method on the Serial object inside an interrupt service routine and receiveEvent is called in interrupt context. To make the serial interface work interrupts are necessary. Inside interrupt context other interrupts are blocked as an interrupt is handled. If one of your prints fills the serial buffer your Arduino will freeze and get back alive again only after you hit the reset button.
My setup is as follows: there is a master Arduino Mega that has a range finder wired up to it. It takes the range values and sends them to a slave Arduino Uno.
What's the reason to use two Arduinos? The Mega also seems to have the pins A0-A3 unused so you can attach the display there directly and you don't need the I2C interface for the communication between the two. Please explain.