c언어 아두이노 arduino내공100
-
게시물 수정 , 삭제는 로그인 필요
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0,1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);
// print the results to the Serial Monitor:
Serial.print("sensor = ");
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);
이거 프린트구문나오는 값이있는대 그값이 위에 코딩중에 어디부분에해당하나요? 아직c언어초보입니다...
#c언어 아두이노 #c언어 아두이노 시리얼 통신 #아두이노 c언어 차이점 #아두이노 c언어 연동