Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!




Error (Not declared...
 
Share:
Notifications
Clear all

[Solved] Error (Not declared in this scope)

4 Posts
2 Users
0 Likes
3,278 Views
(@bbkhawk)
New Member
Joined: 6 years ago
Posts: 2
Topic starter  

Hi again Hans,

I have a problem compiling a script.The leds were working fine until I added code for the heat detectors.Now I get theaterchase was not declared in this scope.I am sure I will get further errors too.I am very new to arduino coding.I hope someone can help.Code attached.

Thank you.


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2663
 

Hi bbHawk,

Seems you forgot an close-accolade in line 35:

  }
  if (sensors.getTempCByIndex(1) >= 25) {
   FAST();
  
}

Should be:

  }
  if (sensors.getTempCByIndex(1) >= 25) {
   FAST();
  }
}

Without the accolade the compiler gets confused since the loop is not closed. 
Happens to the best of us ... 


   
ReplyQuote
(@bbkhawk)
New Member
Joined: 6 years ago
Posts: 2
Topic starter  

Hi Hans,

Thank you for that much appreciated.I am now getting another error now.The section for Fast is not set up yet by the way.Too few arguments to function 'void theaterChase(byte,byte,byte,int)'

I have 3 books on Arduino programming arriving tomorrow.Hopefuly I will learn the coding (fingers crossed) :)


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2663
 

Hi bbkHawk,

you're welcome!

You can make a dummy function for your FAST function - not sure what it's supposed to do? Fast version of theatre chase?

Eg. dummy FAST():

void FAST() {
  serial.println("Going FAST");
}

And for the theatrechase you could fill in some random parameters: 

theaterChase(0xff, 0, 0, 100); // red

Also, my intro course may or may not be helpful. 


   
ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: