Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
feather-m0/UltimateGPS-Test/main.cpp
#include <cox.h>
#define GPS_EN A5
void setup() {
Serial0.begin(115200);
#ifdef GPS_EN
pinMode(GPS_EN, OUTPUT);
digitalWrite(GPS_EN, LOW);
#endif
Serial2.begin(9600);
Serial2.onReceive([](SerialPort &p) {
while (p.available() > 0) {
char c = p.read();
Serial0.write(c);
}
});
Serial2.listen();
}
시리얼 포트를 제어하기 위한 클래스
Definition SerialPort.hpp:76
virtual int read()
포트 내부 버퍼에 수신된 문자를 하다 꺼냅니다.
virtual int available()
포트 내부 수신버퍼에 수신된 문자의 갯수를 반환합니다.
API and definitions.
bool digitalWrite(int8_t pin, int value)
pin 를 HIGH 또는 LOW 로 설정합니다.
bool pinMode(int8_t pin, enum ioDirection direction)
pin 을 direction 방향을 갖는 디지털 핀으로 동작하도록 설정합니다.
@ OUTPUT
Definition nola-common.h:383
SerialPort & Serial2
SerialPort & Serial0