Wrote code for BORON that “breaths” pin D7 (Blue led by the usb connector) and does some other stuff.
See below for the loop code. It also uses the #include <TM1637Display.h> library.
Firmware upload ok, but now the BORON boots all the way to the pulsing cyan led (so everything looks good) then the cyan led turns off (the RGB no longer does anything) and only the blue led on D7 breaths. All attempts to reprogram fail with a timeout, and trying to enter safe mode fails. (mode + reset, release reset, wait for majenta, release mode). Any ideas on next steps.
void loop() {
double Vscale = 0.0008; // Vdc per bit to convert to volts
double Iscale = 0.0008; // Idc per bit to convert to current
// update data
digital_in_1 = digitalRead(DIGITAL_IN_1);
digital_in_namur = digitalRead(DIGITAL_IN_NAMUR);
analog_in_v = analogRead(ANALOG_IN_V) * Vscale;
analog_in_4_20mA = analogRead(ANALOG_IN_4_20MA) * Iscale;
// update led
if(state)
{
bright = bright + 100;
if (bright > 4000)
{
state = FALSE;
Particle.publish("Going Up");
}
Serial.print("Gowing Up");Serial.println(bright,DEC);
}
else
{
bright = bright - 100;
if (bright < 10)
{
state = TRUE;
Particle.publish("Going Down");
}
Serial.print("Gowing Down");Serial.println(bright,DEC);
}
analogWrite(BREATH_LED, bright);
display.showNumberDec(1234); //Display the Variable value;
delay(200);
}