Go Down

Topic: MIDI - save mux state into Program Change # (Read 1 time) previous topic - next topic

Bentfx

I want to have a output (led), that the state (on/off) can be save on a Program Change #.
So on PC#22 it can be ON, on PC#121 can be OFF..
And use a momentary switch to change the state ON/OFF, and push the save button to save it to the PC#

What useless value to the writeMux ?

Regards,

Grumpy_Mike

When ever you change the mux value you must update the led state. You are getting confused between toggling it and saving it. Separate the function of setting the LED value , storing it, and reading / restoring the state.

Quote
What useless value to the writeMux ?
I have told you about this before. You have:-
Code: [Select]

void muxWrite(int whichChannel) {
  for (int thisPin = 0; thisPin < 4; thisPin++) {
    int pinState = bitRead(whichChannel, thisPin);
    digitalWrite(channel[thisPin],pinState);
    }
 }

and you call it with
Code: [Select]
muxWrite(thisChannel);
But the variable thisChannel is global so you can just have:-
Code: [Select]

void muxWrite() {
  for (int thisPin = 0; thisPin < 4; thisPin++) {
    int pinState = bitRead(whichChannel, thisPin);
    digitalWrite(channel[thisPin],pinState);
    }
 }

and you can call it with
Code: [Select]
muxWrite();
This means you can increment it in the function if you like because it is global, otherwise it is just useless.

Bentfx

sorry, i was away for the xmas vacation... just comeback and ready to go back on the project!

Bentfx

I did the modification...
And finally found what was the saving problem:
I've place a "byte" before number when i was receiving a mididata, so it was resetting...
i remove just the "byte" before number and it work's perfectly...

Thank's again Grumpy_mike!

bent

Bentfx

i multiply the program by 8 channel, i now it doens't save....??????

Bentfx

went back to 2 channel, not saving anymore..... what the!

Bentfx

did a total reset/erase of EEPROM....
reinstall the program, and still not saving...
Code: [Select]
#include <Bounce2.h>

#include <EEPROM.h>

#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();


Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
Bounce debouncer3 = Bounce();
Bounce debouncer4 = Bounce();
Bounce debouncer5 = Bounce();
Bounce debouncer6 = Bounce();


byte number;
byte number2;
byte numberLed1;
byte Led;

int buttonPinDn  = 2;
int buttonPinUp  = 3;
int buttonPinDn1  = 16;
int buttonPinUp1  = 17;

int saveButton = 20;
int savebuttonState = 0;

const int toggleButton = A8;
int toggleState;
const int toggleLed = A9;
int stateLed = 0;

int buttonStateUp = 0;
int buttonStateDn = 0;
int thisChannel;
int channel [4] = {22, 23, 24, 25};
int buttonStateUp1 = 0;
int buttonStateDn1 = 0;
int thisChannel1;
int channel1 [4] = {46, 47, 48, 49};

void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);

debouncer1.attach(buttonPinUp);
debouncer1.interval(5); // interval in ms
debouncer2.attach(buttonPinDn);
debouncer2.interval(5); // interval in ms
debouncer3.attach(buttonPinUp1);
debouncer3.interval(5); // interval in ms
debouncer4.attach(buttonPinDn1);
debouncer4.interval(5); // interval in ms
debouncer5.attach(saveButton);
debouncer5.interval(5); // interval in ms
debouncer6.attach(toggleButton);
debouncer6.interval(5);

     pinMode(A0, OUTPUT);
     pinMode(A1, OUTPUT);
     pinMode(A8, INPUT);
     pinMode(A9, OUTPUT);

     
     pinMode(2, INPUT);
     pinMode(3, INPUT);
     pinMode(14, INPUT);
     pinMode(16, INPUT);
     pinMode(20, INPUT);
     pinMode(17, INPUT);
   for( int x=22; x<53; x++) {
    pinMode(x, OUTPUT);
    }
}
void muxWrite() {
  for (int thisPin = 0; thisPin < 4; thisPin++) {
    int pinState = bitRead(thisChannel, thisPin);
    digitalWrite(channel[thisPin],pinState);
    }
 }

void muxWrite1() {
  for (int thisPin1 = 0; thisPin1 < 4; thisPin1++) {
    int pinState1 = bitRead(thisChannel1, thisPin1);
    digitalWrite(channel1[thisPin1],pinState1);
    }
  }

void loop() {                                             
debouncer1.update();
debouncer2.update();
debouncer3.update();
debouncer4.update();
debouncer5.update();
debouncer6.update();

int value1 = debouncer1.read();
int value2 = debouncer2.read();
int value3 = debouncer3.read();
int value4 = debouncer4.read();
int value5 = debouncer5.read();
int value6 = debouncer6.read();

if (MIDI.read()){
  int type = MIDI.getType();
  number =  MIDI.getData1();
  number2 = number + 128;
  numberLed1 = number + 256;
    if (type == 0xC0) {     
       thisChannel = (EEPROM.read(number));
       thisChannel1 = (EEPROM.read(number2));
       Led = (EEPROM.read(numberLed1));
         if (Led == 0){digitalWrite(A9, LOW);}
         if (Led == 1){digitalWrite(A9, HIGH);}
       }
                 
}




buttonStateUp = digitalRead(buttonPinUp);
buttonStateDn = digitalRead(buttonPinDn);
buttonStateUp1 = digitalRead(buttonPinUp1);
buttonStateDn1 = digitalRead(buttonPinDn1);

if (thisChannel>31){thisChannel=31;}
if (thisChannel<0){thisChannel=0;}

if (thisChannel < 32 && thisChannel > -1) {
  if ( buttonStateUp == HIGH && value1 == LOW ) {
    thisChannel++;
    if (thisChannel>31){thisChannel=31;}
  }
  if ( buttonStateDn == HIGH && value2 == LOW ) {
    thisChannel--;
    if (thisChannel<0){thisChannel=0;}
  }
  muxWrite();
  if (thisChannel >= 16 && thisChannel <= 31 ){digitalWrite(A0, HIGH);}
  if (thisChannel <= 15 && thisChannel >= 0 ) {digitalWrite(A0, LOW);}
 
}

if (thisChannel1>31){thisChannel1=31;}
if (thisChannel1<0){thisChannel1=0;}

if (thisChannel1 < 32 && thisChannel1 > -1) {
  if ( buttonStateUp1 == HIGH && value3 == LOW ) {
    thisChannel1++;
    if (thisChannel1>31){thisChannel1=31;}
  }
  if ( buttonStateDn1 == HIGH && value4 == LOW ) {
    thisChannel1--;
    if (thisChannel1<0){thisChannel1=0;}
  }
  muxWrite1();
  if (thisChannel1 >= 16 && thisChannel1 <= 31 ){digitalWrite(A1, HIGH);}
  if (thisChannel1 <= 15 && thisChannel1 >= 0 ) {digitalWrite(A1, LOW);}
}

toggleState = digitalRead(toggleButton);   //  momentary switch to control a led

if (toggleState == HIGH && value6 == LOW){
  stateLed = digitalRead(toggleLed);
    if (stateLed == HIGH){
        digitalWrite(A9, LOW);
        Led = 0;
    }
    if (stateLed == LOW){
      digitalWrite(A9, HIGH);
      Led = 1;
    }
}
// write the new values to EEPROM
savebuttonState = digitalRead(saveButton);
  if (savebuttonState == HIGH && value5 == LOW) {
    EEPROM.update(number, thisChannel);
    EEPROM.update(number2, thisChannel1);
    EEPROM.update(numberLed1, Led);
    }
delay(50);
}

Bentfx

#37
Jan 10, 2017, 08:36 pm Last Edit: Jan 10, 2017, 09:44 pm by Bentfx
i need to understand the EEPROM...

i have a atmega 2560 with 4KB...
so it's 4096 bytes of memory...
1 byte of memory stores an 8-bit unsigned number (from 0 to 255).

