Please forgive my lack of proper terminology, as I'm mostly self-taught and am new to Arduino.
I formerly had my robot project wired from a Raspberry Pi into a PicAxe via I2C. While I'm not "forced" into this method, I prefer I2C in case I want to connect more boards. The Pic was the only board I worked with until a couple basic tutorials/exercised with the Arduino recently.
While I have the I2C working with the Arduino and RPi now, and can send I2C from the Arduino (slave) to the RPi (Master), I can only find how to write to the line. I used to be able to read/write to the PicAxe's "Scratchpad" different values.
My old code, to send let's say send a sensor value from the PicAxe (a Basic derivative) was:
readadc 0, b7
put 7, b7
...which I would read in Python on the RPi, loosely with:
def read(register):
data = bus.read_byte_data(address, register, value)
return dataIRR = StringVar()
IRR.set("IR="+(str(read(1))))
Now, I know this is an Arduino Forum, so I'm not looking for help with my Python code... I'm needing to change boards because it's my understanding Arduino can multithread... I need to be able to have the Arduino listen if "b1" changes (controlled by the RPi), while sending sensor data back to the RPi.
With only sending "to the line" without any identifiers, I won't be able to program a directional control while getting sensor readings. Can anyone please help me out on how this works for the Arduino, or what it's called at least? Thanks!