I am learning brain wave programming from Tinkernut tutorial.
#include <IRremote.h>
#include <IRremoteInt.h>
#include <Brain.h>
IRsend irsend;
Brain brain(Serial);
const int ledPin = 3;
long interval = 500;
long previousMillis = 0;
int ledState = LOW;
int medValue;
void setup() {
// Set up the LED pin.
pinMode(ledPin, OUTPUT);
// Start the hardware serial.
Serial.begin(9600);
}
void loop() {
// Expect packets about once per second.
if (brain.update()) {
Serial.println(brain.readCSV());
// Attention runs from 0 to 100.
medValue = brain.readMeditation();
}
// Make sure we have a signal.
if(brain.readSignalQuality() == 0) {
// Send a signal to the LED.
if (medValue < 50) {
irsend.sendNEC(0x10EFA05F, 32);
delay(40);
}
}
}
The above code by tinkernut controls a single button of a tv remote only if the meditation value drops below 50.
My question is,
How to program arduino to control all the buttons of a tv remote ?