in my case:
- I store a channel number (thisChannel) from 0 to 31 in a byte.
- the adress of this byte is the number of the PC# (number) that have a value between 0 to 127.
     - so adress 0 (PC#0) can have value 3 (if thisChannel is on 3)
     - adress 8 (PC#8) can have a value of 27 (if thisChannel is on 27)
     - etc...
- number2 = number + 128);  will save a channel number (thisChannel1) from 0 to 31 in a byte, that will have a adress between 128 to 255...
- so bottom line, i have 4096 bytes with a adress from 0 to 4096.

do i understand well?

Code: [Select]
#include <Bounce2.h>

#include <EEPROM.h>

#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();


Bounce debouncer1 = Bounce();
Bounce debouncer2 = Bounce();
Bounce debouncer3 = Bounce();
Bounce debouncer4 = Bounce();
Bounce debouncer5 = Bounce();
Bounce debouncer6 = Bounce();


byte number;
byte number2;
byte numberLed1;
byte Led;

int buttonPinDn  = 2;
int buttonPinUp  = 3;
int buttonPinDn1  = 16;
int buttonPinUp1  = 17;

int saveButton = 20;
int savebuttonState = 0;

const int toggleButton = A8;
int toggleState;
const int toggleLed = A9;
int stateLed = 0;

int buttonStateUp = 0;
int buttonStateDn = 0;
byte thisChannel;
int channel [4] = {22, 23, 24, 25};
int buttonStateUp1 = 0;
int buttonStateDn1 = 0;
byte thisChannel1;
int channel1 [4] = {46, 47, 48, 49};

void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);

debouncer1.attach(buttonPinUp);
debouncer1.interval(5); // interval in ms
debouncer2.attach(buttonPinDn);
debouncer2.interval(5); // interval in ms
debouncer3.attach(buttonPinUp1);
debouncer3.interval(5); // interval in ms
debouncer4.attach(buttonPinDn1);
debouncer4.interval(5); // interval in ms
debouncer5.attach(saveButton);
debouncer5.interval(5); // interval in ms
debouncer6.attach(toggleButton);
debouncer6.interval(5);

     pinMode(A0, OUTPUT);
     pinMode(A1, OUTPUT);
     pinMode(A8, INPUT);
     pinMode(A9, OUTPUT);

     
     pinMode(2, INPUT);
     pinMode(3, INPUT);
     pinMode(14, INPUT);
     pinMode(16, INPUT);
     pinMode(20, INPUT);
     pinMode(17, INPUT);
   for( int x=22; x<53; x++) {
    pinMode(x, OUTPUT);
    }
}
void muxWrite() {
  for (int thisPin = 0; thisPin < 4; thisPin++) {
    int pinState = bitRead(thisChannel, thisPin);
    digitalWrite(channel[thisPin],pinState);
    }
 }

void muxWrite1() {
  for (int thisPin1 = 0; thisPin1 < 4; thisPin1++) {
    int pinState1 = bitRead(thisChannel1, thisPin1);
    digitalWrite(channel1[thisPin1],pinState1);
    }
  }

void loop() {                                             
debouncer1.update();
debouncer2.update();
debouncer3.update();
debouncer4.update();
debouncer5.update();
debouncer6.update();

int value1 = debouncer1.read();
int value2 = debouncer2.read();
int value3 = debouncer3.read();
int value4 = debouncer4.read();
int value5 = debouncer5.read();
int value6 = debouncer6.read();

if (MIDI.read()){
  int type = MIDI.getType();
  number =  MIDI.getData1();
  number2 = number + 128;
  numberLed1 = number + 256;
    if (type == 0xC0) {     
       thisChannel = (EEPROM.read(number));
       thisChannel1 = (EEPROM.read(number2));
       Led = (EEPROM.read(numberLed1));
         if (Led == 0){digitalWrite(A9, LOW);}
         if (Led == 1){digitalWrite(A9, HIGH);}
       }           
}




buttonStateUp = digitalRead(buttonPinUp);
buttonStateDn = digitalRead(buttonPinDn);
buttonStateUp1 = digitalRead(buttonPinUp1);
buttonStateDn1 = digitalRead(buttonPinDn1);

if (thisChannel>31){thisChannel=31;}
if (thisChannel<0){thisChannel=0;}

if (thisChannel < 32 && thisChannel > -1) {
 
  if ( buttonStateUp == HIGH && value1 == LOW ) {
    thisChannel++;
    if (thisChannel>31){thisChannel=31;}
   
  }
  if ( buttonStateDn == HIGH && value2 == LOW ) {
    thisChannel--;
    if (thisChannel<0){thisChannel=0;}
   
  }
  muxWrite();
  if (thisChannel >= 16 && thisChannel <= 31 ){digitalWrite(A0, HIGH);}
  if (thisChannel <= 15 && thisChannel >= 0 ) {digitalWrite(A0, LOW);}
 
}

if (thisChannel1>31){thisChannel1=31;}
if (thisChannel1<0){thisChannel1=0;}

if (thisChannel1 < 32 && thisChannel1 > -1) {
 
  if ( buttonStateUp1 == HIGH && value3 == LOW ) {
    thisChannel1++;
    if (thisChannel1>31){thisChannel1=31;}
   
  }
  if ( buttonStateDn1 == HIGH && value4 == LOW ) {
    thisChannel1--;
    if (thisChannel1<0){thisChannel1=0;}
   
  }
  muxWrite1();
  if (thisChannel1 >= 16 && thisChannel1 <= 31 ){digitalWrite(A1, HIGH);}
  if (thisChannel1 <= 15 && thisChannel1 >= 0 ) {digitalWrite(A1, LOW);}
}

toggleState = digitalRead(toggleButton);   //  momentary switch to control a led

if (toggleState == HIGH && value6 == LOW){
  stateLed = digitalRead(toggleLed);
    if (stateLed == HIGH){
        digitalWrite(A9, LOW);
        Led = 0;
    }
    if (stateLed == LOW){
      digitalWrite(A9, HIGH);
      Led = 1;
    }
}
// write the new values to EEPROM
savebuttonState = digitalRead(saveButton);
  if (savebuttonState == HIGH && value5 == LOW) {
    EEPROM.update(number, thisChannel);
    EEPROM.update(number2, thisChannel1);
    EEPROM.update(numberLed1, Led);
    }
delay(50);
}


