Debug printing. How are you doing it?

Nope, my bad.

I was sure [n] worked for BusOut but checking the documentation it clearly doesn’t.

In which case to switch a single bit on you need to use some binary logic and go with:

LED = LED | (1<<x);

And then to switch off it’s

LED = LED & ~(1<<x);

Or you could define a new class that inherits BusOut and overloads the [] operator.

OK. That works. Here’s the full version of the code, updated with the BusOut syntax:

#include "mbed.h"
 #include "USBSerial.h"

//Virtual serial port over USB
USBSerial serial;
 
BusOut LED(LED1, LED2, LED3, LED4, LED5, LED6, LED7);

float delayTime = .05;

void debugOutput ( int x )
{
    switch (x) 
    {
        case 0:
        case 6:
            serial.printf("Red!\r\n");
            break;
        case 1: 
        case 5: 
            serial.printf("Orange!\r\n");
            break;
        case 2: 
        case 4: 
            serial.printf("Yellow!\r\n");
            break;
        case 3: 
            serial.printf("Green!\r\n");
            break;
        default: 
            serial.printf("Not an LED!\r\n");
            break;
    }
    return;
}

int main()
{
    while(1)
    {
        delayTime = 0.25;
        for(int x = 0; x < 7; x++)
        {
            debugOutput ( x );
            LED = LED | (1<<x); // turn on
            wait(.2); // delay
        
            LED = LED & ~(1<<x); // turn off
            wait(delayTime); // delay
        }
        for(int x = 5; x >= 0; x--)
        {
            debugOutput ( x );
            LED = LED | (1<<x); // turn on
            wait(.2); // delay
        
            LED = LED & ~(1<<x); // turn off
            wait(delayTime); // delay
        }

        for(int x = 0; x < 7; x++)
        {
            debugOutput ( x );
            LED = LED | (1<<x); // turn on
            wait(delayTime); // delay
        }
        for(int x = 6; x >= 0; x--)
        {
            debugOutput ( x );
            LED = LED & ~(1<<x); // turn off
            wait(delayTime); // delay
        }
    }
}

Nope. I was working purely off the mbed.org instructions. If USBRX/TX aren’t connected - then that’s a pretty big misdirection. I’ll have to invest in a usb-serial plug - I really wanted the least fussy solution which would be to use a standard micro-usb cable.

Don’t forget that most converters will want rs232 levels not logic levels.
You can get logic level converter cables (USB TTL Serial Cable Series - FTDI ) or in past I’ve cracked open a normal one and bypassed the level shifting chip.

you can always just get a few CP2102 TTL USB-Serial devices. Cheap and effective. Currently this is the cheapest one on eBay (including postage to AU) that has the jumper cables you most likely want. They’re jelly-bean parts in my view, just order $10 worth and have them on the shelf when you need.
http://www.ebay.com.au/itm/CP2102-Male-USB-2-0-to-TTL-UART-Module-Serial-Converter-STC-PRGMR-Free-Cable-/371194112927?pt=AU_CablesConnectors&hash=item566ce4ab9f