i have the following code:
//************************************************************************
// Nokia Shield
//************************************************************************
//* Derived from code by James P. Lynch and Mark Sproul.
//*
//*Edit History
//* <MLS> = Mark Sproul, msproul -at- jove.rutgers.edu
//* <PD> = Peter Davenport, electrifiedpete -at- gmail.com
//************************************************************************
//* Apr 2, 2010 <MLS> I received my Color LCD Shield sku: LCD-09363 from sparkfun.
//* Apr 2, 2010 <MLS> The code was written for WinAVR, I modified it to compile under Arduino.
//* Aug 7, 2010 <PD> Organized code and removed unneccesary elements.
//* Aug 23, 2010 <PD> Added LCDSetLine, LCDSetRect, and LCDPutStr.
//* Oct 31, 2010 <PD> Added circle code from Carl Seutter and added contrast code.
//************************************************************************
// External Component Libs
#include "LCD_driver.h"
//#include "nokia_tester.h"
// Included files
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
//************************************************************************
// Main Code
//************************************************************************
#define MENUITEMS 2
char menu[MENUITEMS][2];
void setup()
{
LCDInit(); //Initialize the LCD
LCDContrast(44);
PrintMenu();
menu[0][0] = 'Enable module';
menu[0][1] = 'a1';
menu[1][0] = 'Disable module';
menu[1][1] = 'a2';
}
int num = 1;
//************************************************************************
// Loop
//************************************************************************
void loop()
{
int s1, s2, s3;
s1 = !digitalRead(kSwitch1_PIN);
s2 = !digitalRead(kSwitch2_PIN);
s3 = !digitalRead(kSwitch3_PIN);
if (s1){
}
else if (s2){
}
else if (s3){
}
s1 = 0;
s2 = 0;
s3 = 0;
delay(200);
}
void PrintMenu()
{
LCDClear(WHITE);
PrintMenuTitle("MENU");
int row, col, line;
line = 20;
for (row = 0; row < MENUITEMS; row++)
{
//for (col = 0; col < COLS; col++)
//{
PrintMenuItem(*menu[row][0], 1, line);
line += 16;
//}
}
}
void PrintMenuTitle(char *menuString)
{
LCDPutStr(menuString, 0, 49, RED, WHITE);
}
void PrintMenuItem(char *menuString, int Active, int x)
{
if (Active == 1)
{
LCDPutStr(menuString, x, 1, BLUE, WHITE);
} else {
LCDPutStr(menuString, x, 1, BLACK, WHITE);
}
}
unfortunatly, this produces the following error:
LCD_test1.cpp: In function 'void PrintMenu()':
LCD_test1:75: error: invalid type argument of 'unary *'
this is line 75: PrintMenuItem(*menu[row][0], 1, line);
where did i go wrong in this code??
if i remove the * before menu on line 75 the error becomes as following:
LCD_test1.cpp: In function 'void PrintMenu()':
LCD_test1:75: error: invalid conversion from 'char' to 'char*'
LCD_test1:75: error: initializing argument 1 of 'void PrintMenuItem(char*, int, int)'