arduino - if && statement help needed Newbie -


i trying can't seem work. can please help

if (tft.fillscreen == (black) &&((p.x > 163 && p.x < 200)&& (p.y > 295 && p.y < 314))) {   tft.print("bingo") } 

i'm getting

invalid use of member function (did forget '()' ?)

i keep changing them around cant seem right

just add, black defined @ top of code

#define black    0x0000 

each statement evaluating should set apart parenthesis. helps make code more readable , easier understand.

i.e.

if ((tft.fillscreen == (black)) && ((p.x > 163) && (p.x < 200))&& ((p.y > 295) && (p.y < 314))) 

this check "tft.fillscreen == (black)" true, p.x between 163 , 200 , p.y between 295 , 314. if 1 of these 3 conditions not true entire statement evaluates false.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -