Someone please help (I2C)

Hi,

I wish to code a program of a master and a slave with I2C.

Procedure(step by step)

  1. Master - light up LED on pin 13
  2. Master- sent a 'R' input data to slave
  3. Slave- receive the data and light up LED on pin 12
  4. Slave- Once light up, sent 'S' input data back to Master
    5)Master- receive the data and switch off LED on pin 13
  5. Master- Once LED is off, sent a "P" input data back to slave
  6. Slave- receive the data and light up LED on pin 10 for 3 seconds and than switch off LED on pin 12 and pin 10
  7. Slave- once done it will sent a "L" input data back to the Master
  8. Master- received the data and light up LED on pin 13
    10)Master- sent a "B" input data to slave
  9. Slave- receive the data and switch on LED on pin 11
  10. Slave-Once LED is light up, sent 'S' input data back to Master
    13)Master- receive the data and switch off LED on pin 13
  11. Master- Once LED is off, sent a "P" input data back to slave
  12. Slave- receive the data and light up LED on pin 10 for 3 seconds and than switch off LED on pin 12 and pin 10
  13. program end

i know its a bit long, may i know how to code this program and if it is possible to code it using I2C.

Question before answering yours: are you trying to communicate between 2 arduinos?

you can use I2C between the 2 in any case to do that your program want to do.

If you have any coding skills using arduino IDE, please give it a go and write the code urself! :slight_smile:

We'll be happy to debug it for you if you still have probs.

When do we have to complete our assignment?