37 lines
825 B
C++
37 lines
825 B
C++
//#include <IRremote.h>
|
|
#include <SoftwareSerial.h>
|
|
|
|
SoftwareSerial mySerial(NULL,7); // RX, TX
|
|
|
|
//#define IR_RECEIVE_PIN PB4
|
|
uint8_t redLED = PB1;
|
|
//uint8_t redLED = PB2;
|
|
/* uint8_t greenLED = PB0;
|
|
uint8_t fanPIN = PB3; */
|
|
void setup() {
|
|
|
|
mySerial.begin(9600);
|
|
pinMode(redLED, OUTPUT);
|
|
//pinMode(PB2, OUTPUT);
|
|
/* pinMode(greenLED, OUTPUT); */
|
|
/* pinMode(redLED, OUTPUT); */
|
|
/* pinMode(fanPIN, OUTPUT); */
|
|
/* digitalWrite(fanPIN, LOW); */
|
|
digitalWrite(redLED, LOW);
|
|
/* digitalWrite(greenLED, LOW); */
|
|
/* digitalWrite(redLED, LOW); */
|
|
//IrReceiver.begin(IR_RECEIVE_PIN);//, ENABLE_LED_FEEDBACK);
|
|
}
|
|
|
|
void loop() {
|
|
digitalWrite(redLED, !digitalRead(redLED));
|
|
delay(100);
|
|
mySerial.print("1");
|
|
digitalWrite(PB2, HIGH);
|
|
delay(100);
|
|
mySerial.print("2");
|
|
digitalWrite(PB2, HIGH);
|
|
delay(100);
|
|
|
|
}
|