Pages: [1]   Go Down
Author Topic: Create database, save records, read, etc  (Read 2131 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

I will be creating a project where I have to create a database and 3+ tables in it. A SMARTGPU screen will be attached to an Arduino UNO board. The user must enter some data and the program must go and look for some data in the tables based on the entered data.

The database must be there all the time, from time to time, some information will be updated in it.

Here are my questions:
  • Can a database be saved to Arduino or do I need to save it in the SD card?
  • How can I create it?
  • How can I read/write data in it?

There is a library in the Arduino Playground, but it seems that the database will only be there until I reset the board.

I have strong programming skills, but never had to work with a board before.

Thanks in advance for the help.
Ivan
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26485
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How big is the database and  how dynamic is it?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 631
Posts: 50180
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And, what is this database for? Three or more tables?

The only ways to persist data are using EEPROM (you don't have much; it has limited write cycles) or SD cards.
Logged

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your choice should depend on the type and amount of data this database will handle. Can you give us some info on that?

In my college days, I create a random access database using files in Pascal and also in C. There was no SQL involved: everything was done using file operations (open, close, rewrite, reset, read, etc). It was pretty neat. I guess the same techniques can be used with Arduino in a SDcard.

However, if your database is small and has only very simple types, then EEPROM might be a good choice, since there is no need for extra hardware.
Logged

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, there will be no write operations, only read instructions. The database will be defined by the programmer (in this case me).

User will enter a number, the program will define how big the number is, for example:
  • between 1 and 5 = low
  • between 6 and 10 = normal
  • between 11 and 15 = high

Based on this rule arduino must go to the database and pull all the information for the given value.

The amount of data will be:
  • table A with about 5 rows and 4 columns: 3 numeric integers, 1 varchar[20]
  • table B with about 100 rows and 2 columns: 1 numeric integer, 1 varchar[20]
  • table C with about 100 rows and 2 columns: 1 numeric integer, 1 varchar (very long, size of a recipe aprox)

Table A has some user information.
Table B has the title name of a recipe, for example: pancakes
Table C has (for example) the detailed instructions on how to make pancakes

As you can see the data must be persistant and available every time the device it is turned on.

Sorry, I'm very new at this hehe,

Thanks again smiley-wink
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26485
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put it in PROGMEM.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: