Pages: [1]   Go Down
Author Topic: ""********** was not declared in this scope "  (Read 462 times)
0 Members and 1 Guest are viewing this topic.
LONDON UK
Offline Offline
Full Member
***
Karma: 0
Posts: 163
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

in quite a few examples i load from the net when i try to compile them i can get this message come up


TIMSK was not declared in this scope as in >>

#include <avr/io.h>
#include <avr/interrupt.h>

int main(void)
{
sei();

DDRB |= 1<<PINB0;

TCCR1B |= 1<<CS10 | 1<<CS11 | 1<<WGM12;
TIMSK |= 1<<OCIE1A; //If using atmega324, this regester is TIMSK1
OCR1A = 15624;

while(1)
{
}
}

ISR(TIMER1_COMPA_vect)
{
PORTB ^= 1<<PINB0;
}



or


OUTPUT was not declared in this scope

when i try to compile code for a blink sketch which will be loaded via a UNO to a ATTINY

judging by the comments left by other users they also get the same error message but the poster of the examples never leaves a reply
so is there a general cause of such a error message ?
what does this mean ? and how do i rectify such a message ?
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, looking at the 328 datasheets, it seems there's a TIMSK0 but no TIMSK.
Logged

LONDON UK
Offline Offline
Full Member
***
Karma: 0
Posts: 163
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the page it was posted on

http://www.newbiehack.com/IntroductiontoInterrupts.aspx

so do i assume he has posted a faulty code?
Logged

LONDON UK
Offline Offline
Full Member
***
Karma: 0
Posts: 163
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yep he posted a faullty code as a 0 added on to the TIMSK works fine
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please, /please/ next time you post code on this forum, remember to fix the indentation (CTRL-T) and use code tags. Thanks.
Logged

LONDON UK
Offline Offline
Full Member
***
Karma: 0
Posts: 163
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok thanks
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50452
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
yep he posted a faullty code as a 0 added on to the TIMSK works fine
The actual register names vary from board to board. Perhaps the code was intended for a different board.
Logged

Pages: [1]   Go Up
Jump to: