• 카테고리

    질문 & 답변
  • 세부 분야

    임베디드 · IoT

  • 해결 여부

    미해결

pulseln was not declared in this scope 오류 도와주세요

20.07.22 10:31 작성 조회수 489

0

안녕하세요 아두이노 1.8.11 베타버젼 사용하고 있읍니다.

1.pulseln 오류  발생 원인

2,아두이노 웹에디타 에서 스케치를 코딩하면 영문 이 한글로 바뀌면서

    이상하게 번역을 하는데 그냥 영문 코딩이 되게 하는방법

    알려주심 감사 하겠읍니다.

#define TRIG_PIN 2

#define ECHO_PIN 3

#define COLOR_COUNT 10

#define GAP 10

#define RED 11

#define GREEN 10

#define BLUE 9

int colors [COLOR_COUNT][3] =

{

  {255, 0, 0}, 

  {255, 255, 0},

  {128, 255, 0},

  {0, 255, 0},

  {0, 255, 128},

  {0, 128, 255},

  {0, 0, 255},

  {0, 255, 255},

  {127, 0, 255},

  {255, 0, 255},

};

void setup() {

  // put your setup code here, to run once:

  pinMode(TRIG_PIN, OUTPUT);

  pinMode(ECHO_PIN, INPUT);

}

void loop() {

  // put your main code here, to run repeatedly:

  

  digitalWrite(TRIG_PIN, LOW);

  delayMicroseconds(2);

  digitalWrite(TRIG_PIN, HIGH);

  delayMicroseconds(5);

  digitalWrite(TRIG_PIN, LOW);

long distance = pulseln(ECHO_PIN,HIGH,5800)/58;

  if (0<distance && distance <= COLOR_COUNT * GAP){

  for (int i= 0; i < COLOR_COUNT; i++){

    if (i * GAP < distance && distance <= (i + 1) * GAP) {

      analogWrite(RED, colors[i][0]);

      analogWrite(GREEN, colors[i][1]);

      analogWrite(BLUE, colors[i][2]);

      break;

    }

  }

} else {

  analogWrite(RED, 0);

    analogWrite(GREEN, 0);

    analogWrite(BLUE, 0);

  }

}

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!