Skip to content

Changing number of streams at run time #2

@bigginsking

Description

@bigginsking

I have this work so that I can write to a UART and SD card, and that works fantastic but when the SD isn't available at start up the UART out fails. Here are the relevant bits of code:

HardwareSerial & Ser = Serial3; //rename the serial to make the code more flexible
Print *serout[2] = {&Ser, &dataFile }; //put the Serial outputs together?
NeoTee SerSd(serout, sizeof(serout)/sizeof(serout[0])); //wish better understood this...

void setup() 
{
SPI.swap(1);
if (!SD.begin(17)) {
Ser.println("SD initialization failed!");
sdavail = false;
//Print *serout[1] = {&Ser }; //put the Serial 
NeoTee SerSd(serout, sizeof(serout[0])/sizeof(serout[0])); //I would think this would work but it doesn't
//HardwareSerial & SerSd = Serial3; //This doesn't work either
}
}

Is there a way that I can get this to work with and without the SD card present?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions