![]() |
I2C with Arduino
I'm having some trouble communicating with the Arduino over I2C.
We're planning to use it for LED strips, since almost all our PWM slots are taken. But most examples I find online use Java, not Python. Is there any way to easily write a string over I2C? For example, writing something like "rgb,10,0,255" would turn on the RGB strip. |
Re: I2C with Arduino
Quote:
|
Re: I2C with Arduino
Here.
Quote:
|
Re: I2C with Arduino
First part, should be pretty straightforward.
Code:
wire = wpilib.I2C(wpilib.I2C.Port.kOnBoard, 4)Code:
wire.transaction(b'go', 0)It's weird that the java code isn't trying to receive any data (maybe writeBulk is more appropriate?). |
Re: I2C with Arduino
Thanks, works great! In case anyone else stumbles across this, here's the code I used:
Code:
import wpilibCode:
#include <Wire.h> |
Re: I2C with Arduino
Awesome, I like how much shorter it is than the Java version:
|
| All times are GMT -5. The time now is 19:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi