title: I'm trying to make a morse code transmitter with the AtMega 32u4, but the microprocessor dosen't sees my input buttons and i don't know why?
body: <p>I have an Adafruit feather 32u4  LoRa transmitter, I want to make a digital Morse transmitter, I took the transmission code from the internet and decided to write my own code for the rest. The two transistors transmit to each other but the micro don sees my input buttons.</p>
  <pre><code>int StatoPrecP2 = 0;
  int i;
  char SendData;
  void loop()
  {
    switch (Stato) {
        StatoAttP1 = digitalRead(P_Riga);
        StatoAttP2 = digitalRead (P_Punto);
      case 0:
  
        if (StatoAttP1 == 1) /*&amp;&amp; (StatoPrecP1 != StatoAttP1 )) */{
          digitalWrite(ButtonRecived, HIGH);
          delay (250);
          digitalWrite(ButtonRecived, LOW);
          Stato = 1;
          SendData = &quot;.&quot;;
        }
        if ((StatoAttP2 == 1) &amp;&amp; (StatoPrecP2 != StatoAttP1)) {
          digitalWrite(ButtonRecived, 1);
          delay (250);
          digitalWrite(ButtonRecived, 0);
          Stato = 1;
          SendData = &quot;-&quot;;
        }
        if (rf95.available())
        {
          // Should be a message for us now
          uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
          uint8_t len = sizeof(buf);
  
          if (rf95.recv(buf, &amp;len))
          {
            digitalWrite(LED, HIGH);
            RH_RF95::printBuffer(&quot;Received: &quot;, buf, len);
            Serial.print(&quot;Got: &quot;);
            Serial.println((char*)buf);
            Serial.print(&quot;RSSI: &quot;);
            Serial.println(rf95.lastRssi(), DEC);
            if (*buf = &quot;.&quot;) {
              PORTF = PORTF | 0x20;
              delay(1000);
              PORTF = PORTF &amp; ~0x20;
            }
            else if (*buf = &quot;-&quot;) {
              PORTF = PORTF | 0x20;
              delay(2500);
              PORTF = PORTF &amp; ~0x20;
            }
          }
          else
          {
            Serial.println(&quot;Receive failed&quot;);
          }
        case 1:
          // Send a reply
          for (i = 0; i &lt; 5000; i++) {
            uint8_t data = SendData;
            rf95.send(data, sizeof(data));
            rf95.waitPacketSent();
            Serial.println(&quot;Sent a reply&quot;);
            digitalWrite(LED, LOW);
  
            if ((StatoAttP1 = 1) &amp; (StatoAttP1 != StatoPrecP1)) {
              PORTF = PORTF | 0x10;
              delay (250);
              PORTF = PORTF &amp; ~0x10;
              Stato = 1;
              uint8_t data[] = &quot;.&quot;;
              i = 0;
            }
            else if ((StatoAttP2 = 1) &amp; (StatoAttP2 != StatoPrecP2)) {
              PORTF = PORTF | 0x10;
              delay (250);
              PORTF = PORTF &amp; ~0x10;
              Stato = 1;
              uint8_t data[] = &quot;-&quot;;
              i = 0;
            }
            delay (1);
          }  
          Stato = 0;
        }
    }
        StatoPrecP1 = StatoAttP1;
        StatoPrecP2 = StatoAttP2;
  }
  </code></pre>