thank you so much that totally fixed the problem I was wondering if you knew anything about the update function I've set up a similar code to try and get it to be able to be changed in a way similar to the bridge example but when I try to use the update command in my code it won't compile.
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
BridgeServer server;//set up a bridge server
//LED Pin vairiables (they will stay constant)
const int Led1 = 11;
const int Led2 = 9;
const int Led3 = 6;
const int Led4 = 3;
const int P = 50; //perioud of the cycle it can't go below 50
//Vairiables that will change
unsigned long DC1 = 0;
unsigned long DC2 = 0;
unsigned long DC3 = 0;
unsigned long DC4 = 0;
//on LED signals
unsigned long ONLed1 = (P * DC1);
unsigned long ONLed2 = (P * DC2);
unsigned long ONLed3 = (P * DC3);
unsigned long ONLed4 = (P * DC4);
//LED off signals
unsigned long OFFLed1 = (P * (1 - DC1));
unsigned long OFFLed2 = (P * (1 - DC2));
unsigned long OFFLed3 = (P * (1 - DC3));
unsigned long OFFLed4 = (P * (1 - DC4));
byte totalmillies = 0;// the total number of miliseconds on the loop
//checking if the LEDS are on or off
byte Led1State = LOW;
byte Led2State = LOW;
byte Led3State = LOW;
byte Led4State = LOW;
void setup() {
Bridge.begin();
Console.begin();
Console.println ("through vairiables");
//set up server
server.listenOnLocalhost();
server.begin();
//setting Leds as outputs
pinMode(Led1, OUTPUT);
pinMode(Led2, OUTPUT);
pinMode(Led3, OUTPUT);
pinMode(Led4, OUTPUT);
}
void loop() {
totalmillies = millis();
updateLed1State();
as far as I can tell I have very similar variable up to that point I'm, not sure whats going wrong