No response from PCA9685 using NODEMCU - Whats wrong with my code? #6063
Replies: 1 comment
-
Posted at 2019-01-04 by @MaBecker Hi @jameslouiz with the Espruino implementation for ESP8266 you can use I2C1, which is a c-code implementation of a I2C master
Maybe you like to check some modules using i2c to get a better understanding for I2C on this page. You can also try the Espruino servo motor module . Posted at 2019-01-04 by jameslouiz Thanks for your reply @MaBecker, but when I use I2C1, I get a strange "NO ACK" error. Also, could the following be incorrect in any way? Posted at 2019-01-05 by @MaBecker You should try one of these i2c device scanner to be sure about your wires and pullup resistors are ok. If the list does not show your device, start checking used pins and cable. Or maybe you are just using the wrong address ;-) Posted at 2019-01-05 by jameslouiz @MaBecker thanks again. I used the last example on that page and it returned Posted at 2019-01-05 by jameslouiz I get I2CWrite: No ACK 0 when trying Posted at 2019-01-05 by jameslouiz I've tried some code @gfwilliams posted a few weeks ago but don't seem to be having any luck with that either :/
Posted at 2019-01-05 by @MaBecker each number is a i2c address of a device. Looks like you have two devices attached to this bus, a device with address 64 and another with 112. Use this address as first parameter for writeTo and readFrom. The code above is using Espruino i2c software solution and is talking to a device address 0x40 which is 64 decimal. Looks like you are not using this.read() eg in line 48 and this.write() eg in line 53 in the code. changing this in all lines might solve the issue. Posted at 2019-01-06 by jameslouiz My I2C instance is currently using 0x40 (64) for the address but I'm not sure what address I should use for channel 0 in the Posted at 2019-01-06 by @MaBecker this is what I mean sample for line 48 var data = this.i2c.readFrom(C.PCA9685_MODE1, 1); to var data = this.read(C.PCA9685_MODE1, 1); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-01-04 by jameslouiz
Hi all, I have no idea how to get my PCA9685 to respond to any kind of input from my NODEMCU ESP-12E. I know both boards work as I've already tried with a program written in C.
For now, all I'm trying to do is make a single servo move on channel 0, here is my code. You might notice its pretty much just the Adafruit library with a few modifications. Nothing seems to happen with the servo :/
Beta Was this translation helpful? Give feedback.
All reactions