FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    ESP8266 is added to the C51 single-chip microchannel program

     

    ESP8266 microcontroller 51 connected to the local server assembler at89c2051 microcontroller, crystal 11.096MHZ, communication speed 9600, TCP multi-way connection, local connection address 192.168.1.107, send and receive data successfully Assembler as follows: This is main.c #include #include #include "usart.h" #include "wifi.h" char Recive_table [20] = ""; // receive buffer, a maximum of 20 bytes char Recive_state = 0; // receive completion flag int main (void) { / ******************** initialization function ********************************************************** / Uart_Init (); // initialize the serial port, 9600 ms_delay (1000); WIFI_Init (); // wifi initialization / ************************************************* *** / / ********************************************************** main loop ********************************************************* / for (;;) { ms_delay (10); if (Recive_state == 1) { ES = 0; // clear the receive flag if ((Recive_table [0] == '+') && (Recive_table [1] == 'I') && (Recive_table [2] == 'P')) // string is received + IPD, x, x: y { if ((Recive_table [3] == 'D') && (Recive_table [6] == ',')) { if (Recive_table [9] == '0') P1 = 0; if (Recive_table [9] == '1') P1 = 0xff; } } memset (Recive_table, '\ 0', 20); Recive_state = 0; ES = 1; // Open the receive flag } } / ************************************************* *** / } / ************************************************* ***************** Function: void Uart_Interrupt () interrupt 4 Function: the serial port interrupt handler to save the received character Recive_table [] array Parameters: None Return Value: None ************************************************** ***************** / void Uart_Interrupt () interrupt 4 { static char i = 0; // because it is a receiving one, so use static if (RI == 1) { ES = 0; RI = 0; Recive_table [i] = SBUF; i ++; if ((Recive_table [i-1] == '\ n')) { Recive_table [i] = '\ 0'; i = 0; Recive_state = 1; } ES = 1; } Else TI = 0; } This is usart.c #include "usart.h" / ************************************************* ***************** Function: void Uart_Init (void) Function: serial port initialization, 9600 (this will not, Internet Baidu) Parameters: None Return Value: None ************************************************** ***************** / void Uart_Init (void) { TMOD = 0x20; TH1 = 0xfD; TL1 = 0xfD; TR1 = 1; REN = 1; SM0 = 0; SM1 = 1; EA = 1; ES = 1; } This is wifi.c #include #include "wifi.h" / ************************************************* ***************** Letter number: void ms_delay (int t) Function: millisecond delay Parameters: None Return Value: None ************************************************** ***************** / void ms_delay (int t) { int i, j; for (i = t; i>0; i--) for (j = 110; j>0; j--); } / ************************************************* ***************** Letter number: void LED (void) After sending a command function for display: Function Parameters: None Return Value: None ************************************************** ***************** / void LED (void) { P1 = 0; ms_delay (100); P1 = 0xff; ms_delay (100); } / ************************************************* ***************** Letter number: void WIFI_Init (void) Function: wifi initialize (name: esp8266; password: 1234567890) Parameters: None Return Value: None ************************************************** ***************** / void WIFI_Init (void) { ES = 0; TI = 1; printf ( "AT + RST \ r \ n"); LED(); ms_delay (1000); printf ( "AT + CWMODE 3 \ r \ n ="); LED(); ms_delay (1000); printf ( "AT + CIPMUX = 1 \ r \ n"); LED(); ms_delay (1000); printf ( "AT + CIPSERVER 1,8080 \ r \ n ="); LED(); ms_delay (1000); while (TI!); TI = 0; ES = 1; } This paper reviews the Source: CSDN Edit: ymf, Read more

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us