I am using analogRead() and Serial.Println() and I am getting expected values when I open the serial monitor every specified time interval. So my question is can I get these values to be displayed in Microsoft Excel?
There are a couple of ways to do that.
GoBetwino can do it : Gadgets og teknologi | Dansk Tech Blog - Mikmo. There is sample Arduino code with GoBetwino that shows how to send data from Arduino directly into cells in an Excell sheet. With GoBetwino you could also choose to send data to a CSV file, that could be opened with Excell.
And there used to be a shareware plugin for Excell that could read data from a serial port, i don't know if it works with the newer versions of Excell
also this might be usefull : http://dev.emcelettronica.com/serial-port-communication-excel-vba
That is extraordinarily helpful! Thank you. XD Next question: I have my arduino hooked up to my desktop and I need to take measurements outside. If I power the Arduino will it record these measurements so that I may hooked it back up to my PC and view them on excel?
For you to keep values, you'll need more memory. I'd get some serial EEPROM so the data gets stored even if the power gets turned off.
It depends on how much you want to store. There is 1K of EEPROM inside an arduino (328) so you could store over a thousand bytes before it is full.
Okay so I am using Gobetwino and I am trying to get my data to be sent to a file, hopefully excel. This is what I have:
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue1 = analogRead(A7);
Serial.println(sensorValue1,DEC);
delay(1000);
Serial.print("#S|LOGTEST|[SensorValue1]#");
}
Gobetwino tells me that "x not a well formed command string" where x is my current data reading that I want recorded. Any suggestions?
Never having used Gobetwino it is hard to say. But minimul research shows:-
GoBetwino is listening on the serial port, for "commands coming from Arduino, and in response it will do something for Arduino and possibly return something to Arduino.
In your code you send the data first and then a command, I think this is the wrong way round.
I am very new at this and I am still confused.. ![]()
So I am having trouble sending the analog readings from arduino to gobetwino properly. I am trying to use the example given by gobetwino:
void setup{
Serial.print("#S|LOGTEST|[");
Serial.print(itoa((value), buffer, 10));
Serial.println("]#");
}
However I don't understand itoa. for "value" I put the analog reading, but what do I put in place of "buffer" and "10"? The definition: char * itoa (int __val, char *__s, int __radix)
didn't help me much as I don't know what anything means. The goal is to create an excel file given my analog measurements. $)
I was able to solve the problem by defining
"char buffer[5] "
which I found from a similar project. However I have no idea what this means if someone could explain it that would be great! ![]()
One last question I have is if I upload my code to the arduino then unplug it and bring it outside to run an experiment(with a power supply of course) will it save all of my data? and will I be able to run Gobetwino to send the data directly to excel? Anything helps! BTW this is my first experiment and I am really excited about continuing working with this board!!
Basically, itoa is just converting your integer to a string which can be printed over the serial port. See here: http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/
If your arduino is not plugged into your computer, and you try to run serial, it won't work, and it won't magically save your data. Depending on how much data you want to save, you will have to use the eeprom ( http://www.arduino.cc/en/Reference/EEPROM ) an external eeprom, or an sd card, and then write a seperate program to read the data back to the computer over serial when it is plugged in.
The problem with using code like gobetwino is that you have little control over what it does. It will do only what the designer has programmed it to do.
In this case you send commands down the serial port and the software running on the PC reads these commands and does stuff. In your first code you posted you were just sending it a value not a command so the PC had no idea what to do with it and so reported an error. In the second code you posted you first send a command:-
Serial.print("#S|LOGTEST|[")
then you send the data
Serial.print(itoa((value), buffer, 10)); (by the way this looks wrong as I don't think this function has three arguments)
and then you tell the PC that is it I have finished sending data:-
Serial.println("]#");
Unless you write the arduino code to store data in non volatile memory and then some how to write it to the serial port when connected (maybe when a button is pushed) then it will just spill the readings into the sand if it is not connected to a PC.
I see thank you. I think that I will just keep my laptop outside while running the experiment as I have it working properly and there is no reason not to. XD
Hello all
I've not been on here for a few years.
I have used GoBetweeno very successfully with the Arduino.
When trying to use the BBC Micro Bit and GoBetwino to open Excel, I have the problem of:
The string recieved : #S|SPXL|[]# is not a well formed command string
This even happens when #S|SPXL|[]# is the only code that I've loaded onto the Micro Bit:
serial.writeLine("#S|SPXL|[]#")
basic.forever(() => {
})
I hope you can help (MikMo)
Thanks