와이어 결선 방법
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F89917f5a-4e07-4d31-9f02-aa72f79c2cdc%252F5e9d70c1-86a8-45cc-9a39-09253a77253b%252FUntitled.png%3Ftable%3Dblock%26id%3D48ae37a8-2b5e-46ca-af17-dd38a006f8b9%26cache%3Dv2&w=3840&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F89917f5a-4e07-4d31-9f02-aa72f79c2cdc%252F2af88521-9afc-487e-843a-1fad968c647a%252FUntitled.png%3Ftable%3Dblock%26id%3D9f30b15d-b117-4db9-939c-e810b15c5bfd%26cache%3Dv2&w=3840&q=75)
아두이노 UNO 예제코드
#include <SoftwareSerial.h> #define ContinueMode 0 #define PollingMode 1 const int rxPin = 2; const int txPin = 3; SoftwareSerial Serial1(rxPin, txPin); void setup() { Serial.begin(9600); Serial1.begin(9600);//AGSM sensor module connection delay(1000); #if ContinueMode Serial.println("Continuous Mode"); #else if PollingMode Serial.println("Polling Mode"); #endif Serial.println("Serial, Conc.(PPB), Temp.(C), Rh(%), Adc.(Counts), Temp.(Counts), Rh(%Counts)"); #if ContinueMode Serial1.write('c'); Serial1.write('\r'); #endif } void loop() { #if PollingMode Serial1.write('\r'); delay(1000); #else delay(100); #endif while (Serial1.available()) // read from AGSM port, send to Serial port to interupt continuous output send 'c''/r' without line ending, may have to send more than once. { int inByte = Serial1.read(); Serial.write(inByte); } }
아두이노 시리얼 모니터 출력
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fprod-files-secure.s3.us-west-2.amazonaws.com%252F89917f5a-4e07-4d31-9f02-aa72f79c2cdc%252F87024b0c-fbce-472e-aeae-851919ac4a03%252FUntitled.png%3Ftable%3Dblock%26id%3Df149fbdf-85cc-4e23-8320-7f2f0f23eb9d%26cache%3Dv2&w=3840&q=75)
Share article