in Education by
How would I iterate through these 5 array in a function call? Right now I am just manually iterating through each to form a specific character const unsigned char pattern1bar[8]={0x10,0x10,0x10,0x10,0x10,0x10,0x10}; const unsigned char pattern2bar[8]={0x18,0x18,0x18,0x18,0x18,0x18,0x18}; const unsigned char pattern3bar[8]={0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c}; const unsigned char pattern4bar[8]={0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e}; const unsigned char pattern5bar[8]={0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f}; void LCD_build(int custom, int cursor, const unsigned char *x,const unsigned char x2, int cgdisplay){ writeLCD(custom,0,0,1); // 1) set custom gram address location unsigned char i; for( i= 0; i <x2; i++) writeLCD(x[i],1,0,1); writeLCD(cursor,0,1,1); // 3) set cursor to location you want to write to writeLCD(cgdisplay,1,1,1); // 4) display cgram(0x00) custom character at current cursor location DELAY_MS(800); }; //function call LCD_build(0x40,0x80,pattern1bar,8,0x00); LCD_build(0x40,0x80,pattern2bar,8,0x00); LCD_build(0x40,0x80,pattern3bar,8,0x00); LCD_build(0x40,0x80,pattern4bar,8,0x00); LCD_build(0x40,0x80,pattern5bar,8,0x00); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Below is the simple solution with 3 integer arrays put into one 2-dimensional array: #include #define LENGTH 5 const unsigned short a1[] = {1, 4, 2, 4, 1}; const unsigned short a2[] = {3, 4, 2, 1, 2}; const unsigned short a3[] = {4, 12, 1, 1, 2}; void main() { const unsigned short *ar[] = {a1, a2, a3}; unsigned i, j; for (i = 0; i < LENGTH; i++) { for (j = 0; j < LENGTH; j++) { printf("%d ", ar[i][j]); } printf("\n"); } }

Related questions

0 votes
    This is a sample (edited slightly, but you get the idea) of my XML file: Test 192.168.1.1 Test ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 31, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    Which of the following package combine multi-dimensional arrays? (a) stringr (b) comb (c) abind (d) ... Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    in Obj-C it was possible to iterate through alphabet with: for (char x='A'; x...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 7, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 6, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I can not seem to be able to read from config file multitoken options like I can from command line ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
...