diff --git a/sketch_aug18b.ino b/sketch_aug18b.ino new file mode 100644 index 0000000..453c45d --- /dev/null +++ b/sketch_aug18b.ino @@ -0,0 +1,32 @@ +#include + +#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(); // принимаем следующую команду + } +} diff --git a/sketch_sep06a.ino b/sketch_sep06a.ino new file mode 100644 index 0000000..3f24c20 --- /dev/null +++ b/sketch_sep06a.ino @@ -0,0 +1,10 @@ +void setup() { + // put your setup code here, to run once: + Serial.begin(9600); + +} + +void loop() { + // put your main code here, to run repeatedly: + Serial.println(analogRead(0)); +} diff --git a/sketch_sep09a.ino b/sketch_sep09a.ino new file mode 100644 index 0000000..08474a8 --- /dev/null +++ b/sketch_sep09a.ino @@ -0,0 +1,19 @@ + +#include + +const int stepsPerRevolution = 1000; // change this to fit the number of steps per revolution +// for your motor + + +// initialize the stepper library on pins 8 through 11: +Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); + +int stepCount = 0; // number of steps the motor has taken + +void setup() { + // nothing to do inside the setup +} + +void loop() { + myStepper.step(analogRead(A0)*10); +} diff --git a/sketch_sep15a.ino b/sketch_sep15a.ino new file mode 100644 index 0000000..deeff37 --- /dev/null +++ b/sketch_sep15a.ino @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +int melody; + +void setup() { + // put your setup code here, to run once: + pinMode(2,INPUT);//Пульт + pinMode(12,OUTPUT);//Голова + pinMode(10,OUTPUT);//Туловище + pinMode(11,OUTPUT);//Ноги + pinMode(9,OUTPUT);//бок +} + +void loop() { + // put your main code here, to run repeatedly: + +}