Open hiyanaka opened 7 years ago
/***
/* 文字列をシリアル通信で送信し、格納データを表示するプログラム
/***
char input[30]; // 文字列格納用
int i = 0; // 文字数のカウンタ
void setup() {
Serial.begin(9600);
}
void loop() {
// データ受信したとき
if (Serial.available()) {
input[i] = Serial.read();
// 文字数が30以上 or 末尾文字
if (i > 30 || input[i] == '.') {
// 末尾に終端文字の挿入
input[i] = '\0';
// 受信文字列を送信
Serial.write(input);
Serial.write("\n");
// 格納されたデータ数を表示
Serial.println(i);
}
else { i++; }
}
}
背景
ESP8266がOverflowを起こさないようにする。
目的
ESP8266が文字列を送った時に、Overflowを起こすかを調査
対応内容
期日
6/23