coding whit counting

hey i am trying to make my coding where it counts bateries it is supost to be a kind of deposit machine but it is saying ‘derTaellesBatterier’ was not declared in this scope so i would like to hear if any one can see the mistakes in my coding

#include <Wire.h>
#include <rgb_lcd.h>
#include <GroveColorSensor.h>
#include <Registers.h>
#include <Utilities.h>

rgb_lcd lcd;

const int colorR = 255;
const int colorG = 150;
const int colorB = 0;

#define PIR_MOTION_SENSOR 5
const int ledPin = 6;
const int MOTION_SENSOR_PIN = 5;
const int buttonpin = 7;
int ledPinStatus = LOW;
int buttonState = 0;

int antalGroenBat = 0;
int antalBlaaBat = 0;
int antalRoedBat = 0;

int SamletPant = 0;

const int PrisGroen = 3;
const int PrisBlaa = 2;
const int PrisRoed = 1;

boolean derTallesBatterier = false;

boolean GroenBatRunning = false;
boolean BlaaBatRunning = false;
boolean RoedBatRunning = false;

const int GroenStart = 120;
const int GtoenStop = 50;
const int BlaaStart = 100;
const int BlaaStop = 20;
const int RoedStart = 80;
const int RoedStop = 60;

void setup()
{
Serial.begin(9600);
Wire.begin();

lcd.begin (16, 2);
lcd.setRGB (colorR, colorG, colorB);

pinMode (buttonpin, INPUT);
pinMode(PIR_MOTION_SENSOR, INPUT);
lcd.noDisplay ();
delay(1000);

}

void loop ()
{
int red, green, blue;
while(1)
{
byte motionState = digitalRead (MOTION_SENSOR_PIN);
buttonState = digitalRead (buttonpin);
GroveColorSensor colorSensor;

colorSensor.readRGB(&red, &green, &blue);

delay(1);
Serial.print(“the RGB value are: RGB(”);
Serial.print(red,DEC);
Serial.print(", “);
Serial.print(green,DEC);
Serial.print(”, “);
Serial.print(blue,DEC);
Serial.print(”, ");
colorSensor.clearInterrupt();

if (buttonState == HIGH) {
if (derTaellesBatterier) {
Serial.println(":stop counting");
derTaellesBatterier = false;
lcd.clear();
lcd.setCursor(0,1);
samletPant =antalGroenBat * PrisGroen + antalBlaaBat * PrisBlaa + antalRoedBat * PrisRoed;
lcd.print(“samlet kr”);
lcd.setCursor(14,1);
lcd.print(",-");
lcd.setCursor(10,1);
lcd.print(SamletPant);
delay(10000);
lcd.clear();
} else {
if (motionState = HIGH){
serial.println(":start tælling");
derTaellesBatterier = true;
antalGroenBat = 0;
antalBlaaBat = 0;
antalRoedBat = 0;
SamletPant = 0;
lcd.setRGB (colorR, colorG, colorB);
lcd.display();
lcd.setCursor(0,0);
lcd.print(“klar til pant”);
delay(2500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Placer batteriet”);
lcd.setCursor(0,1);
lcd.print(“på båndet”);
delay(2500);
lcd.clear();

delay(100);
}else{
delay(100);
}

if (derTaellesBatterier){
if (groenBatRunning) {
if (green<GroenStop) {
antalGroenBat = antalGroenBat + 1;
GroenBatRunning = false;
lcd.setCursor(0,1);
lcd.print(“9V:”);
lcd.print(antalGroenBat);
Serial.print"G:");
Serial.println(antalGroenBat);
}
}else{
if (green>GroenStart) {
GroenBatRunning = true;
}
}
if (blaaBatRunning) {
if (blue<BlaaStop) {
antalBlaaBat = antalBlaaBat + 1;
BlaaBatRunning = false;
lcd.setCursor(5,1);
lcd.print(“buttoncell:”);
lcd.print(anatalBlaaBat);
Serial.print(“B:”);
Serial.println(antalBlaaBat);
}
}else{
if (blue>BlaaStart) {
BlaaBatRunning = true;
}
}
if (RoedBatRunning) {
if (red<RoedStop) {
antalRoedBat = antalRoedBat + 1;
RoedBatRunning = false;
lcd.setCursor(11, 1);
lcd.print(“mobil:”);
lcd.print(antalRoedBat);
Serial.print(“mobil:”);
Serial.println(antalRoedBat);
}
}else{
if (red>RoedStart) {
RoedBatRunning = true;
}
}
}
}
}
}
}

thanks a lot

malthe351:
boolean derTallesBatterier = false;

if (derTaellesBatterier) {

They're not the same. Ctrl-F is useful for finding things like that...it took me about 5 seconds.

Steve

slipstick:
They're not the same. Ctrl-F is useful for finding things like that...it took me about 5 seconds.

Steve

so i am supost to put boolean derTallesBatterier = false; insted of what i have rigth now??

i hawe just seen what u meant thanks a lot you are a life saver
*