Radio code (sound and Arduino)

i expected you to add this print inside your

void serialEvent(Serial port){
    String serialStr = port.readStringUntil('\n');
    serialStr=trim(serialStr);
    println(serialStr);     // this shows the RAW data ( and the usual timeout "null" )
    int values[]=int(split(serialStr,','));
    println(" how long "+values.length);  // this shows if the following == 2 makes any sense
    if(values.length==2){
     printArray(values);   // this shows where possible data end up
      value=values[1];    // here i suggested a [0]
    }
    
}

if anything is your screenshot is correct, your arduino send “0”
what is not according your arduino code: only “1” “2” “3” possible???


did you test my proposed example? arduino firmata and my processing firmata sketch?

    • no arduino code problems
    • no serial code problems
    • easy processing code, just get a integer number you can map in processing.
2 Likes