Last active
April 15, 2018 04:24
-
-
Save TakehikoShimojima/24348b14a6680e61d599b4e9e011578b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <ESP8266WiFi.h> | |
| #include <SoftwareSerial.h> | |
| static const int RXPin = 2, TXPin = 12; // ソフトシリアルのピンの指定 | |
| SoftwareSerial ss(RXPin, TXPin, false, 256); // ソフトシリアルのオブジェクト | |
| void setup() | |
| { | |
| Serial.begin(115200); | |
| delay(20); | |
| Serial.println("\r\nGPS test"); | |
| ss.begin(9600); // ソフトシリアルの初期化 | |
| } | |
| void loop() | |
| { | |
| while (ss.available() > 0) { // ソフトシリアルに文字があるあいだ | |
| Serial.write(ss.read()); // ソフトシリアルから読んで、普通のシリアルにコピーする | |
| delay(0); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment