Go Down

Topic: Arduino Due Storage into Memory (Read 331 times) previous topic - next topic


I am currently trying to use a barcode scanner as an input to my arduino due and then store those barcodes in the flash memory. I can get an output on the serial monitor I am currently struggling with the storing data part.  

I have seen this line of code used

Serial.println(F("This is saved to flash"));
and have adapted it to


however I get an error along these lines.

#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
Barcode_Serial_Save.ino:23:18: note: in expansion of macro 'F'
Error compiling.

Is this because I am using the arduino due? Or because I'm not seeing something obvious. Any ideas that people have on how to save my barcode input into non volatile memory would be greatly appreciated?


You can't input data and then store it in the flash memory, you can only read constant
data put there at sketch download, as I understand it.  Its read-only.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


It's true, you can't store things in FLASH memory like that. There are ways of writing to it though. The CPU can do it but probably only in pages and only to pages you aren't currently executing code from. It's not that easy to do and a very advanced topic. It is easier to add some external storage space in the form of SPI or I2C connected EEPROM or FLASH memory chips. So, the question is: can you place an I2C EEPROM somewhere on an expansion board or something? Or, could you use an sdcard shield?


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131