ISO C++ error....


when try compile code error:

in function 'void loop()':
error: iso c++ forbids comparison between pointer , integer

how fix it?
this code:
quote
/* danga signals mk1
made on boarduino v2.0
will adapted use on custom board
see jpegs
layout follows: */

int redpin = 9;
int redon;
int orangepin = 10;
int orangeon;
int greenpin = 11;
int greenon;
int switchpin = 12;
int laston = 0;
int laston2 = 0;

void setup(){
 pinmode(redpin, output);
 pinmode(orangepin, output);
 pinmode(greenpin, output);
 pinmode(switchpin, input);
 redon = 1;
 digitalwrite(redpin, high);
 laston = 0;
}

void loop(){
 if (switchpin == high){
  if (laston == "0"){
   digitalwrite(redpin, low);
   digitalwrite(orangepin, high);
   laston = laston2;
   //offyet();
  }
  else{
   digitalwrite(greenpinpin, low);
   digitalwrite(orangepin, high);
   laston = laston2;
   offyet();
  }
 }
 
}

void offyet(){
 if (switchpin == low){
   if (laston == ""0""){
    digitalwrite(orangepin, low);
    digitalwrite(greenpin, high);
    //loop();
   }
   else{
     digitalwrite(orangepin, low);
    digitalwrite(redpin, high);
   }
 }
 else{
  offyet();
 }
}

in couple of places have this:

code: [select]
if (laston == "0"){
when should have (without quotes):
code: [select]
if (laston == 0){


i suspect have other problems (for instance laston2 never updated after it's declared) bet quotes thing what's stopping code compiling.

andrew


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > ISO C++ error....


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums