- 3D-Druck Einstieg und Tipps         
Ergebnis 1 bis 3 von 3

Thema: RobotLoader: Wifi Terminal -> Kleinbuchstaben?

Baum-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #2
    Erfahrener Benutzer Robotik Einstein Avatar von Dirk
    Registriert seit
    30.04.2004
    Ort
    NRW
    Beiträge
    3.803
    Fehlte noch ...:

    Testprog.c
    Code:
    /*****************************************************************************/
    // Includes:
    #include "RP6M256Lib.h"      // The RP6 M256 Library. 
               // Always needs to be included!
    /*****************************************************************************/
    // Variables:
    // Reception buffer for the function getInputLine_WIFI():
    char receiveBufferWifi[UART_RECEIVE_BUFFER_SIZE_WIFI + 1];
    /*****************************************************************************/
    // WIFI receive functions:
    /**
     * Get chars of an input line from the WIFI.
     *
     * Returns 0 (false), if the WIFI receive buffer is empty
     * OR a character of the input line has been received.
     * Returns 1, if the whole input line has been received
     * (with a "new line" character at the end).
     * Returns 2, if the WIFI receive buffer overflows.
     * The input line is stored in the receiveBufferWifi array.
     *
     */
    uint8_t getInputLine_WIFI(void)
    {static uint16_t buffer_pos = 0;
     if(getBufferLength_WIFI()) {       
      receiveBufferWifi[buffer_pos] = readChar_WIFI();
      if((receiveBufferWifi[buffer_pos] == '\n')
       || (receiveBufferWifi[buffer_pos] == '\r')) {
       receiveBufferWifi[buffer_pos] = '\0';
       buffer_pos = 0;
       return 1;
      }
      else if(buffer_pos >= UART_RECEIVE_BUFFER_SIZE_WIFI) {         
       receiveBufferWifi[UART_RECEIVE_BUFFER_SIZE_WIFI] = '\0'; 
       buffer_pos = 0;
       return 2;
      }
      buffer_pos++;
     }
     return 0;
    }
    /**
     * Get a complete input line from the WIFI.
     *
     * This function waits for a whole input line from the WIFI.
     * The input line is stored in the receiveBuffer array.
     * The function is blocking until one of the two following
     * conditions occurs:
     * - A "new line" character has been received at the end of
     *   the input line.
     * - The WIFI receive buffer overflows.
     *
     */
    void enterString_WIFI(void)
    {
     while(!getInputLine_WIFI());
    }
    /*****************************************************************************/
    // Main function - The program starts here:
    int main(void)
    {
     initRP6M256();    // Always call this first! The Processor will not work
           // correctly otherwise. 
     initLCD(); // Initialize the LC-Display (LCD)
          // Always call this before using the LCD!
     setLEDs(0b0000);
     
     clearLCD(); // Clear the whole LCD Screen
    /*****************************************************************************/
    // Main test program:
     while(true)
     {
      writeString_P_WIFI("\n\n");
      writeString_P_WIFI("\n|============================|");
      writeString_P_WIFI("\n| WIFI: Input a test string  |\n");
      enterString_WIFI();
      clearLCD();
      writeStringLCD(receiveBufferWifi);
      mSleep(10000);
      writeString_P_WIFI("\n\n");
     }
    /*****************************************************************************/
    // End of main:
     return 0;
    }
    Geändert von Dirk (19.08.2012 um 08:05 Uhr)
    Gruß
    Dirk

Ähnliche Themen

  1. RobotLoader 2.3a
    Von SlyD im Forum Robby RP6
    Antworten: 44
    Letzter Beitrag: 01.05.2013, 10:15
  2. Frage zu Wifi Modul
    Von toter_fisch im Forum Elektronik
    Antworten: 0
    Letzter Beitrag: 06.08.2012, 14:04
  3. RP6v2 M256 WiFi !?
    Von Dirk im Forum Robby RP6
    Antworten: 20
    Letzter Beitrag: 11.05.2012, 19:27
  4. ARM für WiFi steuerung ?
    Von fat tony im Forum ARM - 32-bit-Mikrocontroller-Architektur
    Antworten: 5
    Letzter Beitrag: 03.01.2010, 13:57
  5. Wifi Roboter
    Von newName im Forum Allgemeines zum Thema Roboter / Modellbau
    Antworten: 4
    Letzter Beitrag: 16.01.2008, 13:51

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

fchao-Sinus-Wechselrichter AliExpress