From 7c96417ffeaf99a1711313f689a551d19cd010f8 Mon Sep 17 00:00:00 2001 From: vany5921 <908744431@qq.com> Date: Tue, 10 Dec 2019 10:19:40 +0800 Subject: [PATCH] add nb-iot and lte --- docs/en/module/lte.md | 47 +--------------------------------- docs/en/module/nb-iot.md | 50 +------------------------------------ docs/zh_CN/module/lte.md | 49 +----------------------------------- docs/zh_CN/module/nb-iot.md | 50 +------------------------------------ 4 files changed, 4 insertions(+), 192 deletions(-) diff --git a/docs/en/module/lte.md b/docs/en/module/lte.md index 3d02f36b..57e2e03c 100644 --- a/docs/en/module/lte.md +++ b/docs/en/module/lte.md @@ -95,53 +95,8 @@ Product Feature: ### 1. Arduino IDE -*To get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LTE/Arduino).* +*To get complete code, please click [here](https://github.com/m5stack/M5Stack/blob/master/examples/Modules/LTE/LTE.ino).* -```arduino -#include - -void IotWriteCommand(char cmd[],char date[]){ - char buf[256] = {0}; - - if(cmd == NULL) - sprintf(buf,"AT\r\n"); - else if(date == NULL) - sprintf(buf,"AT+%s\r\n",cmd); - else - sprintf(buf,"AT+%s=%s\r\n",cmd,date); - - Serial2.write(buf); -} - -void get_time(void){ - IotWriteCommand(NULL,NULL); - while(Serial2.available()){ - uint8_t ch = Serial2.read(); - Serial.write(ch); - M5.Lcd.write(ch); - } -} - -void setup() { - M5.begin(); - - Serial.begin(115200); - Serial2.begin(115200, SERIAL_8N1, 16, 17); - pinMode(2, OUTPUT); - digitalWrite(2, 0); - delay(3000); - digitalWrite(2, 1); -} - -void loop() { - if(M5.BtnA.wasReleased()){ - M5.Lcd.fillScreen(TFT_BLACK); - M5.Lcd.setCursor(60,80,2); - get_time(); - } - M5.update(); -} -``` ### Pin Map diff --git a/docs/en/module/nb-iot.md b/docs/en/module/nb-iot.md index ae95ef35..b7720a6c 100644 --- a/docs/en/module/nb-iot.md +++ b/docs/en/module/nb-iot.md @@ -123,55 +123,7 @@ only for reference ### 1. Arduino IDE -*To get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/blob/master/Module/NB_IOT/Arduino/NB_IOT.ino).* - -```arduino -#include - -void IotWriteCommand(char cmd[],char date[]){ - char buf[256] = {0}; - - if(cmd == NULL) - sprintf(buf,"AT\r\n"); - else if(date == NULL) - sprintf(buf,"AT+%s\r\n",cmd); - else - sprintf(buf,"AT+%s=%s\r\n",cmd,date); - - Serial2.write(buf); -} - -void get_time(void){ - IotWriteCommand("CCLK?",NULL); - while(Serial2.available()){ - uint8_t ch = Serial2.read(); - Serial.write(ch); - M5.Lcd.write(ch); - } -} - -void setup() { - M5.begin(); - - Serial.begin(115200); - Serial2.begin(115200, SERIAL_8N1, 16, 17); - pinMode(2, OUTPUT); - digitalWrite(2, 0); - delay(3000); - digitalWrite(2, 1); -} - - -void loop() { - if(M5.BtnA.wasReleased()){ - M5.Lcd.fillScreen(TFT_BLACK); - M5.Lcd.setCursor(60,80,2); - get_time(); - } - M5.update(); -} - -``` +*To get complete code, please click [here]().* ### Pin Map diff --git a/docs/zh_CN/module/lte.md b/docs/zh_CN/module/lte.md index c77f5d3f..48c524a2 100644 --- a/docs/zh_CN/module/lte.md +++ b/docs/zh_CN/module/lte.md @@ -93,54 +93,7 @@ ### Arduino IDE -*以下代码仅为片段,如需获取完整代码, [请点击此处.](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/LTE/Arduino).* - -```arduino -#include - -void IotWriteCommand(char cmd[],char date[]){ - char buf[256] = {0}; - - if(cmd == NULL) - sprintf(buf,"AT\r\n"); - else if(date == NULL) - sprintf(buf,"AT+%s\r\n",cmd); - else - sprintf(buf,"AT+%s=%s\r\n",cmd,date); - - Serial2.write(buf); -} - -void get_time(void){ - IotWriteCommand(NULL,NULL); - while(Serial2.available()){ - uint8_t ch = Serial2.read(); - Serial.write(ch); - M5.Lcd.write(ch); - } -} - -void setup() { - M5.begin(); - - Serial.begin(115200); - Serial2.begin(115200, SERIAL_8N1, 16, 17); - pinMode(2, OUTPUT); - digitalWrite(2, 0); - delay(3000); - digitalWrite(2, 1); -} - -void loop() { - if(M5.BtnA.wasReleased()){ - M5.Lcd.fillScreen(TFT_BLACK); - M5.Lcd.setCursor(60,80,2); - get_time(); - } - M5.update(); -} -``` - +*以下代码仅为片段,如需获取完整代码, [请点击此处.](https://github.com/m5stack/M5Stack/blob/master/examples/Modules/LTE/LTE.ino).* ### 管脚映射 diff --git a/docs/zh_CN/module/nb-iot.md b/docs/zh_CN/module/nb-iot.md index 0132525b..65ef81c5 100644 --- a/docs/zh_CN/module/nb-iot.md +++ b/docs/zh_CN/module/nb-iot.md @@ -126,55 +126,7 @@ Middle East and North Africa: B8(900) and B20(800); --> ### Arduino IDE -*以下代码仅为片段,如需获取完整代码, [请点击此处.](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Module/NB_IOT/Arduino).* - -```arduino -#include - -void IotWriteCommand(char cmd[],char date[]){ - char buf[256] = {0}; - - if(cmd == NULL) - sprintf(buf,"AT\r\n"); - else if(date == NULL) - sprintf(buf,"AT+%s\r\n",cmd); - else - sprintf(buf,"AT+%s=%s\r\n",cmd,date); - - Serial2.write(buf); -} - -void get_time(void){ - IotWriteCommand("CCLK?",NULL); - while(Serial2.available()){ - uint8_t ch = Serial2.read(); - Serial.write(ch); - M5.Lcd.write(ch); - } -} - -void setup() { - M5.begin(); - - Serial.begin(115200); - Serial2.begin(115200, SERIAL_8N1, 16, 17); - pinMode(2, OUTPUT); - digitalWrite(2, 0); - delay(3000); - digitalWrite(2, 1); -} - - -void loop() { - if(M5.BtnA.wasReleased()){ - M5.Lcd.fillScreen(TFT_BLACK); - M5.Lcd.setCursor(60,80,2); - get_time(); - } - M5.update(); -} -``` - +*以下代码仅为片段,如需获取完整代码, [请点击此处.]().* ### 管脚映射