Go to Post I wonder if the GDC had his extraordinary achievements in mind for the 2012 game. - MagiChau [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-10-2013, 14:29
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 422
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
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.
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
  #2   Spotlight this post!  
Unread 16-10-2013, 09:45
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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   Spotlight this post!  
Unread 16-10-2013, 10:29
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 422
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: I2C bytes to Arduino in LV?

Quote:
Originally Posted by Greg McKaskle View Post
I suspect most of them focus on reading from sensors, but I didn't look too closely.
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.
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
  #4   Spotlight this post!  
Unread 16-10-2013, 10:43
trilogy2826's Avatar
trilogy2826 trilogy2826 is offline
Mentor - 2826
AKA: Jake Fischer
FRC #2826 (Wave Robotics)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2006
Location: Oshkosh, WI
Posts: 113
trilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond repute
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.
  #5   Spotlight this post!  
Unread 16-10-2013, 14:57
Redo91's Avatar
Redo91 Redo91 is offline
Registered User
AKA: Justin
no team
Team Role: Engineer
 
Join Date: Dec 2006
Rookie Year: 2006
Location: Carlsbad
Posts: 149
Redo91 is a glorious beacon of lightRedo91 is a glorious beacon of lightRedo91 is a glorious beacon of lightRedo91 is a glorious beacon of lightRedo91 is a glorious beacon of lightRedo91 is a glorious beacon of light
Re: I2C bytes to Arduino in LV?

Found these on NI's website.

A short intro to I2C here.

Implementing I2C in LabVIEW here.
__________________
Team 1296-Full Metal Jackets
Alumni 2009
Mentor 2009-2014

Team 624-CRyptonite
Mentor 2014-2015
  #6   Spotlight this post!  
Unread 17-10-2013, 01:31
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C bytes to Arduino in LV?

Quote:
Originally Posted by Redo91 View Post
Found these on NI's website.

A short intro to I2C here.

Implementing I2C in LabVIEW here.
I'm afraid these examples quoted here do not apply to FRC.
  #7   Spotlight this post!  
Unread 17-10-2013, 01:34
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: I2C bytes to Arduino in LV?

Quote:
Originally Posted by jman4747 View Post
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.
It should be as simple as using the I2C open in Begin and then the I2C write in teleop or wherever you want to send the data.

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   Spotlight this post!  
Unread 17-10-2013, 10:38
jman4747's Avatar
jman4747 jman4747 is offline
Just building robots
AKA: Josh
FRC #4080 (Team Reboot)
Team Role: CAD
 
Join Date: Apr 2013
Rookie Year: 2011
Location: Atlanta GA
Posts: 422
jman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond reputejman4747 has a reputation beyond repute
Re: I2C bytes to Arduino in LV?

Quote:
Originally Posted by jhersh View Post
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.
So if I only want to send one byte at a time I only define the register? Or do you mean the first byte I send in my code period is that register, and any following bytes need to be under data to send (Witch screen shot would be correct)?

PS Also is the devise address on the I2C Open the address of the receiver?
Attached Thumbnails
Click image for larger version

Name:	I2C 1.JPG
Views:	277
Size:	22.8 KB
ID:	15316  Click image for larger version

Name:	I2C 2.JPG
Views:	186
Size:	20.4 KB
ID:	15317  
__________________
---------------------
Alumni, CAD Designer, machinist, and Mentor: FRC Team #4080

Mentor: Rookie FTC Team "EVE" #10458, FRC Team "Drewbotics" #5812

#banthebag
#RIBMEATS
#1620
  #9   Spotlight this post!  
Unread 17-10-2013, 15:04
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: I2C bytes to Arduino in LV?

Quote:
Originally Posted by jman4747 View Post
So if I only want to send one byte at a time I only define the register? Or do you mean the first byte I send in my code period is that register, and any following bytes need to be under data to send (Witch screen shot would be correct)?
If you want to send only one byte in the transaction to your Arduino, you would used the second example you posted. It would send either 2 or 0.

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:
Originally Posted by jman4747 View Post
PS Also is the devise address on the I2C Open the address of the receiver?
Yes. The Device address is the 7-bit address of your Arduino device on the I2C bus.


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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi