Hi all
I have setup the master slave on 2 uno's and this works fine using the example code on here
I have setup a single uno to run a stepper to turn the turntable and another to read a 4x4 keypad
all these work as expected - based on modified code examples on here
The bit I am struggling with is which chip sends or receives ie which is master and which is slave
Obviously the turntable doesn't move until I enter a number(code) on the keypad, except for the original setup to find a starting position, which runs on first power up of the chips, this is setup and working on the stepper uno.
below is what I envisage as to how it works
on power up startup routine runs to reset turntable to a predefined starting position then power down the stepper (set all outputs low)
then
1, wait until a code is entered into the keypad uno
2, if code number is valid send to stepper uno, else goto 1
3, stepper uno receives code and moves turntable to desired position
4, wait x time for turntable to be emptied then power down the stepper (set all outputs low)
4, clear all entries and goto 1
so until a valid code is input nothing happens, so how do I notify either uno that a code is due to be sent
does the master (stepper uno) wait for the slave (keypad uno) to send it the code or does the master run the keypad and send the keypad number to the stepper. Examples on here all have the master requesting a code from the slave, which doesn't fit with what I am doing, or am I miss-reading the way i2c works?
any help appreciated as I'd like to use the keypad uno to send codes to other arduino boards to control more accessories e.g. to point and signal settings