Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting the following error when i am compiling the code by selecting the board as attiny85, and if i compile the same code by selecting board as arduino nano ,i am getting no error. please help #138

Open
kamaluddin786 opened this issue Oct 14, 2021 · 0 comments

Comments

@kamaluddin786
Copy link

Code :

#include <IRremote.h>

IRrecv irrecv(0);
decode_results results;

int lig1 = 1;
int lig2 = 2;
int lig3 = 3;
int lig4 = 4;

int flag1 = 0;
int flag2 = 0;
int flag3 = 0;
int flag4 = 0;

unsigned int value;

void setup() {
irrecv.enableIRIn();

pinMode(lig1, OUTPUT);
pinMode(lig2, OUTPUT);
pinMode(lig3, OUTPUT);
pinMode(lig4, OUTPUT);

}

void loop() {
if (irrecv.decode(&results)) {
value = results.value;
irrecv.resume();

if (results.value == 0x1FE50AF) {flag1 = !flag1; digitalWrite(lig1, flag1 ? HIGH : LOW); value =0; }
if (results.value == 0x1FED827) {flag2 = !flag2; digitalWrite(lig2, flag2 ? HIGH : LOW); value =0; }
if (results.value == 0x1FEF807) {flag3 = !flag3; digitalWrite(lig3, flag3 ? HIGH : LOW); value =0; }
if (results.value == 0x1FE30CF) {flag4 = !flag4; digitalWrite(lig4, flag4 ? HIGH : LOW); value =0; }
if (results.value == 0x1FE48B7)
{digitalWrite(lig1 , LOW);
digitalWrite(lig2, LOW);
digitalWrite(lig3 , LOW);
digitalWrite(lig4 , LOW);

}    

} }
ERROR :

In file included from C:\Users\Kamal\Documents\Arduino\libraries\IRremote\src/IRremote.h:197:0,
from C:\Users\Kamal\Desktop\IR_home_automation_code\IR_home_automation_code.ino:1:
C:\Users\Kamal\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp: In member function 'bool IRrecv::decode(decode_results*)':
C:\Users\Kamal\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1410:9: error: 'Serial' was not declared in this scope
Serial.println(
^~~~~~
C:\Users\Kamal\Documents\Arduino\libraries\IRremote\src/IRReceive.hpp:1410:9: note: suggested alternative: 'Stream'
Serial.println(
^~~~~~
Stream
exit status 1
Error compiling for board ATtiny.

Anybody please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant