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
Post a Comment