-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266のOverflowを調査 #39
Labels
Milestone
Comments
/***
/* 文字列をシリアル通信で送信し、格納データを表示するプログラム
/***
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++; }
}
} |
対処法
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景
ESP8266がOverflowを起こさないようにする。
目的
ESP8266が文字列を送った時に、Overflowを起こすかを調査
対応内容
期日
6/23
The text was updated successfully, but these errors were encountered: