genuine Arduino Uno3, Win7, view flash contents and edit?

I have already used up 11% of my flash memory uploading the same program for a rotary encoder several times that I can’t get to work. Is it possible for me to view what sketches are on the Uno flash memory and delete the unused ones?

I am trying to upload another sketch that uses <rotary.h> but the main sketch fails to compile because it can’t find the <rotary.h> file. I think I saw a file <rotary.h.ino> in one of my many attempts to troubleshoot this but now I cant’t find that file either.

Assume I know zero because I am a 59 y/o newb.

A sketch starts at the same point in memory when it is loaded. You can load 100 sketches, all will start at the same point, and any unused memory is still available for reloading next time you want to put in a larger sketch.

Where do you have the rotary.h library stored?

The file in is the folder in My documents.

I tried cutting and pasting the rotary code into the main program instead;

/*
Main code by Richard Visokey AD7C - www.ad7c.com
Revision 2.0 - November 6th, 2013
*/

// Include the library code
#include <LiquidCrystal.h>
#include <EEPROM.h>
#include “Arduino.h”

//Setup some items
#define W_CLK 8 // Pin 8 - connect to AD9850 module word load clock pin (CLK)
#define FQ_UD 9 // Pin 9 - connect to freq update pin (FQ)
#define DATA 10 // Pin 10 - connect to serial data load pin (DATA)
#define RESET 11 // Pin 11 - connect to reset pin (RST)
#define pulseHigh(pin) {digitalWrite(pin, HIGH); digitalWrite(pin, LOW); }

// Enable this to emit codes twice per step.
//#define HALF_STEP

// Enable weak pullups
#define ENABLE_PULLUPS

// Values returned by ‘process’
// No complete step yet.
#define DIR_NONE 0x0
// Clockwise step.
#define DIR_CW 0x10
// Anti-clockwise step.
#define DIR_CCW 0x20

class Rotary
{
public:
Rotary(char, char);
// Process pin(s)
unsigned char process();
private:
unsigned char state;
unsigned char pin1;
unsigned char pin2;
};

LiquidCrystal lcd(12, 13, 7, 6, 5, 4); // I used an odd pin combination because I need pin 2 and 3 for the interrupts.
int_fast32_t rx=7200000; // Starting frequency of VFO
int_fast32_t rx2=1; // variable to hold the updated frequency
int_fast32_t increment = 10; // starting VFO update increment in HZ.
int buttonstate = 0;
String hertz = “10 Hz”;
int hertzPosition = 5;
byte ones,tens,hundreds,thousands,tenthousands,hundredthousands,millions ; //Placeholders
String freq; // string to hold the frequency
int_fast32_t timepassed = millis(); // int to hold the arduino miilis since startup
int memstatus = 1; // value to notify if memory is current or old. 0=old, 1=current.

int ForceFreq = 1; // Change this to 0 after you upload and run a working sketch to activate the EEPROM memory. YOU MUST PUT THIS BACK TO 0 AND UPLOAD THE SKETCH AGAIN AFTER STARTING FREQUENCY IS SET!

void setup() {
pinMode(A0,INPUT); // Connect to a button that goes to GND on push
digitalWrite(A0,HIGH);
lcd.begin(16, 2);
PCICR |= (1 << PCIE2);
PCMSK2 |= (1 << PCINT18) | (1 << PCINT19);
sei();
pinMode(FQ_UD, OUTPUT);
pinMode(W_CLK, OUTPUT);
pinMode(DATA, OUTPUT);
pinMode(RESET, OUTPUT);
pulseHigh(RESET);
pulseHigh(W_CLK);
pulseHigh(FQ_UD); // this pulse enables serial mode on the AD9850 - Datasheet page 12.
lcd.setCursor(hertzPosition,1);
lcd.print(hertz);
// Load the stored frequency
if (ForceFreq == 0) {
freq = String(EEPROM.read(0))+String(EEPROM.read(1))+String(EEPROM.read(2))+String(EEPROM.read(3))+String(EEPROM.read(4))+String(EEPROM.read(5))+String(EEPROM.read(6));
rx = freq.toInt();
}

}

