블루투스 작동시키기 |
|||||
---|---|---|---|---|---|
이름 | 지규선 | 등록일 | 16.07.24 | 조회수 | 48 |
#include SoftwareSerial mySerial(4, 5); // RX, TX void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } Serial.println("Goodnight moon!"); // set the data rate for the SoftwareSerial port mySerial.begin(115200); mySerial.println("Hello, world?"); } char data; void loop() { // run over and over if (mySerial.available()) { data = mySerial.read(); Serial.write(data); if (data == '1') { Serial.write("ok"); } } /* if (Serial.available()) { mySerial.write(Serial.read()); } */ }
|
다음글 | 눈송이 그리기 |
---|