Quantcast
Channel: arm - openFrameworks
Viewing all articles
Browse latest Browse all 364

Help getting i2c, or specifically pca9685 servo HAT to work

$
0
0

@aaa wrote:

I’m using wiringpi, and so far I’ve had good luck with it.

I want more control over my servo (and to add more than one eventually) so I opted for this Pi attachment. I looked over the datasheet and I understand somewhat how to talk to it, but I can’t get anything to work. I also tried using a pca9685 library but it doesn’t seem to help my situation.

I’m just curious if anyone has had success with this before and if you have sage wisdom.

//fd = wiringPiI2CSetup(0x40);
  fd = pca9685Setup(300, 0x40, 50);

// i've tried writing a ton of different values to it...
  for (int i = 0; i < 180; i++) {
    ofLog() << i;
    //wiringPiI2CWriteReg16 (fd, 0x00, i);
    pwmWrite(316, (int)ofMap(i, 0, 180, 5, 25));


    ofSleepMillis(100);
  }

This library does work, and I can get the examples to run, though I can’t figure out how to integrate it into an OF project

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 364

Trending Articles