This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
Arduino/sketches/sketch_aug18b.ino
2024-05-03 01:10:21 +03:00

33 lines
831 B
C++

#include <NewTone.h>
#include "IRremote.h"
IRrecv irrecv(2); // указываем вывод, к которому подключен приемник
decode_results results;
int note;
void setup() {
Serial.begin(9600); // выставляем скорость COM порта
irrecv.enableIRIn(); // запускаем прием
}
void loop() {
if ( irrecv.decode( &results )) { // если данные пришли
Serial.println( results.value ); // печатаем данные
if(results.value == 16769565) {
note=note+50;
NewTone(6,note,500);
}
if(results.value == 16753245) {
note=note-50;
NewTone(6,note,500);
}
if(results.value == 16736925) {
NewTone(6,note,1000);
}
irrecv.resume(); // принимаем следующую команду
}
}