'--------Title-------- ' File......array1.pbp ' Started....4/22/08 ' Microcontroller used: Microchip Technology 16F88 ' microchip.com ' PBPro Code, micro-Engineering Labs, Inc. ' melabs.com '--------Program Desciption-------- ' The program creates two 6 element arrays. The first LCD row displays ' the first array, the counter variable, x[c0] = c0 and the second LCD ' row displays the second array, the counter variable doubled, y[c0] = c0*2. '------------Variables------------- c0 VAR BYTE ' Byte for counter x var byte[6] ' BYTE for each of 6 elements ' of array x[] y var byte[6] ' BYTE for each of 6 elements ' of array y[] '----------Initialization---------- ANSEL = 0 ' Configure all pins to digital ' operation since not using ADC ' (Analog to Digital Converter) OSCCON = $60 ' Sets the internal oscillator in the ' 16F88 to 4 MHz '-------------Main Code------------ pause 1000 ' 1 second PAUSE to allow LCD to setup for c0 = 0 to 5 ' FOR..NEXT loop to create 6 entries in ' each array x[c0] = c0 ' Assign value of c0 to each array element ' in x[c0]. For example, when c0 = 1, ' x[1] = 1. y[c0] = c0*2 ' Assign value of c0*2 to each array ' element in y[c0]. For example, when ' c0 = 1, y[1] = 2. next c0 ' Proceed to NEXT value of c0 until c0 = 5. lcdout $FE,1, #x[0],$14,#x[1],$14,#x[2],$14,#x[3],$14,#x[4],$14,#x[5] ' On the first row of an LCD screen, display ' each 8-bit element of array x[c0] from ' x[0] to x[4]. A space,($14), is inserted ' between each element. lcdout $FE,$C0,#y[0],$14,#y[1],$14,#y[2],$14,#y[3],$14,#y[4],$14,#y[5] ' On the second row of an LCD screen, display ' each 8-bit element of array y[c0] from ' y[0] to y[4]. A space,($14), is inserted ' between each element. pause 500 ' PAUSE 500ms or 1/2 second end