bent

Bentfx

just found out a new rule!
ALWAYS verify if your mechanical switch works great...... >:(
just found out that my switch have a malfunction...
first test seem's that the program is OK..


i'll make some mopre test

Bentfx

alright....
it was working, and i try to add another channel.... but it doesn't save...
Code: [Select]
#include <Bounce2.h>

#include <EEPROM.h>

#include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();


Bounce debouncer1 = Bounce();//up
Bounce debouncer2 = Bounce();//dn
Bounce debouncer3 = Bounce();//up1
Bounce debouncer4 = Bounce();//dn1
Bounce debouncer5 = Bounce();//save
Bounce debouncer6 = Bounce();//toggle
//Bounce debouncer7 = Bounce();//up2
//Bounce debouncer8 = Bounce();//dn2
//Bounce debouncer9 = Bounce();//toggle1


byte number;
byte number1;
//byte number2;

byte numberLed;
//byte numberLed1;

byte Led;
//byte Led1;

int buttonPinDn = 2;
int buttonPinUp = 3;
int buttonPinDn1 = 4;
int buttonPinUp1 = 5;
//int buttonPinUp2 = 6;
//int buttonPinDn2 = 7;


int saveButton = 20;
int savebuttonState = 0;



const int toggleButton = A8;
int toggleState;
const int toggleLed = A9;
int stateLed = 0;

//const int toggleButton1= A10;
//int toggleState1;
//const int toggleLed1 = A11;
//int stateLed1 = 0;



int buttonStateUp = 0;
int buttonStateDn = 0;
byte thisChannel;
int channel [4] = {22, 23, 24, 25};

int buttonStateUp1 = 0;
int buttonStateDn1 = 0;
byte thisChannel1;
int channel1 [4] = {26, 27, 28, 29};

//int buttonStateUp2 = 0;
//int buttonStateDn2 = 0;
//byte thisChannel2;
//int channel2 [4] = {30, 31, 32, 33};


void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);

debouncer1.attach(buttonPinUp);
debouncer1.interval(5); // interval in ms
debouncer2.attach(buttonPinDn);
debouncer2.interval(5); // interval in ms
debouncer3.attach(buttonPinUp1);
debouncer3.interval(5); // interval in ms
debouncer4.attach(buttonPinDn1);
debouncer4.interval(5); // interval in ms
debouncer5.attach(saveButton);
debouncer5.interval(5); // interval in ms
debouncer6.attach(toggleButton);
debouncer6.interval(5);
//debouncer7.attach(buttonPinUp2);
//debouncer7.interval(5);
//debouncer8.attach(buttonPinDn2);
//debouncer8.interval(5);
//debouncer9.attach(toggleButton1);
//debouncer9.interval(5);

     pinMode(A0, OUTPUT);
     pinMode(A1, OUTPUT);
     //pinMode(A2, OUTPUT);
     
     pinMode(A8, INPUT);
     pinMode(A9, OUTPUT);
     //pinMode(A10, INPUT);
     //pinMode(A11, OUTPUT);

     pinMode(13, OUTPUT);  //-----test save ----
     
     pinMode(2, INPUT);
     pinMode(3, INPUT);
     pinMode(4, INPUT);
     pinMode(5, INPUT);
    // pinMode(6, INPUT);
    // pinMode(7, INPUT);
     pinMode(14, INPUT);
     pinMode(16, INPUT);
     pinMode(20, INPUT);
     pinMode(17, INPUT);
     
   for( int x=22; x<53; x++) {
    pinMode(x, OUTPUT);
    }
}
void muxWrite() {
  for (int thisPin = 0; thisPin < 4; thisPin++) {
    int pinState = bitRead(thisChannel, thisPin);
    digitalWrite(channel[thisPin],pinState);
    }
 }

void muxWrite1() {
  for (int thisPin1 = 0; thisPin1 < 4; thisPin1++) {
    int pinState1 = bitRead(thisChannel1, thisPin1);
    digitalWrite(channel1[thisPin1],pinState1);
    }
  }

//void muxWrite2() {
  //for (int thisPin2 = 0; thisPin2 < 4; thisPin2++) {
    //int pinState2 = bitRead(thisChannel2, thisPin2);
    //digitalWrite(channel2[thisPin2],pinState2);
    //}
  //}

void loop() {                                             
debouncer1.update();
debouncer2.update();
debouncer3.update();
debouncer4.update();
debouncer5.update();
debouncer6.update();
//debouncer7.update();
//debouncer8.update();
//debouncer9.update();

int value1 = debouncer1.read();
int value2 = debouncer2.read();
int value3 = debouncer3.read();
int value4 = debouncer4.read();
int value5 = debouncer5.read();
int value6 = debouncer6.read();
//int value7 = debouncer7.read();
//int value8 = debouncer8.read();
//int value9 = debouncer9.read();



if (MIDI.read()){
 
  int type = MIDI.getType();
  number =  MIDI.getData1();
  number1 = number + 128;
  //number2 = number + 256;
  numberLed = number + 1152;
  //numberLed1 = number + 1280;
    if (type == 0xC0) {     
       thisChannel = (EEPROM.read(number));
       thisChannel1 = (EEPROM.read(number1));
       //thisChannel2 = (EEPROM.read(number2));
       Led = (EEPROM.read(numberLed));
         if (Led == 0){digitalWrite(A9, LOW);}
         if (Led == 1){digitalWrite(A9, HIGH);}
       //Led1 = (EEPROM.read(numberLed1));
          //if (Led1 == 0){digitalWrite(A11, LOW);}
          //if (Led1 == 1){digitalWrite(A11, HIGH);}
    }
                 
}




buttonStateUp = digitalRead(buttonPinUp);
buttonStateDn = digitalRead(buttonPinDn);
buttonStateUp1 = digitalRead(buttonPinUp1);
buttonStateDn1 = digitalRead(buttonPinDn1);
//buttonStateUp2 = digitalRead(buttonPinUp2);
//buttonStateDn2 = digitalRead(buttonPinDn2);

if (thisChannel>31){thisChannel=31;}
if (thisChannel<0){thisChannel=0;}
if (thisChannel < 32 && thisChannel > -1) { 
  if ( buttonStateUp == HIGH && value1 == LOW ) {
    thisChannel++;
    if (thisChannel>31){thisChannel=31;}
  }
  if ( buttonStateDn == HIGH && value2 == LOW ) {
    thisChannel--;
    if (thisChannel<0){thisChannel=0;}
  }
  muxWrite();
  if (thisChannel >= 16 && thisChannel <= 31 ){digitalWrite(A0, HIGH);}
  if (thisChannel <= 15 && thisChannel >= 0 ) {digitalWrite(A0, LOW);}
}

if (thisChannel1>31){thisChannel1=31;}
if (thisChannel1<0){thisChannel1=0;}
if (thisChannel1 < 32 && thisChannel1 > -1) {
  if ( buttonStateUp1 == HIGH && value3 == LOW ) {
    thisChannel1++;
    if (thisChannel1>31){thisChannel1=31;}
  }
  if ( buttonStateDn1 == HIGH && value4 == LOW ) {
    thisChannel1--;
    if (thisChannel1<0){thisChannel1=0;}
  }
  muxWrite1();
  if (thisChannel1 >= 16 && thisChannel1 <= 31 ){digitalWrite(A1, HIGH);}
  if (thisChannel1 <= 15 && thisChannel1 >= 0 ) {digitalWrite(A1, LOW);}
}

//if (thisChannel2>31){thisChannel2=31;}
//if (thisChannel2<0){thisChannel2=0;}
//if (thisChannel2 < 32 && thisChannel2 > -1){
  //if ( buttonStateUp2 == HIGH && value7 == LOW){
    //thisChannel2++;
     //if (thisChannel2>31){thisChannel2=31;}
  //}
  //if ( buttonStateDn2 == HIGH && value8 == LOW) {
    //thisChannel2--;
    //if (thisChannel2<0){thisChannel2=0;}
  //}
  //muxWrite2();
  //if (thisChannel2 >= 16 && thisChannel2 <= 31) {digitalWrite(A2, HIGH);}
  //if (thisChannel2 <= 15 && thisChannel2 >= 0 ) {digitalWrite(A2, LOW);}
  //}





toggleState = digitalRead(toggleButton);   //  momentary switch to control a led
//toggleState1 = digitalRead(toggleButton1);

if (toggleState == HIGH && value6 == LOW){
  stateLed = digitalRead(toggleLed);
    if (stateLed == HIGH){
        digitalWrite(A9, LOW);
        Led = 0;
    }
    if (stateLed == LOW){
      digitalWrite(A9, HIGH);
      Led = 1;
    }
}

//if (toggleState1 == HIGH && value9 == LOW){
  //stateLed1 = digitalRead(toggleLed1);
    //if (stateLed1 == HIGH){
        //digitalWrite(A11, LOW);
        //Led1 = 0;
    //}
    //if (stateLed1 == LOW){
      //digitalWrite(A11, HIGH);
      //Led1 = 1;
    //}
//}




// write the new values to EEPROM
savebuttonState = digitalRead(saveButton);
  if (savebuttonState == HIGH && value5 == LOW) {
    digitalWrite(13, HIGH);
    EEPROM.update(number, thisChannel);
    EEPROM.update(number1, thisChannel1);
    //EEPROM.update(number2, thisChannel2);
    EEPROM.update(numberLed, Led);
    //EEPROM.update(numberLed1,Led1);
    delay(100);
    digitalWrite(13, LOW);
    }
delay(50);
}


after a few test I found out, that the:
numberLed = number + 1152;
is not working...if I change to:
numberLed = number + 256;
then it save...
so i really have a problem with the understanding of EEPROM

Bentfx

#40
Jan 11, 2017, 09:58 pm Last Edit: Jan 11, 2017, 10:39 pm by Bentfx
i think i will have to change my approach..

i will use some kind of mapping....

Bentfx

#41
Jan 11, 2017, 11:13 pm Last Edit: Jan 11, 2017, 11:19 pm by Bentfx
IT'S ALIVE!!!! YES YES ....!!!!!

made those change and solve the problem!
Code: [Select]
if (MIDI.read()){
 
  int type = MIDI.getType();
  number =  MIDI.getData1();
      if (type == 0xC0) {    
       thisChannel = (EEPROM.read(number));
       thisChannel1 = (EEPROM.read(number+1000));
      
       Led = (EEPROM.read(number+2000));
         if (Led == 0){digitalWrite(A9, LOW);}
         if (Led == 1){digitalWrite(A9, HIGH);}
      }
                
}

// write the new values to EEPROM
savebuttonState = digitalRead(saveButton);
  if (savebuttonState == HIGH && valuesave == LOW) {
    digitalWrite(13, HIGH);
    EEPROM.update(number, thisChannel);
    EEPROM.update(number+1000, thisChannel1);
    
    EEPROM.update(number+2000, Led);
    
    delay(100);
    digitalWrite(13, LOW);
    }
delay(50);
}



finally!!!!!!!!

Go Up