pwm-exp i2c addres[RESOLVED]
-
I need to change i2c addres for pwm-exp. Default addres 0x5a. My device's addres is 0x40.
I clone i2c-exp-driver from Github.
In filei2c-exp-driver/include/pwm-exp.h
I change define PWM_I2C_DEVICE_ADDR from 0x5a to 0x40.
And make project.
Fromi2c-exp-driver/bin
I move pwm-exp file to/usr/sbin
.
I start pwm-exp in verbose mode:# pwm-exp -v -i > Initializing PWM Expansion chip > Generating PWM signal with 0.00% duty cycle (0.00% delay) onion-i2c:: Writing to device 0x5a: addr = 0xfa, data = 0x00 (data size: 1) onion-i2c:: Writing to device 0x5a: addr = 0xfb, data = 0x00 (data size: 1) onion-i2c:: Writing to device 0x5a: addr = 0xfc, data = 0x00 (data size: 1) onion-i2c:: Writing to device 0x5a: addr = 0xfd, data = 0x10 (data size: 1) onion-i2c:: Writing to device 0x5a: addr = 0x01, data = 0x04 (data size: 1) onion-i2c:: Writing to device 0x5a: addr = 0x00, data = 0x01 (data size: 1) onion-i2c:: Reading 1 byte from device 0x5a: addr = 0x00 read 1 byte, value: 0xff onion-i2c:: Writing to device 0x5a: addr = 0x00, data = 0xef (data size: 1) onion-i2c:: Reading 1 byte from device 0x5a: addr = 0x00 read 1 byte, value: 0xff onion-i2c:: Writing to device 0x5a: addr = 0x00, data = 0xff (data size: 1)
Why addres not changed? Why addres is 0x5a???
I delete old pwm-exp file from/usr/sbin
and write new file. It is not work.
-
I know.
I copy and change file libonionpwmexp.so fromi2c-exp-driver/lib
to/usr/lib/
.
And dont forget reboot.