2

Typically, when I connect my Arduino to a slave device through I2C or SPI, I'll control the slave using instructions coded in the firmware. The output data will be then printed to the Serial port and I'll use Python or MATLAB to read from the serial port and process the data later on.

PC <- Arduino <--> Slave

Now say I want to control the I2C slave from my computer, i.e. write instructions to the I2C slave. How do I go about it? I thought of writing to the Arduino Serial port, making Arduino read it and hence configuring it but this doesn't seem efficient and I have been racking my head over this for a while.

6
  • why wouldn't that be efficient? You can put an interrupt on an incoming string. Commented Apr 28, 2017 at 15:09
  • 2
    That use of an Arduino as a 'format converter' to a peripheral from a computer is 'efficient' in the sense that you can use what you have to hand, do it quickly, expect it to work, and debug it easily if it doesn't. It's not efficient in the sense that there's an extra computer in the way, but, who cares?
    – Neil_UK
    Commented Apr 28, 2017 at 15:33
  • Reading the comments I have to agree with you guys. I like the idea of using an interrupt. I'll definitely check on that and I think that is the solution I might be looking for.
    – Mathews John
    Commented Apr 28, 2017 at 17:42
  • Welcome to Arduino SE. Be sure to take the tour to see how this works and to earn a badge: arduino.stackexchange.com/Tour
    – SDsolar
    Commented Apr 29, 2017 at 8:16
  • Have you looked into the pigpio library? Do a quick search, maybe?
    – SDsolar
    Commented Apr 29, 2017 at 8:16

1 Answer 1

1

Since you are using an arduino as a partial bridge to a PC, it appears that you already have a solution in hand.

There is a project on Git that is intended to perform this function that you could use for reference. (Disclaimer -- I have not tested this code.)

The cheapest stand alone device that I found was a $15 breakout board from Adafruit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.