BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

My magic blynk keyboard

this is my alphanumeric keyboard :wink::wink::wink:

com-gif-maker

10 Likes

retro style :wink: like in the 3210 era…
nice coding exercise, by the way!

I’m amazed, that actually your every touch sends a message to :cloud: and gets it delivered back. And you don’t even see a lag.

Isn’t it pure magic? :heart_eyes:

Next comes predictive text insertion and all the resulting hilarity :wink:

there is no lag
no flood
no disconnection
and it’s not used to write a text no more to play angry bird with Gunner.:joy::joy:
it’s only an alarm keyboard , like all alarm keyboard.
but thank you so much for your support, indeed.
I’m amazed to read such comments !

:joy::joy::joy::joy::joy:

2 Likes

Indeed Very good!
Is it possible to share your code with us?

the only guy interested in my job :wink::wink:
thanks you !
I will share my code soon
I will make others laugh, for sure !
:joy::joy::joy:

I hope it is not a simple terminal to IDE Serial monitor redirect, with a trained monkey on the PC keyboard at the other end doing all the “logic” :stuck_out_tongue_winking_eye:

no terminal, no keyboard, no predictive text
just Blynk , timers , flags and a lot of hard work !
:wink::wink::wink:

Getting caught! :wink:

:joy::joy::joy::joy::joy::joy::joy::joy:

Hi there @Blynk_Coeur I feel cheeky asking but I can’t see where if you posted the code for the magic keyboard? :slight_smile:

And yes I realise I have resurrected a 2yr old post :skull:

1 Like

Did you see @GTT’s version…

Pete.

2 Likes

Hey Pete, I did see that and am looking at it. I wondered what the different approaches were. Maybe it’s still a trade secret :joy:

1 Like

@Blynk_Coeur could tell you, but then…:zap::zap::zap:
:frowning:

Pete.

1 Like

I don’t know where I posted my code too :rofl:
but regarding @GTT version, his code is very similar and better than mine.
as I’m using Nextion display to emulate keycode alarm , I don’t use Blynk interface ,and it was so ugly :rofl:

1 Like

I just found it !!

BLYNK_WRITE(V48) // alarm ENTER
{
  timer.enable (T1);
  Serial.println("*******************************************");
  Serial.println(currentTime);
  Serial.println("Alarm");
  Serial.println("*******************************************");
  Serial.println("");

  if (param.asInt()) {
    // button pressed

    Blynk.setProperty(V47, "color", BLYNK_GREEN);
    lcd2.clear();
    raw = 1;
    col = 0;
    keypress = 1;

    if (code != "") {


      if (code == PASS) {
        lcd2.print(0, 0, "Alarm ON");
      }
      else {
        Blynk.setProperty(V47, "color", BLYNK_RED);
        lcd2.print(0, 0, "ERREUR CODE");
        lcd2.print(0, 1, "APPUYEZ SUR CLR");

      }
    }
    else {
      Blynk.setProperty(V47, "color", BLYNK_GREEN);
      lcd2.clear();
      lcd2.print(0, 0, "Entrez le code");
      code = "";
      raw = 1;
      col = 0;
      keypress = 1;
    }

  }
}


/************************************************************/
BLYNK_WRITE(V49) // alarm code CE/CLR
{
  if (param.asInt()) {
    // button 0 pressed

    switch (keypress) {

      case 1://CE
        timer.deleteTimer(AlarmTimer);
        //AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 10;
        col = col - 1;
        if (col < 0) {
          col = 1;
        }
        key = "";
        lcd2.print(col, raw, "_ ");
        break;

      case 2://CLR
        timer.deleteTimer(AlarmTimer);
        //AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 10;
        Blynk.setProperty(V47, "color", BLYNK_GREEN);
        lcd2.clear();
        lcd2.print(0, 0, "Entrez le code");
        code = "";
        raw = 1;
        col = 0;
        keypress = 1;
        break;
    }
  }
}


/************************************************************/
BLYNK_WRITE(V51) // alarm code 1
{
  if (param.asInt()) {
    // button 1 pressed

    switch (keypress) {
      case 1:
        //timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 1;
        key = "1";
        Code[col] = {'1'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 1;
        key = " ";
        Code[col] = {' '};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V52) // alarm code 2
{
  if (param.asInt()) {
    // button 2 pressed

    switch (keypress) {
      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 2;
        key = "2";
        Code[col] = {'2'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 2;
        key = "A";
        Code[col] = {'A'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 2;
        key = "B";
        Code[col] = {'B'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 2;
        key = "C";
        Code[col] = {'C'};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V53) // alarm code 3
{
  if (param.asInt()) {
    // button 3 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 3;
        key = "3";
        Code[col] = {'3'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 3;
        key = "D";
        Code[col] = {'D'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 3;
        key = "E";
        Code[col] = {'E'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 3;
        key = "F";
        Code[col] = {'F'};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V54) // alarm code 4
{
  if (param.asInt()) {
    // button 4 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 4;
        key = "4";
        Code[col] = {'4'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 4;
        key = "G";
        Code[col] = {'D'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 4;
        key = "H";
        Code[col] = {'H'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 4;
        key = "I";
        Code[col] = {'I'};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V55) // alarm code 5
{
  if (param.asInt()) {
    // button 5 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 5;
        key = "5";
        Code[col] = {'5'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 5;
        key = "J";
        Code[col] = {'J'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 5;
        key = "K";
        Code[col] = {'K'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 5;
        key = "L";
        Code[col] = {'L'};
        break;
    }

    lcdprint();
  }
}


/************************************************************/
BLYNK_WRITE(V56) // alarm code 6
{
  if (param.asInt()) {
    // button 6 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 6;
        key = "6";
        Code[col] = {'6'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 6;
        key = "M";
        Code[col] = {'M'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 6;
        key = "N";
        Code[col] = {'N'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 6;
        key = "O";
        Code[col] = {'O'};
        break;
    }

    lcdprint();
  }
}


/************************************************************/
BLYNK_WRITE(V57) // alarm code 7
{
  if (param.asInt()) {
    // button 7 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 7;
        key = "7";
        Code[col] = {'7'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 7;
        key = "P";
        Code[col] = {'P'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 7;
        key = "Q";
        Code[col] = {'Q'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 7;
        key = "R";
        Code[col] = {'R'};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V58) // alarm code 8
{
  if (param.asInt()) {
    // button 8 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 8;
        key = "8";
        Code[col] = {'8'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 8;
        key = "T";
        Code[col] = {'T'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 8;
        key = "U";
        Code[col] = {'U'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 8;
        key = "V";
        Code[col] = {'V'};
        break;
    }

    lcdprint();
  }
}

/************************************************************/
BLYNK_WRITE(V59) // alarm code 9
{
  if (param.asInt()) {
    // button 9 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 9;
        key = "9";
        Code[col] = {'9'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 9;
        key = "W";
        Code[col] = {'W'};
        break;

      case 3:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 9;
        key = "X";
        Code[col] = {'X'};
        break;

      case 4:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress = 1;
        lastkeypress = 9;
        key = "Y";
        Code[col] = {'Y'};
        break;
    }

    lcdprint();
  }
}


/************************************************************/
BLYNK_WRITE(V50) // alarm code 0
{
  if (param.asInt()) {
    // button 0 pressed

    switch (keypress) {

      case 1:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 0;
        key = "0";
        Code[col] = {'0'};
        break;

      case 2:
        timer.deleteTimer(AlarmTimer);
        AlarmTimer = timer.setTimeout(AlarmTimeout, nextDetect);
        keypress++;
        lastkeypress = 2;
        key = "OPEN";
        Code[col] = {'OPEN'};
        break;

    }

    lcdprint();
  }
}


/************************************************************/
void lcdprint() {

  lcd2.print(col, raw, key);
  Serial.println("keypress " + String(keypress) + " lastkeypress " + String(lastkeypress) + " Col " + String(col) + " key " + key + " Code[col] "  + String(Code[col]));
  Serial.println("");

}


/************************************************************/
void nextDetect() { //col +1
  timer.deleteTimer(AlarmTimer);
  Serial.println("next");
  keypress = 1;
  col++;
  lcd2.print(col, raw, "_");
}
3 Likes

@Blynk_Coeur It all helps seeing different approaches.

Many thanks :+1:

1 Like

You are welcome !