Hello,
i make a librarie to create menu and you can go in trought with simply two button.
I use a 2D array for name of every case.
But when i use the library, array blocked functioning, is there special writing for this ?
I put my code for you can see ! ^^
Menu.h
#ifndef Menu_h
#define Menu_h
#include "Arduino.h"
#define bulk 100
class Menu
{
public:
Menu(int pinLeft, int pinRight, int pinOk);
void size(int row, int line);
void title(int rowPos, int linePos, const char *title);
private:
int _row;
int _line;
int _rowPos;
int _linePos;
const char* _title;
const char* allName [bulk][bulk];
};
#undef int
#undef char
#endif
Menu.cpp
/*
Créée par A. Clerc, September 21, 2013.
Le code est du domaine public.
*/
#include "Menu.h"
#include "Arduino.h"
/*Initialisation des paramètres de base */
Menu::Menu(int pinLeft, int pinRight, int pinOk)
{
pinMode(pinLeft, INPUT);
pinMode(pinRight, INPUT);
pinMode(pinOk, INPUT);
}
void Menu::size(int row, int line)
{
_row = row+1;
_line = line+2;
}
void Menu::title(int rowPos, int linePos, const char* title)
{
_rowPos = rowPos;
_linePos = linePos;
_title = title;
allName[_row][_line]=_title;
allName[0][0]="Bienvenue";
}
Thanks