Pages: [1]   Go Down
Author Topic: Cross-platform reading of a text file into Arduino  (Read 446 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, quick background, I'm just capable enough on Arduino to get myself into trouble, and used to program Visual Basic, but it's been a good 10-15 years or so.

I'm trying to find the simplest cross-platform (Mac and Windows) way to have a plain text file with, say, eight strings, separated by line breaks or commas, and send those to an Arduino over USB to be stored as variables in EEPROM so that they're non-volatile.

Is there a way to do this in a browser, or some other simple cross-platform way? I would love to be able to just have a web page that you could type in the eight values, connect the Arduino, and hit a button to upload those to the Arduino.

The idea is that I'd program my little Arduino beast to send a different serial message out (MIDI, actually) when a different button on it is pressed, and I want to provide an easy way for the end user to program their own messages for it, ideally with minimal configuration on their end.

Possible, or pipe dream?

Thanks,
Andy
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Certainly doable.

I personally would attack the problem by making the input/store program run on the arduino, so that the only application needed by the host is a terminal application.  That way it would even be configurable with a VT100 terminal, if you happen to have one of those around. (:

-j

Logged

Grenoble/Lyon - France
Offline Offline
Sr. Member
****
Karma: 0
Posts: 363
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Web page is a good idea, but you'll need an ethernet module, etc... too complicated.
Just do a little Java application with Processing. With a small GUI to enter the numbers, you can save and load the textfile + send the values to the Arduino via serial.
Logged


0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your arduino code should look something like this:

Code:
void readFromSerialPort()
{
  // REM: need to know the address where to write the incoming bytes;
  if (Serial.available() > 0)
  {
      int incomingByte = Serial.read();

      // adapted from http://www.arduino.cc/playground/Code/I2CEEPROM24LC512;
      writeNextByte(incomingByte);
  }
}


For testing purposes, as the sending app, you can use the serial console from the arduino IDE.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a crazy thought...

Is there a way to get the Arduino to let you use the EEPROM as a USB drive? If I could figure out a way to just connect it to the computer via USB, drag a text file(s) with the variables in it, and then read that from the program, that would be perfect.

I could do the same thing with an SD card and an external reader to write the card, but I'd love to do it all self-contained, and ideally avoiding the need for the SD card/other external memory.


Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No you can't do that. Arduino is not a USB host.  

Your only choice is to somehow use the serial line, or as you suggest yourself something like an SD card.
Logged

Pages: [1]   Go Up
Jump to: