title: avr c: creating blink / beep sound based on characters in string
body: <p>I am trying to create beep sound from characters in the string.
  Here is the code:</p>
  
  <pre><code>/*
   * Buzzer connected to Arduino uno digital pin 13
   * Switch connected to digital pin 2
   */ 
  
  #include &lt;avr/io.h&gt;
  #include &lt;util/delay.h&gt;
  
  const int TBEEP = 1000;
  const int TBEEEEP = 3500;
  const int TGAP = 500;
  const int TGAPLETTER = 2000;
  int portb = 0x20;
  
  void beep() {
      PORTB = ~portb; _delay_ms(TGAP);
      PORTB = portb; _delay_ms(TBEEP);
      PORTB = ~portb; _delay_ms(TGAP);
  }
  
  void beeeep() {
      PORTB = ~portb; _delay_ms(TGAP);
      PORTB = portb; _delay_ms(TBEEEEP);
      PORTB = ~portb; _delay_ms(TGAP);
  }
  
  void gapLetter() {
      PORTB = ~portb; _delay_ms(TGAPLETTER);
  }
  
  void morse_S() {
      beep(); beep(); beep();
      gapLetter();
  }
  
  void morse_M() {
      beeeep(); beeeep();
      gapLetter();
  }
  
  void morse_SMS() {
      morse_S(); morse_M(); morse_S();
  }
  
  void morse(char theString[]) {
      for (int i = 0; theString[i] != '\0'; i++)
      {
          if(&amp;theString[i] == "S")
              morse_S();
          else if(&amp;theString[i] == "M")
              morse_M();
      }
  }
  
  int main (void)
  {
      DDRB = 0xFF;
      DDRD = 0x00;
      PORTD = 0x04;
  
      while (1) {
          if (PIND &amp; 0x04) {
              PORTB = ~0x20;
          } else {
              //morse_SMS(); // it works
              morse("SMS"); // this one doesnt work like morse_SMS() PLEASE HELP!
          }
      }
      return 0;
  }
  </code></pre>
  
  <p>In function <code>void morse(char theString[]) {...}</code>, I want to produce beep sound from every character in the string "SMS". Unfortunately, only the last character can make it.</p>
  
  <p>I am using Atmel Studio 6. When I build solution (F7) there is no error but warning which I dont understand (sorry for being such a total noob) </p>
  
  <blockquote>
    <p>comparison with string literal results in unspecified behavior [-Waddress]</p>
  </blockquote>
  
  <p>How to force every character to beep one after another?</p>