Page 1 of 2
Re: 12bit PWMParabola?
Posted: Sat May 10, 2014 9:28 pm
by rimai
There is no support for the 16 channel on our libraries. You need custom code as I mentioned before.
AlanM has started this though:
http://forum.reefangel.com/viewtopic.ph ... 16+channel
Take a look at this code to see how to do it without the libraries integration:
http://forum.reefangel.com/viewtopic.ph ... ion#p38671
Re: 12bit PWMParabola?
Posted: Sat May 10, 2014 9:38 pm
by Meldrath
Thank you!
Any sneaky pitfalls I should be on the look out for when I add in the custom code?
Re: 12bit PWMParabola?
Posted: Sun May 11, 2014 4:57 pm
by Meldrath
Okay, I finally got my code to compile correctly using Kraven's library.
Code: Select all
int i = 0;
while (i < 100)
{
ReefAngel.PCA.SetAllChannelsPercent(i);
Serial.println(i);
i++;
}
while (i >= 0)
{
ReefAngel.PCA.SetAllChannelsPercent(i);
i--;
}
The problem is when I hook up my adafruit breakout chip to the i2c port on the relay, I get a steady blinking red light under status and it does not dim up/down like it should.
I have tried my best to diagnose the issue, but am failing to see what the issue is at the moment.
To verify: I did create my own usb to i2c cable, with the following configuration;
Black - Ground
Green - SDA
White - SCL
Red - VCC
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 7:49 am
by Meldrath
Shameless bump to figure this out. Any help from anyone would be appreciated.
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 7:59 am
by rimai
Did you try inverting the SDA/SCL wires?
It's something in the bus that is causing this.
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:03 am
by Meldrath
I did. The chip is set to 0x4e (I believe) so I set that in the globals and moved the PHProbe to a different address.
Could this be the source of the issue?
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:03 am
by rimai
Can you confirm the breakout board is working with another arduino board?
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:05 am
by Meldrath
Not readily available.
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:16 am
by rimai
The address won't be the issue.
If the status is blinking, it means your bus is locked.
So, I know it is something in that cable you've made or it is the breakout board/chip that is non-functional.
Burned out chips can cause this too.
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:25 am
by Meldrath
Is there a verify within reef angel or something to see if the chip is functional?
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 8:27 am
by rimai
Yes, there is a code called i2cscanner. If you search the forum, you will find it...
But it won't work in your case because the bus is locked.
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 1:58 pm
by Meldrath
I had a 2nd one, I wired it up, and ran the i2c scanner.
Code: Select all
I2CScanner ready!
starting scanning of I2C bus from 1 to 128...
addr: 1 addr: 2 addr: 3 addr: 4
addr: 5 addr: 6 addr: 7 addr: 8
addr: 9 addr: A addr: B addr: C
addr: D addr: E addr: F addr: 10
addr: 11 addr: 12 addr: 13 addr: 14
addr: 15 addr: 16 addr: 17 addr: 18
addr: 19 addr: 1A addr: 1B addr: 1C
addr: 1D addr: 1E addr: 1F addr: 20 found!
addr: 21 addr: 22 addr: 23 addr: 24
addr: 25 addr: 26 addr: 27 addr: 28
addr: 29 addr: 2A addr: 2B addr: 2C
addr: 2D addr: 2E addr: 2F addr: 30
addr: 31 addr: 32 addr: 33 addr: 34
addr: 35 addr: 36 addr: 37 addr: 38
addr: 39 addr: 3A addr: 3B addr: 3C
addr: 3D addr: 3E addr: 3F addr: 40
addr: 41 addr: 42 addr: 43 addr: 44
addr: 45 addr: 46 addr: 47 addr: 48
addr: 49 addr: 4A addr: 4B addr: 4C
addr: 4D addr: 4E addr: 4F addr: 50 found!
addr: 51 addr: 52 addr: 53 addr: 54 found!
addr: 55 addr: 56 addr: 57 addr: 58
addr: 59 addr: 5A addr: 5B addr: 5C
addr: 5D addr: 5E addr: 5F addr: 60
addr: 61 addr: 62 addr: 63 addr: 64
addr: 65 addr: 66 addr: 67 addr: 68 found!
addr: 69 addr: 6A addr: 6B addr: 6C
addr: 6D addr: 6E addr: 6F addr: 70 found!
addr: 71 addr: 72 addr: 73 addr: 74
addr: 75 addr: 76 addr: 77 addr: 78
addr: 79 addr: 7A addr: 7B addr: 7C
addr: 7D addr: 7E addr: 7F addr: 80 found!
I have globals.h set to this:
Code: Select all
// I2C Addresses
#define I2CPWM 0x08
#define I2CIO 0x09
#define I2CRF 0X10
#define I2CRA_Master 0x11
#define I2CRA_TouchDisplay 0x12
#define I2CTilt 0x1c
#define I2CExpander1 0x20
#define I2CExpander2 0x21
#define I2CIO_PCF8574 0x27
#define I2CExpModule 0x38 // 0x38-3f
#define I2CPWM_PCA9685EXP 0x54
#define I2CLeak 0X48
#define I2CMultiWaterLevel 0X49
#define I2CORP 0X4c
#define I2CSalinity 0X4d
#define I2CPH 0X4e
#define I2CWaterLevel 0X4f
#define I2CEEPROM1 0x50
#define I2CEEPROM2 0x5d
#define I2CHumidity 0x5c
#define I2CClock 0x68
My chip is set for 54 (which is the same as eeprom 2, which I set to 5d)
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 2:59 pm
by rimai
You need to change your chip to another address. You can't use one that is already in use
Sent from my SM-G900P using Tapatalk
Re: 12bit PWMParabola?
Posted: Tue May 13, 2014 3:43 pm
by Meldrath
Did that now, and it's still not working lol.