I just got back from my Thailand, Cambodia, Laos and Vietnam trip. I was there for a couple of months and as a result of traveling and no income I did not pay my hosting company, and this site went down. Astonishingly a few of you were actually interested in the projects I am working on, especially regarding Arduino and LabVIEW.

Well the site is back online and I hope to start working on some of these projects soon. Best of luck with all of your own work, and please let me know if you make any progress with Breakfast.

EggShell is an interactive Arduino environment allowing for real-time programming and interaction with any Arduino running the *Breakfast (Serial for Arduino) firmware. Puns.

By real-time, I mean you can execute commands one by one such as: digitalWrite, analogRead and millis, observing the outcome as you type. But the real power of EggShell is in its meaty Ruby underpinnings. Yes, the real power of EggShell is seen when taking full advantage of the Interactive Ruby (IRB), which EggShell is built upon.

Here is an example: (Note: This requires an LED to be attached to pin 11)

1: EggShell: 2 >> pinMode(11,OUTPUT)

2: Pin 11 set as OUTPUT.

3: EggShell: 3 >> def blinky(time)

4: EggShell: 4 1>> digitalWrite(11,HIGH)

5: EggShell: 5 1>> sleep(time)

6: EggShell: 6 1>> digitalWrite(11,LOW)

7: EggShell: 7 1>> sleep(time)

8: EggShell: 8 1>> end

9: EggShell: 9 >> 5.times{blinky(1)}

The play by play: First pin 11 is defined as an output using the standard Arduino function pinMode. Lines 3 through 8 define a function called ‘blinky’ that takes one input parameter ‘time’. The function sets pin 11 HIGH, pauses for ‘time’ then sets pin 11 LOW, again pausing for ‘time’. The ‘def’ and ‘end’ keywords are used by Ruby to determine the beginning and end of the function definition. Line 9 executes the function ‘blinky(1)’ 5 times. Passing ‘1’ to the ‘blinky’ function will cause a 1 second delay between HIGH and LOW states.

 

This software is still beta and chalked full of bugs, the os x version should work out of the box, whereas the linux and windows version may require to you install the RXTX Java libraries separately. I was having difficulty bundling the jnilib.

Download here: code.inhocsignovinces.net

I’ve been experimenting more with LabVIEW and Arduino as of late, and should be releasing a beta for a LabVIEW Virtual Instrument for Arduino, code-named DAQduino. My goal for now will be to use the Breakfast firmware along with the Arduino to create a fully functional Data Aquasition (DAQ) system; enclosing everything along with a DC power supply and a large breadboard. I’m especially excited about this because most DAQs are terribly expensive.

I hope for the DAQduino to offer an affordable opensource solution for this necessary tool.

I release Breakfast this evening. It is available for download here.

Breakfast is a firmware which runs on the Arduino allowing all of its functions to be accessed by a computer over a serial connection. I have implemented most Arduino functions ver batim, and I do plan on adding the rest soon. For now I have written a ruby “library” which allows you to access Breakfast, as a proof of concept, I have implemented an Arduino Shell using this library and Interactive Ruby IRB. Check back, as I will be posting updates and tutorials here.

*Note, the software is still beta, please let me know if you find any bugs or have any comments/questions.

In an effort to bridge the communication gap between my Arduino and my computer, I decided to play around with Firmata v2. I wanted to at least start understanding how to receive serial data on a computer. This will eventually help with the goal of creating a LabVIEW Arduino driver.

So, I did some reading, searched the google, and searched the Arduino site/bb. Read pretty much “all” the documented information on sending serial information from the Arduino to a computer. I concluded that using Firmata was my best bet, mainly because it was slightly more documented, proclaimed to be the fastest (115200 bitrate) and because I didn’t want to start from the ground up.

The initial step was to play around with the Firmata examples; they are included with the Arduino software for our convenience. I looked at them, loaded some of them to my Arduino, only to f

ind out that… they didn’t really explain much. Additionally, one of the only tutorials on the subject I found, addressed linking Arduino con Firmata to Processing, I went over this tutorial, but it was very “cookbook” and didn’t explain much in terms of what was going on, especially if you wanted to abstract it, and do some developing with the system on your own.

I decided to write a piece of software which would read data from the serial port, and use Firmata’s code-set, which happens to be MIDI based, to decipher the incoming data.

The result is this crude ruby script. (I just picked up learning ruby, so please ignore the horrible syntax, and roundabout procedures)

Download: firmataAnalogMonitor.rb

 

rubyfirmata

I used nCurses to create a simple terminal display; it shows the appropriate 0 to 1023 analogRead from the Arduino, the next column showing the value in millivolts. In order for this to work, you need the nCurses library and the serial library for ruby.  The script assumes the Arduino is running the simpleAnalogFirmata, a sketch example bundled with the Arduino software.

Note: If an analog pin is not grounded or being fed any current it floats quite a bit.

For a first Arduino project I decided to experiment with linking the microcontroller with National Instrument’s LabVIEW –free for students- I feel like this project will teach me something about both the Arduino and LabVIEW, both of which I am new to.

The goals of this project are changing daily. My initial idea will be to create a program that runs on the Arduino and allows for the sending and receiving of data from each of the Arduino’s I/O pins. The result would be a computer-to-realworld interface, meaning programs could be written in LabVIEW and use the Arduino to interface with… the realworld. The pitfall of the implementation, you must have a computer running LabVIEW constantly connected to the Arduino, albeit it could be wireless, you would still need a computer running the LabVIEW program. The second way to marry LabVIEW and Arduino would allow for programs to be written/drawn in LabVIEW, and then uploaded to the Arduino to be executed. I’m slightly weary as to what the purpose of this might be; I feel that programs in LabVIEW could always be outputted in C and then with some work pushed into the Arduino using the native software. I’m not really sure what benefits you would gain, except for faster prototyping for those who are unfamiliar/uncomfortable/unlearnt with text-based programming. The benefit of being able to program in LabVIEW and then upload to the Arduino, would be an increase in it’s user friendliness, opening up to a greater group of people. Lego did this with the NXT, which interfaces natively with LabVIEW.

Until now, this is all thinking in the brain, but when I actually start some work with the hands, I will post it here. If you have any ideas, or would like to collaborate please let me know.

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!