Control Structures and what variable types work


hello have looked , search web , several forums have not found place says variable types work in control structures. trying use if statement double type variable , wont execute. changed variable int type , worked fine. control structures work int type variables? trying run variable on possible variations , find 1 best fits need. 'a' variable 1 double , have made int changing decimal integer. want know.

code: [select]
void loop()
  {
    count = count + 1;
    if (count == 100)
    {
      count = 0;
      = + 1;
      serial.println("");
      serial.println("");
    }
    if (count == 99)
    {
      if (a == 99)
      {
        serial.end();
      }
    }

any primitive type usable. floats equivalent double on arduino ( no double precision ).

however float set 100.00 may not equal int set 100 ( literal number integer default ),

maybe try comparing terms:
code: [select]

double d = 100.0f;

if( d == 100.0f ){  //f float literal specifier.
 //...
}


Arduino Forum > Using Arduino > Programming Questions > Control Structures and what variable types work


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62