Go to Post ChiefDelphi is talking about women's clothing. What a time to be alive. - Karibou [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-03-2012, 11:07
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

So I haven't forgotten about you. I've been playing with my Arduino Mega 2560 over the weekend. I got away from the LabVIEW Interface for Arduino because of its various glitches, speed, etc... The Arduino is actually really easy to program. I was told this many times, but I never really tried it out.

It has the power of C++ with the simplicity of the Basic STAMP from Parallax. There's tons of open source code and libraries available, so you can probably find a project where someone implemented an Arduino in a blimp.

As far as communication and control goes, you can still use LabVIEW. You'll have to develop your own communication protocol for it, but it shouldn't be too bad.

Some things to keep in mind. It's usually considered good practice to always include some type of a sync word, meaning that you have a number that increments with each packet of data you send. That way, if you detect a packet out of order (number sent was less than last packet), you'll trash it.

I've been using the BlueSMiRF RP-SMA. There's little configuration to get it working fairly well. I haven't found the max distance yet, but to note, this isn't FCC Legal, as they have changed the antenna configuration.

Quote:
Because we have changed the antenna configuration on the Bluetooth module, the FCC certification is no longer valid. But the module is completely suitable and legal for all home, hobby, and research applications.
I find the best way to send data is using a new line '\n' (ASCII DEC 10 or HEX 0xA) as the termination character. You can create an event driven while loop in LabVIEW using the termination character. On the Arduino side, you'll have the SerialEvent() function, which is triggered on a serial receive event. You can then check to see if the newline '\n' character was sent, and if it was, then process your data.

Here's the format I would use:

"[SYNC_WORD_32_BITS][MOTOR1_VALUE_8_BITS][MOTOR2_VALUE_8_BITS]...[MOTORN_VALUE_8_BITS][DIGITAL_OUTPUTS_GROUP_8_BITS]...[DIGITAL_OUTPUTS_8_BITS][CONTROL_WORD_FOR_SPECIAL_FUNCTIONS]\n"

For receiving back data, the format will be very similar. You'll have a sync word and sensor values. You'll want to look at an ASCII table, and you should note that sending over raw data values is a no-no for the BlueSMiRF unless you format it properly. You'll have data loss, as it doesn't pass through some values. If one of your sensors sends back a 10, then you'll trigger it to send the data. Try to convert all of your sensor values to ASCII text and ASCII number values. It uses more bandwidth, but it should still be relatively fast.

Let me know if you have any questions. The best way to get started with the Arduino is to just get started. Play with it, send numbers to it, try to echo back those numbers, then add numbers. Make an LED turn on when you send it a center character, and make it turn off if you send another one.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
  #2   Spotlight this post!  
Unread 06-03-2012, 18:10
DominickC DominickC is offline
Registered User
FRC #0023 (PNTA)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 1620
Location: Boston
Posts: 435
DominickC is an unknown quantity at this point
Re: Arduino using WPI library?

Gearing up for WPI, will have more time to invest into this project after.

I was planning on using the Ethernet shield to plug it into a router configured to act as an Access Point, and pump info to the Arduino via TCP/UDP. Will this suit my need?

I had my school pay for the Arduino, so I'm waiting on whenever they place the order in...unfortunately, nothing has come to my doorstep yet.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-03-2012, 22:55
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Arduino using WPI library?

Quote:
Originally Posted by DominickC View Post
Gearing up for WPI, will have more time to invest into this project after.

I was planning on using the Ethernet shield to plug it into a router configured to act as an Access Point, and pump info to the Arduino via TCP/UDP. Will this suit my need?

I had my school pay for the Arduino, so I'm waiting on whenever they place the order in...unfortunately, nothing has come to my doorstep yet.
I looked at the Ethernet shield library, and it all seemed pretty easy, but I never tried it.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote
Reply


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 22:09.

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