This is just a basic example of sending the arduino’s 6 analogue readings to a bar graph sketch made with processing. If you would like to use the more advanced graph, you can have a look at this newer source code, which allows you to draw much more advanced graphs from the arduino.

]]>https://boolscott.wordpress.com/2010/02/04/arduino-processing-analogue-bar-graph-2/feed/24boolscottFullscreen capture 20120730 075126 PMGobetwino: Arduino talking to Excelhttps://boolscott.wordpress.com/2009/12/24/gobetwino-arduino-talking-to-excel/
https://boolscott.wordpress.com/2009/12/24/gobetwino-arduino-talking-to-excel/#commentsThu, 24 Dec 2009 16:33:54 +0000http://boolscott.wordpress.com/?p=122Continue reading →]]>Gobetwino is pretty easy use. The Arduino can now send words to the serial port and Gobetwino takes them as commands and does handy stuff like create csv’s send email etc. I’ve tested out this program by making the Arduino log the voltage of a discharging capacitor and send the details to Gobetwino to make a csv for Excel.

Circuitry

Log discharging capacitor, use FET's instead of BJT's if you want to avoid 0.6V drop

// precision is a number from 0 to 6 indicating the desired decimial places

// example: printDouble( 3.1415, 2);

// prints 3.14 (two decimal places)Serial.print (int(val));

//prints the int partif( precision > 0) { Serial.print(".");

// print the decimal point

unsignedlong frac; unsignedlong mult = 1;

byte padding = precision -1; while(precision--) mult *=10;

if(val >= 0)

frac = (val - int(val)) * mult;

else frac = (int(val)- val ) * mult;

unsignedlong frac1 = frac;

while( frac1 /= 10 ) padding--;

while( padding--) Serial.print("0");

Serial.print(frac,DEC) ; } }

void wait_until_pin_3_is_pressed() {

while( !digitalRead(2) ){ }

while( digitalRead(2) ){ }

}

How Gobetwino works

Before trying to use this program you should read the Gobetwino pdf. You basically have to open Gobetwino and create a command to handle .txt files. I did this by opening Gobetwino and creating a LOGTEST command to open log.txt

Click on the Commands menu

Selecting LGFIL (Log File command)

Select the file location of an existing .txt file (data.txt in this case)

Now when the Arduino serially prints LOGTEST a .txt file is opened.

Serial.print("#S|LOGTEST|[A,B,C]#");

#s tells Gobetwino to pay attention

|LOGTEST| is the command I created with Gobetwino to open data.txt

[A,B,C] are variables printed to the file

# tells Gobetwino to stop paying attention

Summary

Upload the code to the Arduino

Create the LOGTEST command with Gobetwino

Press the button on your circuit (capacitor discharges)

I then import the .txt with excel and create the following graph

The voltage of the discharging capacitor

Notice the capacitor doesn’t fully discharging because I used BJT’s instead of FET’s.