Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
using the variable to put into the function
int main() { while(1) { k = screen();
int cells[84][48]; for (int i=0; i<84; i++) { for(int j=0; j<48; j++) { n = checking(i,j,k); h = conditions(k,n); lcd.refresh(); cells[i][j]=h; } }
trying to subs the value of hz into h so that it can be stored into cells array
int conditions(int kz, int sz) { if (kz==0) { int hz; if (sz==3) { hz=1; } else if (sz!=3) {
hz=0; } return hz; } else if (kz==1) { int hz; if(sz<2) { hz=0; } else if(sz>3) { hz=0; } else if(sz==2||sz==3) { hz=1; } return hz; }
}