Arduino Axe-Fx control library

I get some errors:
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\asus\Documents\Arduino\Axe_FetchScenes2\Axe_FetchScenes2.ino: In function 'void onPresetChange(AxePreset)':

Axe_FetchScenes2:31:12: error: 'class HardwareSerial' has no member named 'printf'

Serial.printf("Preset: %d - %s\n", preset.getPresetNumber(), preset.getPresetName());

^

Axe_FetchScenes2:31:73: error: 'class AxePreset' has no member named 'getPresetName'

Serial.printf("Preset: %d - %s\n", preset.getPresetNumber(), preset.getPresetName());

^

Axe_FetchScenes2:32:12: error: 'class HardwareSerial' has no member named 'printf'

Serial.printf("Scene: %d - %s\n", preset.getSceneNumber(), preset.getSceneName());

^

Axe_FetchScenes2:32:71: error: 'class AxePreset' has no member named 'getSceneName'

Serial.printf("Scene: %d - %s\n", preset.getSceneNumber(), preset.getSceneName());

^

C:\Users\asus\Documents\Arduino\Axe_FetchScenes2\Axe_FetchScenes2.ino: In function 'void onSceneName(SceneNumber, const char*, byte)':

Axe_FetchScenes2:38:12: error: 'class HardwareSerial' has no member named 'printf'

Serial.printf("onSceneName(): %d: %s\n", number, name);

^

In file included from C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/interface/AxeSystem.h:214:0,

from C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/AxeFxControl.h:7,

from C:\Users\asus\Documents\Arduino\Axe_FetchScenes2\Axe_FetchScenes2.ino:1:

C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/interface/private/AxeSystem_Private.h:62:6: error: 'void AxeSystem::requestSceneName(SceneNumber)' is private

void requestSceneName(const SceneNumber number = -1);

^

Axe_FetchScenes2:44:37: error: within this context

Axe.requestSceneName(i+1);

^

exit status 1
'class HardwareSerial' has no member named 'printf'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
OK I gotta run, if you checkout the master branch of the library on github, it has an updated example.

Those hardware serial errors tell me you're debugging on the wrong serial?
 
Code:
#include <AxeFxControl.h>

#define NUM_SCENES 8

//Struct to hold information about each scene
struct SceneInfo {
    SceneNumber number = -1;
    const char *name;
};

//A list of all of the scenes for this preset
SceneInfo scenes[NUM_SCENES];

AxeSystem Axe;

void setup() {

    Serial.begin(9600);

    Axe.begin(Serial1);
    Axe.registerPresetChangingCallback(onPresetChanging);
    Axe.registerPresetChangeCallback(onPresetChange);
    Axe.registerSceneNameCallback(onSceneName);
    Axe.requestPresetDetails();

}

void loop() {
    Axe.update();
}

void onPresetChanging(const PresetNumber number) {
    //Reset the scene list for the new preset
    for (byte i=0; i<NUM_SCENES; i++) {
        scenes[i].number = -1;
    }
}

void onPresetChange(AxePreset preset) {
    Serial.println("\nonPresetChange()\n=====================");
    Serial.print("Preset: ");
    Serial.print(preset.getPresetNumber());
    Serial.print(" - ");
    preset.printPresetName(Serial, true);

    Serial.print("Scene: ");
    Serial.print(preset.getSceneNumber());
    Serial.print(" - ");
    preset.printSceneName(Serial, true);
    Serial.println("=====================\n\n");
}

void onSceneName(const SceneNumber number, const char* name, const byte length) {

    if (number == 1) {
        Serial.println("\n++++++++++++++++++++++++\n\n");
    }

    Serial.print("onSceneName(): ");
    Serial.print(number);
    Serial.print(": ");
    Serial.println(name);

    //Record current scene in the list
    scenes[number-1].number = number;
    scenes[number-1].name = name;

    //Request the first scene that we don't have yet.
    //Only request one at a time to avoid filling up RX buffer
    for (byte i=0; i<NUM_SCENES; i++) {
        if (scenes[i].number == -1) {
            Axe.requestSceneName(i+1);
            break;
        }
    }

}
 
Thank you.
It doesn't like Axe.requestSceneName(i+1); :)
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/interface/AxeSystem.h:214:0,

from C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/AxeFxControl.h:7,

from C:\Users\asus\Documents\Arduino\Axe_FetchScenes2\Axe_FetchScenes2.ino:1:

C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/interface/private/AxeSystem_Private.h: In function 'void onSceneName(SceneNumber, const char*, byte)':

C:\Users\asus\Documents\Arduino\libraries\AxeFxControl-master\src/interface/private/AxeSystem_Private.h:62:6: error: 'void AxeSystem::requestSceneName(SceneNumber)' is private

void requestSceneName(const SceneNumber number = -1);

^

Axe_FetchScenes2:72:37: error: within this context

Axe.requestSceneName(i+1);

^

exit status 1
within this context

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
Thanks Tyson,

Yes I bought a bunch of components like switches and displays etc months ago - I will get around ot it as it seems we may never get the FC12 here in Australia.
Pauly

Hi again Pauly, if want to learn the most, I would consider starting your own from scratch, and only implement one feature at a time. Then you will understand every piece of the code.

At first, use serial print to write out what is happening. You might also want to wire up some cheap little push buttons that you can operate easily by hand. It’s a lot easier than working with an enclosure and foot switches.

https://www.jaycar.com.au/black-miniature-pushbutton-spst-momentary-action-125v-1a-rating/p/SP0711
 
Great! It is working
Thank you


=====================
Preset: 280 - 60's BlackFace Princeton Reverb
Scene: 1 - Blackface no brite w/rev
=====================


onSceneName(): 2: med. gain w/brite
onSceneName(): 3: Everything on "4"
onSceneName(): 4: Clean Jazz w/Reverb, humbckr
onSceneName(): 5: gain with G12H30 spkr
onSceneName(): 6: Clean Jazz w/Reverb, G12H30
onSceneName(): 7: Gain on 6, 3 spkrs
onSceneName(): 8: Portable Lead
 
I have an issue with the Tuner example

When printing the char "note" to the LCD, eventually the data is corrupted.

I also note that sometimes there is a string 241. Who plays a 241 strings guitar? :)

TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=241 fineTune=0
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=241 fineTune=0
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=6 fineTune=5
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=241 fineTune=0
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=99
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=6 fineTune=98
TUNING: note=G string=241 fineTune=0
TUNING: note=G string=6 fineTune=98
TUNING: note=G string=6 fineTune=98
TUNING: note=G string=6 fineTune=240
TUNING: note=G string=6 fineTune=98
TUNING: note=G string=6 fineTune=98
TUNING: note=G string=6 fineTune=98
TUNING: note=⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

Code:
#include <AxeFxControl.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
/**
 * Turn realtime sysex on for this to work.
 */

AxeSystem Axe;
unsigned long timer;

void setup() {

  lcd.begin();
  lcd.backlight();
    Axe.registerTunerDataCallback(onTunerData);
    Axe.registerTunerStatusCallback(onTunerStatus);
    Axe.begin(Serial1);

   Serial.begin(9600);
}

void loop() {

    Axe.update();

}

void onTunerData(const char *note, const byte string, const byte fineTune) {
    char buf[50];
    snprintf(buf, 50, "TUNING: note=%s string=%d fineTune=%d", note, string, fineTune);
    Serial.println(buf);

     lcd.setCursor(9,0);
     lcd.print(note);
     lcd.print(string);
     lcd.print("   ");

    lcd.setCursor(0, 1);
    if (fineTune <= 15)                        {lcd.print(">                   ");}
    if ((fineTune >= 16) && (fineTune <= 23))  {lcd.print(">>                  ");}
    if ((fineTune >= 24) && (fineTune <= 28))  {lcd.print("->>                 ");}
    if ((fineTune >= 29) && (fineTune <= 34))  {lcd.print("-->>                ");}
    if ((fineTune >= 35) && (fineTune <= 39))  {lcd.print("--->>               ");}
    if ((fineTune >= 40) && (fineTune <= 45))  {lcd.print("---->>              ");}
    if ((fineTune >= 46) && (fineTune <= 50))  {lcd.print("----->>             ");}
    if ((fineTune >= 51) && (fineTune <= 56))  {lcd.print("------>>            ");}
    if ((fineTune >= 57) && (fineTune <= 61))  {lcd.print("------->>           ");}
    if ((fineTune >= 62) && (fineTune <= 64))  {lcd.print("------>>>><<<<------");}  // ON TUNE
    if ((fineTune >= 65) && (fineTune <= 70))  {lcd.print("           <<-------");}
    if ((fineTune >= 71) && (fineTune <= 75))  {lcd.print("            <<------");}
    if ((fineTune >= 76) && (fineTune <= 81))  {lcd.print("             <<-----");}
    if ((fineTune >= 82) && (fineTune <= 86))  {lcd.print("              <<----");}
    if ((fineTune >= 87) && (fineTune <= 92))  {lcd.print("               <<---");}
    if ((fineTune >= 93) && (fineTune <= 98))  {lcd.print("                <<--");}
    if ((fineTune >= 99) && (fineTune <= 103)) {lcd.print("                 <<-");}
    if ((fineTune >= 104) && (fineTune <= 110)){lcd.print("                  <<");}
    if (fineTune >= 101)                       {lcd.print("                   <");}

}

void onTunerStatus(bool engaged) {
    char buf[20];
    snprintf(buf, 20, "TUNER STATUS: %s", engaged ? "ON" : "OFF");
    Serial.println(buf);
}

It is OK if I only print the text (arrows), but corrupted as soon as I insert "lcd.print(note);"
 
Thanks for reporting. This will be to do with the input serial buffer filling up too fast I think. The axe sends a lot of messages when the tuner is on.

I will do some debugging!
 
I haven't been able to reproduce this on my Teensy LC. I ran your code, replacing the LCD with Serial.println calls, and ran it for about 20 minutes with no corrupt data.

The LC and Mega both have a serial input buffer if 64 bytes, so I doubt this is the problem.

My only guess is that it has something to do with the I2C protocol... but that doesn't explain why the data being printed in the "TUNING: " debug call is corrupt as well.

Here are some step to help debug it:

1) Try to reproduce it consistently. Run it a number of times, see if you can get it to reliably stuff up.

2) Remove all of the LCD stuff and use serial print. See if you can get it to stuff up this way. (I can't.)

2) Start re-adding the LCD calls until it starts stuffing up again. If you find one particular call that causes it to become corrupt, then we will have found the culprit.
 
Solved! After having spent countless hours trying all king of possibilities... The pointer!

This works: lcd.print(*note); no matter how many lines I print to the I2C LCD. Without the asterisk, the data was corrupted randomly when I printed more than two lines.
 
I thought about using that asterisk while I was taking a shower. Coding is a very strange activity :)
 
Back
Top Bottom