Some things spring to mind immediately - sorry @harrisonhjones I don’t mean to interfere here, but to give you some slack ;-).
@MarkSHarrisTX, the most severe one is that you should not use the ampersand &
in this line
Spark.variable("Button", &Button, STRING);
since Button
already is an address.
And you shan’t do this Button = "ON";
or Button = "OFF";
since this does not update your Spark.variable
.
You’d need to do something like strcpy(Button, "ON");
instead, but for this I’d rather declare char Button[5] = "OFF";
.
I’m not sure if the TTL parameter of publish()
is already in effect, but having a time to live of zero seconds for your event seems a bit short.
To confirm whether your program works, you might want to try PUBLIC
events/subscriptions first.
Furthermore you should maybe consider hooking up your subscription before your first publish to avoid race conditions.
And for your event handler you might never see the LED off, since you immediately turn it back on after you switched it off. And your loop()
tempers with your LED state, too.
Just comment out the last digitalWrite()
in the event handler and maybe use Harrison’s suggestion to employ the RGB LED for “debugging”.
As for your button you should either use INPUT_PULLUP
or INPUT_PULLDOWN
(depending how you wired the button) instead of INPUT
to avoid floating readings while the button is not pressed.
Some coding tips:
You can simplify this
if (buttonState == LOW) {
digitalWrite(LED_PIN, HIGH);
} else {
digitalWrite(LED_PIN, LOW);
}
into this
digitalWrite(LED_PIN, !buttonState); // write invers buttonState to LED
// or if this doesn't work due to HIGH being 0x0001 rather than 0xFFFF
digitalWrite(LED_PIN, buttonState ? LOW : HIGH);
or this
if (buttonState == HIGH && oldState == LOW) {
//write the appropriate HIGH/LOW to the LED pin to turn it ON/OFF
digitalWrite(LED_PIN, HIGH);
//publish the state to the Spark Cloud as ON/OFF
Spark.publish("Joes_Bar", "ON");
Button = "ON";
oldState = buttonState;
}
// If button has just been released, turn off LED and send out new state
if (buttonState == LOW && oldState == HIGH) {
digitalWrite(LED_PIN, LOW); // Turn off LED
//publish the state to the Spark Cloud as ON/OFF
Spark.publish("Joes_Bar", "OFF");
Button = "OFF";
oldState = buttonState;
}
into
if (buttonState != oldState) {
digitalWrite(LED_PIN, buttonState);
strcpy(Button, buttonState ? "ON" : "OFF");
Spark.publish("Joes_Bar", Button);
oldState = buttonState;
}
As for your color questions further up:
When you see the red/blue combo on the RGB LED, this is magenta.
I’m not aware of Cores featuring a green LED on D7, this usually is blue - unless there was a change in production 
For formating your code could you please check out this post