Go Down

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

Annabel197

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

Serial.println(F(keyboard.getKey));

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?

MarkT

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 ]

Collin80

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?

schwingkopf


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!

Arduino
via Egeo 16
Torino, 10131
Italy