terahz / pca9685 Goto Github PK
View Code? Open in Web Editor NEWC/C++ Library for PCA9685
C/C++ Library for PCA9685
file PCA9685: func: void PCA9685::setPWM(uint8_t led, int on_value, int off_value) {
i2c->write_byte(LED0_ON_L + LED_MULTIPLYER * (led - 1), on_value & 0xFF);
i2c->write_byte(LED0_ON_H + LED_MULTIPLYER * (led - 1), on_value >> 8);
i2c->write_byte(LED0_OFF_L + LED_MULTIPLYER * (led - 1), off_value & 0xFF);
i2c->write_byte(LED0_OFF_H + LED_MULTIPLYER * (led - 1), off_value >> 8);
}
if (led==0) address = LED0_ON_L - LED_MULTIPLYER
its not led0 address
Could you conntect the A-pins straight to GND and the OE-pin straight to 5V(HIGH) if you use the libary and what is the default i2c address, because I haven't find the default address in the documentation.
When I want to initalize the Libary on my raspi i get this error:
error: expected identifier before numeric constant
PCA9685 dac(1,0x60);
Just cloned this repo and it doesn't build. I noticed that it was trying to include your "I2C.h" file in the PCA9685.h file so I cloned that and tried two things:
pi@raspberrypi2:~/MasterControl/PiLight/I2C/src$ make
g++ -O3 -fPIC -g -Wall -Werror -c -o I2C.o I2C.cpp
In file included from I2C.cpp:30:0:
/usr/include/linux/i2c-dev.h:37:8: error: redefinition of âstruct i2c_msgâ
In file included from I2C.cpp:29:0:
/usr/include/linux/i2c.h:67:8: error: previous definition of âstruct i2c_msgâ
In file included from I2C.cpp:30:0:
/usr/include/linux/i2c-dev.h:89:7: error: redefinition of âunion i2c_smbus_dataâ
In file included from I2C.cpp:29:0:
/usr/include/linux/i2c.h:125:7: error: previous definition of âunion i2c_smbus_dataâ
<builtin>: recipe for target 'I2C.o' failed
make: *** [I2C.o] Error 1
How was this meant to be used seeing as how nothing compiles?
It cannot find I2C.h when making, is there any way to build it? Cannot build neither, I2C on the other repo..
On the datasheet the min and max is 40hz to 1500hz not 40Mhz to 1500Mhz.
friend,
do you have the dll of this code so I can use it in C #? I do not handle anything in C ++.
Thankful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.