SOLVED: conversion from '__FlashStringHelper*' to non-scalar type 'String'

Hi John.

I was hoping to get an answer as what to actually do to sort out my problem, but after some searching I found example code suggesting I write an overloaded procedure for debugWrite. So now I have debugWrite defined twice, with different parameter types.

void debugWrite(String data) {
  if ( debugWriteFlag == 1 || debugWriteFlag == 3 ) {
    lcd.print(data);
  }
  if ( debugWriteFlag == 2 || debugWriteFlag == 3 ) {
    Serial.println(data);
  }
}

void debugWrite( __FlashStringHelper* data) {
  if ( debugWriteFlag == 1 || debugWriteFlag == 3 ) {
    lcd.print(data);
  }
  if ( debugWriteFlag == 2 || debugWriteFlag == 3 ) {
    Serial.println(data);
  }
}

So both the following 2 calls will work

debugWrite(F("PROGMEM string");
debugWrite("another RAM string");

For anyone that would like to give a helpful explanation for a dabbler, I found the code would not compile until I placed the asterisk at the end of the __FlashStringHelper type declaration as in __FlashStringHelper*