사용자 도구

사이트 도구


commands:edge_scale

문서의 이전 판입니다!


에지 검출·반전·범위 변환

명령어 반환값 설명
Iup(id, input) 상승 순간에만 true OFF→ON 변화를 한 번 검출합니다.
Idown(id, input) 하강 순간에만 true ON→OFF 변화를 한 번 검출합니다.
Ialt(input, state) 없음 입력 상승 순간마다 참조 변수 state를 반전합니다.
Iscale(x, inMin, inMax, outMin, outMax) int32_t 정수 범위를 정수 범위로 변환합니다.
Iscalef(x, inMin, inMax, outMin, outMax) float 실수 범위를 실수 범위로 변환합니다.
bool lamp = false;
void loop() {
  bool button = Ibounce(0, 30);
  Ialt(button, lamp);
  digitalWrite(64, lamp);
}

명령어 원형

반환형 명령어 원형
bool Iup(uint8_t id, bool input)
bool Idown(uint8_t id, bool input)
void Ialt(bool input, bool &state_var)
int32_t Iscale(int32_t x, int32_t in_min, int32_t in_max, int32_t out_min, int32_t out_max)
float Iscalef(float x, float in_min, float in_max, float out_min, float out_max)

서로 다른 신호에 같은 id를 사용하면 이전 상태가 섞일 수 있습니다. Iscale 입력 범위의 최솟값과 최댓값을 같게 지정하지 마십시오.

← 내장 명령어 리스트

commands/edge_scale.1788184327.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki