Pages: [1]   Go Down
Author Topic: FLASH-lib for Arduino  (Read 1166 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello.
I'm trying to use the flash lib in the code below but I get some errors that I think have to do with the lib.
I downloaded and put in the folder of the Arduino libraries. Added the lib but still got errors.
Can someone tell me how can I solve this?

Code:
#include <Flash.h>
int x = 0;

void setup(){
  FLASH_ARRAY(int, value, 1, 2, 2, 5, 6, 7, 10);
}

void loop(){
  x = value[1];
}


ERRORS:

sketch_nov07a.ino: In function 'void setup()':
sketch_nov07a:6: error: expected primary-expression before 'int'
sketch_nov07a:6: error: 'value' was not declared in this scope
sketch_nov07a:6: error: 'FLASH_ARRAY' was not declared in this scope
sketch_nov07a.ino: In function 'void loop()':
sketch_nov07a:10: error: 'value' was not declared in this scope

thank you
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50883
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I downloaded and put in the folder of the Arduino libraries.
From where? Where did you put it? "In the right place" is the wrong answer.
Logged

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

You can see in the attached image where I put the lib.

I downloaded the lib in http://arduiniana.org/libraries/flash/comment-page-3/#comment-105688

After that did include the lib in the programming window, and when compiling one of the examples of the lib program returns me errors that indicated above.

Thanks


* Sem Título.png (31.67 KB, 596x427 - viewed 31 times.)
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 37
Posts: 1096
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Name of the folder should be Flash , and not Flash4.

http://arduino.cc/en/Guide/Libraries

FLASH_ARRAY should be global (outside setup), take a look at the examples
« Last Edit: November 10, 2013, 10:50:30 am by Erni » Logged

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

Thanks a lot  smiley-wink

It works.
Even noticed that they had the same name and therefore was giving error in compilation.
I made the changes and it is amazing.

Thank you
Logged

Pages: [1]   Go Up
Jump to: