I think I am writing a string to the flash memory?

Now how do I access the flash memory to retrieve that data?

I should have 679 different data points stored in there right now if my sketch is correct.

Show us your sketch sofar...

you can't write to flash, you can write to EEPROM and that is 512 bytes on an Arduino 328. So maybe with the help of some compression. What is the range of your values?

// Frequency Counter Lib example

/*
Martin Nawrath KHM LAB3
Kunsthochschule f¸r Medien Kˆln
Academy of Media Arts
http://www.khm.de
http://interface.khm.de/index.php/labor/experimente/
*/
#include <FreqCounter.h>
#include <flash.h>

unsigned long frq;
int cnt;
int pinLed=13;

void setup() {
pinMode(pinLed, OUTPUT);

Serial.begin(115200); // connect to the serial port
Serial.println("Geiger Counter");

}

void loop() {

// wait if any serial is going on
FreqCounter::f_comp=10; // Cal Value / Calibrate with professional Freq Counter
FreqCounter::start(60000); // 1 minuit Gate Time

while (FreqCounter::f_ready == 0)

frq=FreqCounter::f_freq;
Serial.print(cnt++);
Serial.print(" cpm: ");
Serial.println(frq);
FLASH_STRING_ARRAY(frq);
///FLASH_STRING(frq);
delay(1000);
digitalWrite(pinLed,!digitalRead(pinLed)); // blink Led

}

Probably it is not possible for a sketch to write to flash . :frowning:
It's only possible to read PROGMEM-Data which you have defined in your sketch.

Alex

Ok thanks this looks like I am banging my head against the wall. :slight_smile:

I have the SD card shield coming in the mail and that looks like the way to go.

Eventually I am going to switch out the Geiger counter for the Lucas cell to monitor radon gas levels in the basement and I want to collect the data to put in a spread sheet.

It was a learning experiment.

Thanks.

Tracy

Check out - Flash | Arduiniana

Ok. I got my SD card shield in today. And I rewrote my sketch and it looks like this right now.

// Geiger Counter Lib example

/* Adapted by Tracy Albert from programing for a frequecy counter by,
Martin Nawrath KHM LAB3
Kunsthochschule f¸r Medien Kˆln
Academy of Media Arts
http://www.khm.de
http://interface.khm.de/index.php/labor/experimente/
*/
#include <FreqCounter.h>
#include <SdFat.h>
#include <SdFatUtil.h>

Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

unsigned long frq;
int cnt;
int pinLed=13;

void setup() {
pinMode(pinLed, OUTPUT);

Serial.begin(9600); // connect to the serial port
Serial.println("Geiger Counter");

}

void loop() {

// wait if any serial is going on
FreqCounter::f_comp=10; // Cal Value / Calibrate with professional Freq Counter
FreqCounter::start(60000); // 1 minuit Gate Time

while (FreqCounter::f_ready == 0)

frq=FreqCounter::f_freq;
Serial.print(cnt++);
Serial.print(" cpm: ");
Serial.println(frq);
delay(1000);
digitalWrite(pinLed,!digitalRead(pinLed)); // blink Led

}

Now the first line of data is a very high number.

Geiger Counter
0 cpm: 0
1 cpm: 65548
2 cpm: 9
3 cpm: 14
4 cpm: 20
5 cpm: 12
6 cpm: 19
7 cpm: 15
8 cpm: 8
9 cpm: 7
10 cpm: 19
11 cpm: 13
12 cpm: 15
13 cpm: 14
14 cpm: 8
15 cpm: 14
16 cpm: 15
17 cpm: 11
18 cpm: 16

Any good ideas?

First off please use the # icon when posting code.
Second this bit:-
while (FreqCounter::f_ready == 0)
frq=FreqCounter::f_freq;
I think should be:-
while (FreqCounter::f_ready == 0) { }
frq=FreqCounter::f_freq;
To stop the second line from being continuously executed.