void loop() {
if (rx != rx2){
showFreq();
sendFrequency(rx);
rx2 = rx;
}

buttonstate = digitalRead(A0);
if(buttonstate == LOW) {
setincrement();
};

// Write the frequency to memory if not stored and 2 seconds have passed since the last frequency change.
if(memstatus == 0){
if(timepassed+2000 < millis()){
storeMEM();
}
}
}

ISR(PCINT2_vect) {

unsigned char result = r.process();
if (result) {
if (result == DIR_CW){rx=rx+increment;}
else {rx=rx-increment;};
if (rx >=30000000){rx=rx2;}; // UPPER VFO LIMIT
if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT
}
}

// frequency calc from datasheet page 8 = * /2^32
void sendFrequency(double frequency) {
int32_t freq = frequency * 4294967295/125000000; // note 125 MHz clock on 9850. You can make ‘slight’ tuning variations here by adjusting the clock frequency.
for (int b=0; b<4; b++, freq>>=8) {
tfr_byte(freq & 0xFF);
}
tfr_byte(0x000); // Final control byte, all 0 for 9850 chip
pulseHigh(FQ_UD); // Done! Should see output
}
// transfers a byte, a bit at a time, LSB first to the 9850 via serial DATA line
void tfr_byte(byte data)
{
for (int i=0; i<8; i++, data>>=1) {
digitalWrite(DATA, data & 0x01);
pulseHigh(W_CLK); //after each bit sent, CLK is pulsed high
}
}

void setincrement(){
if(increment == .10){increment = .50; hertz = “.50 Hz”; hertzPosition=5;}
else if (increment == .50){increment = 1.00; hertz = “1.00 Hz”; hertzPosition=4;}
else if (increment == 1.00){increment = 5.00; hertz=“5.00 Hz”; hertzPosition=4;}
else if (increment == 5.00){increment = 10.00; hertz=“10 hz”; hertzPosition=6;}
else if (increment == 10.00){increment = 25.00; hertz=“25 hz”; hertzPosition=4;}
else if (increment == 25.00){increment = 50.00; hertz=“50 hz”; hertzPosition=6;}
else if (increment == 50.00){increment = 100.00; hertz=“100 hz”; hertzPosition=5;}
else if (increment == 100.00){increment = 1000.00; hertz=“1 Khz”; hertzPosition=4;}
else if (increment == 1000.00){increment = 10000.00; hertz=“10 khz”; hertzPosition=6;}
else{increment = 1.0; hertz = “1.0 Hz”; hertzPosition=.5;};
lcd.setCursor(0,1);
lcd.print(" Hz ");
lcd.setCursor(hertzPosition,1);
lcd.print(hertz);
delay(250); // Adjust this delay to speed up/slow down the button menu scroll speed.
};

void showFreq(){
millions = int(rx/1000000);
hundredthousands = ((rx/100000)%10);
tenthousands = ((rx/10000)%10);
thousands = ((rx/1000)%10);
hundreds = ((rx/100)%10);
tens = ((rx/10)%10);
ones = ((rx/1)%10);
lcd.setCursor(0,0);
lcd.print(" “);
if (millions > 9){lcd.setCursor(1,0);}
else{lcd.setCursor(2,0);}
lcd.print(millions);
lcd.print(”.");
lcd.print(hundredthousands);
lcd.print(tenthousands);
lcd.print(thousands);
lcd.print(".");
lcd.print(hundreds);
lcd.print(tens);
lcd.print(ones);
lcd.print(" Hz ");
timepassed = millis();
memstatus = 0; // Trigger memory write
};

void storeMEM(){
//Write each frequency section to a EPROM slot. Yes, it’s cheating but it works!
EEPROM.write(0,millions);
EEPROM.write(1,hundredthousands);
EEPROM.write(2,tenthousands);
EEPROM.write(3,thousands);
EEPROM.write(4,hundreds);
EEPROM.write(5,tens);
EEPROM.write(6,ones);
memstatus = 1; // Let program know memory has been written
};

but I get the error messages: r was not declared in this scope.

The last time I programmed a computer in college, we punched chads out of card files :wink: