16 April 2012

Update: Arduino, the K3NG CW Keyer and a LCD Shield

As promised I looked for the debounce library. It is now called Bounce.h. The reactions of the buttons became better but the memory became spare.

I tried to build up a table with the appropriate messages:

prog_char string_iambic_a[] PROGMEM = "A Iambic A";
prog_char string_iambic_b[] PROGMEM = "B Iambic B";
prog_char string_ultimatic[] PROGMEM = "D Ultimatic";
prog_char string_audio_freq[] PROGMEM = "F Tone frequency";
prog_char string_bug_mode[] PROGMEM = "G Bug mode";
prog_char string_tx_on_off[] PROGMEM = "I TX on/off";
prog_char string_ratio[] PROGMEM = "J Ratio adjust";
prog_char string_paddle_rev[] PROGMEM = "N Paddle reverse";
prog_char string_sidetone[] PROGMEM = "O Sidetone on/off";
prog_char string_mem_prog[] PROGMEM = "P# Program a memory";
prog_char string_tune[] PROGMEM = "T  Tune mode";
prog_char string_poti[] PROGMEM = "V  Poti on/off";
prog_char string_speed[] PROGMEM = "W  Change speed";
prog_char string_exit[] PROGMEM = "X  Exit command";
prog_char string_autospace[] PROGMEM = "Z  Autospace On/Off";
prog_char string_mem_no_tx[] PROGMEM = "#  Memory without TX";
 And installed a table:


PROGMEM const char *string_lcd_table[] =   // change "string_table" name to suit
{  
string_iambic_a,
string_iambic_b,
string_ultimatic,
string_audio_freq,
string_bug_mode,
string_tx_on_off,
string_ratio,
string_paddle_rev,
string_sidetone,
string_mem_prog,
string_tune,
string_poti,
string_speed,
string_exit,
string_autospace,
string_mem_no_tx
};
char buffer[16];   
and used it in a separate program:

 for (int i = 0; i < 16; i++)
  {
    strcpy_P(buffer, (char*)pgm_read_word(&(string_lcd_table[i]))); 
    lcd.print( buffer );
    delay( 500 );
  }


This was just the bare loop without polishing. But when I tried to integrate it into K3NGs program the Arduino or better its memory refused to except the additional code -> not enough memory although I had already switched off the memories for cw messages.

So I will stop for now integrating the LCD with the K3NG CW Keyer until I get a MegaArduino. A pitty but who knows...



Stay Tuned!