#include <IRremote.h>
IRsend irsend;
unsigned int code1[50]={
17812,14400,550,1400,600,1450,600,1400,600,1450,550,1450,550,1450,550,1500,500,1400,600,1450,900,1400,600,1400,600,1400,650,1400,550,1400,650,1400,900,1400,600,1400,600,1400,600,1400,600,1400,600,500,1500,450,1550,450,1600,400};
void setup()
{
Serial.begin(9600);
irsend.sendRaw(code1,50,38);
}
void loop() {
}
//The IR output will be on pin 3 (OC2B).
int buzzer1=4;
int buzzer2=5;
#include <IRremote.h>
IRsend irsend;
unsigned int lavage1[50]={
14400,550,1400,600,1450,600,1400,600,1450,550,1450,550,1450,550,1500,500,1400,600,1450,900,1400,600,1400,600,1400,650,1400,550,1400,650,1400,900,1400,600,1400,600,1400,600,1400,600,1400,600,500,1500,450,1550,450,1600,400};
unsigned int bidet1[50]={
14400,600,1500,500,1500,500,1450,550,1500,550,1500,450,1550,500,1450,550,1500,500,1500,500,1450,800,1250,750,1450,550,1500,500,1450,550,1500,500,1450,550,1450,550,1450,600,500,1450,500,1500,1600,600,1450,600,1400,550,1400};
void setup()
{
pinMode(4,OUTPUT);
digitalWrite(buzzer1, HIGH); //Sonne le buzzer pour prevenir
delay(500); // sonne pendant 0.5s
digitalWrite(buzzer1, LOW);
Serial.begin(9600);
irsend.sendRaw(lavage1,50,38);
delay(1*1000); // attend la fin du cycle de lavage
digitalWrite(buzzer1, HIGH); //Sonne le buzzer pour prevenir
delay(500); // sonne pendant 0.5s
digitalWrite(buzzer1, LOW);
Serial.begin(9600);
irsend.sendRaw(bidet1,50,38);
}
void loop() {
}
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
const int button1Pin = 8;
const int button2Pin = 9;
const int button3Pin = 10;
int button1State = 0;
int button2State = 0;
int button3State = 0;
void setup() {
pinMode(button1Pin, INPUT);
pinMode(button2Pin, INPUT);
pinMode(button3Pin, INPUT);
digitalWrite(button1Pin, HIGH);
digitalWrite(button2Pin, HIGH);
digitalWrite(button3Pin, HIGH);
}
void loop(){
button1State = digitalRead(button1Pin);
button2State = digitalRead(button2Pin);
button3State = digitalRead(button3Pin);
if (button1State == LOW) {
// envoyer le code 1
}
if (button2State == LOW) {
// envoyer le code 2
}
if (button3State == LOW) {
// envoyer le code 3
}
}
michel5650 a écrit:Merci phil, une question il existe une fonction sur l arduino qui le met en économie de batterie pour faire durer la pile?
sinon je me débrouille avec un transistor piloté avec une sortie qui le basculé hors tension a la fin du cycle, a moins qu il ne consomme pas? une durée de pile 9v sur 12 mois est acceptable
A+
Retourner vers Kit Communication IR
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités