I never did something I2C and wonder if it's possible to enable/disable the chip with a transistor?
The PCA9685 is running the sequence until you tell it to do something else even if the Arduino is not connected.
If you enable/disable a I2C device is it automatically then possible to talk to it or does it need something like initializing?
MrGlasspoole:
I never did something I2C and wonder if it's possible to enable/disable the chip with a transistor?
I'm not sure why you want to do that. If you want to, you can already control up to 62 PCA9685-chips (x16 pins), using I2C.
The PCA9685 is running the sequence until you tell it to do something else even if the Arduino is not connected.
The PCA9685 is just a dumb device. Without an Arduino telling what the next step in a sequence is, it won't continue the sequence.
If you enable/disable a I2C device is it automatically then possible to talk to it or does it need something like initializing?
You don't need to initialize anything, but need to configure each chip in hardware. Using I2C the Master (Arduino) sends commands to one slave using its specific address. According to the datasheet of your chip, you can choose from 62 addresses, which you can set using its address pins. I've never tried to connect 62 chips to the I2C-bus of an Arduino, but it should in theory be possible.
And something from the datasheet i don't get:What do they mean by source 10 mA at 5 V?
Every driver that is on takes 10mA through VDD or you can output 10mA on every driver?
Basically the voltage on an output pin of a 9685 is either 0 or.. 5v.
If you connect the cathode of a led (+resistor) to GND, the anode to an output pin and pull the output-pin high, it's called sourcing. You can however also connect the anode to 5v+, the cathode to an output pin and pull the output-pin low, which is called sinking.
In both cases the led will receive 5v, difference is that the chip can't handle as much power sourcing, as sinking.
Simpson_Jr:
I'm not sure why you want to do that. If you want to, you can already control up to 62 PCA9685-chips (x16 pins), using I2C.
The PCA9685 is just a dumb device. Without an Arduino telling what the next step in a sequence is, it won't continue the sequence.
Adafruit support says:
The PCA9685 is a 'free running' PWM controller. Tell it what to do, and it will keep doing that until you tell it to do something else. If you wanted to set the LEDs to a specific intensity and keep them there, you could disconnect the Arduino until you wanted the LEDs to do something else.
I'm not sure what you're trying to achieve or what your worry is. The device contains a number of pwm generators (similar to the arfuino itself) that drive outputs.
You're connecting LEDs and by setting a pwm value for an output you set the brightness of the LED. There is no sequence in that.
If you disconnect the device from the I2C bus (not from the power), it will remember the programmed values and the LEDs will stay at the last given brightness.
And if you disconeect the power, the device forgets everything.
If the sequence you're referring to is the sequence of the shooting star, that is not in the device but in the Arduino.
What that Adafruit advice is saying is that the chip doesn't need feeding constantly like some other chips like the TLC5940. Once you have set the brightness of the LEDs it drives those LEDs stay at the same brightness until you tell the chip to change the brightness.
There is no way that this chip can perform a sequence without the Arduino telling it every step every time.
Ok confusing but now i got it. I thought the sequence is saved in the PCA9685.
That 'free running' sounded like program it and disconnect it.
sterretje:
I'm not sure what you're trying to achieve or what your worry is.
I want to turn the shooting star completely off without the need to instruct the PCA9685 via I2C.
As i said i never did something I2C and can't estimate if on/off is complicated
The idea is to have ~3 different times to select from on the Arduino.
Shooting star every 2 minutes, every 4 minutes, every 6 minutes.
And then one button to trigger instantaneously.
MrGlasspoole:
I want to turn the shooting star completely off without the need to instruct the PCA9685 via I2C.
As i said i never did something I2C and can't estimate if on/off is complicated
There are three ways that I see to switch the LEDs off:
By programming the pwm values for each LED using the Arduino
Cut the power to the LEDs
Switch the power to the chip off
There is nothing I2C specific to this; it would be the same when you use the PWM outputs of the Arduino and e.g. a breadboard.
No, solution 3 means you have to re-initialize everything when you turn it back on. My call would be solution 1. Just set the PWM values to zero. I think the idle current with the LEDs turned off would be pretty inconsequential.