Hi all, I'm working on a project where I'm making an array of panels with different knobs and buttons on each of them, which will be hot-swappable on I2C communication and all controlled by a master uno or mega.
I've chosen the attiny828 as it's large amount of analog pins and small price is perfect for most of the panels.
I bought some attiny85 chips just to test if my idea is feasible, however after many videos and tutorials i am unable to get the attiny85 chip to send information over I2C to an arduino uno, let alone reading a potentiometer's state and then sending it.
My question is: is it doable to use attiny chips (especially 828s) as I2C slaves in this way? Realistically, i only need to send 1-2 states of analog pins back at a time per panel. The master can handle all logic and processing of those states as far as I'm concerned. I just haven't seen attiny chips used in this larger and unique way often, so I'm having my doubts.
here's an example of one of the codes used for the attiny. I followed tutorials using arduino uno as an ISP for the chip and it went well as far as i could tell:
You realize the I2C protocol maximum wire length is measured in centimeters. Not in meters.
The protocol is designed for communication between devices on the same PCB.
The most distanced panel from the master will be shorter than a meter. I only chose I2C to continue with the idea because of its ability to use only 2 pins across several devices.
What about USB? Do attiny chips, along with minimal extra hardware, have the ability to communicate this way? It would solve the hot-swap issue and I could find some way to process the oncoming information on a computer, which an uno or a mega was going to do anyways.
Checking the Functionality of I2C Bus between UNO and ATtiny85 1. Build the following setup (Fig-1) between Arduino UNO and Digispark Attiny85 Dev Board using I2C Bus. Do not connect the wiper of Pot with (PB5)ADC0-pin of ATtiny85.
4. Press RESET Button of Arduino UNO. Check that the following message has appeared on SM1.
Slave is found.
5. Connect wiper of Pot with (PB5)ADC0-pin of ATtiny85. 6. Rotate the Pot and check that the following readings do appear on SM1.
Voltage received fromm Slave: 3.0
Voltage received fromm Slave: 3.0
Voltage received fromm Slave: 2.7
Voltage received fromm Slave: 3.9
Voltage received fromm Slave: 4.6
Voltage received fromm Slave: 4.9
Voltage received fromm Slave: 5.0
Yes, however I am only using 85s for testing, I will be switching to probably 828s for more analog pins. Trying to keep it affordable as I may have up to 20 of these panels.
The wire library doesn’t work on a raw attiny85. Will wireS or wireM work interchangeably?