|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
I2C bytes to Arduino in LV?
We want to send data to an Arduino via I2C in LabVIEW. We have the Arduino side worked out. We don't know how to send the bits and bytes to the Arduino in LabVIEW. We want to send three bytes or registers (if that is the correct terminology) that:
Register 1 - select The LED group number (1-12). Register 2 - A function code. Here's a list: DIM, FLASH, MODULATE, FLASHMOD Register 3 - data, For the functions (how fast to dim, how quick to flash etc.). I was hoping to find an example of someone talking to an Arduino (or similar board) via the FRC breakout I2C. And yes we could just use the I/O on the breakout for the LEDs but we want to learn I2C for the future. |
|
#2
|
|||
|
|||
|
Re: I2C bytes to Arduino in LV?
It may help to look at the examples that cover I2C. You can get there by choosing the Help menu then Find Examples, or from the Getting Started window/Support.
I suspect most of them focus on reading from sensors, but I didn't look too closely. Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: I2C bytes to Arduino in LV?
Hence the issue. I think if I do figure it out I might put up a white paper or something on how to use I2C in LV since there doesn't seem to be any tutorial for sending. If that's something people would want to see.
|
|
#4
|
||||
|
||||
|
Re: I2C bytes to Arduino in LV?
Go to www.bitbuilttech.com. On the bottom is a link to the LV software package that we use to communicate with the Insight LT display over I2C. You should be able to easily dissect the VI and see how we send text via the protocol. As long as you know the message structure the Arduino expects, it should be straightforward.
|
|
#6
|
|||
|
|||
|
Re: I2C bytes to Arduino in LV?
I'm afraid these examples quoted here do not apply to FRC.
|
|
#7
|
|||
|
|||
|
Re: I2C bytes to Arduino in LV?
Quote:
The "register" control on the write VI simply refers to the first byte to send. The data array is any additional bytes you wish to send. I assume you have already found the I2C palette in WPILib. If you have a specific problem I'll be glad to help. |
|
#8
|
||||
|
||||
|
Re: I2C bytes to Arduino in LV?
Quote:
PS Also is the devise address on the I2C Open the address of the receiver? |
|
#9
|
|||
|
|||
|
Re: I2C bytes to Arduino in LV?
Quote:
In the first example it looks like you would send either [1,1] or [1], so two bytes or one byte in each transaction. Quote:
I would also recommend that you try it out and print out what you get on the Arduino side to help you better grasp how the API works. You can also just open up the VIs to see what they do to some extent. Cheers, -Joe |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|