Configurations
You can easily recompile AVIL with different options to fit your needs.
All the compilation options are in the header file ../libraries/AVIL/compopt.h
By default you'll find options that allow you to use AVIL with i/o on serial line or, by changing only one option, from ethernet.
Beware of what you do here...Arduino has a very limited SRAM...you can't do much more than this especially if you want to work from ethernet.
If you decide to work with the serial port take a look here to setup your AVIL and Arduino at his best.
If you decide to work on ethernet take a look here to save some SRAM.
Let's see the in details:
Hardware platform:
At the beginning of compopt.h you'll find these #define directives:
1 //uncomment only the hw platform you'r using currently 2 3 //#define SYSTEM PC 4 #define SYSTEM ARDU_UNO
uncomment #define SYSTEM ARDU_UNO to play with your Arduino, uncomment #define SYSTEM PC if you want try to run and debug AVIL on your PC.
Hardware settings on Arduino UNO:
You can uncomment the directive #define ETH_IO to redirect AVIL's input/output on ehternet.
The other directives enabled by ETH_IO concern the ip address and the port you want to use to telnet your Arduino.
1 #if SYSTEM == ARDU_UNO 2 //userInput/Output over ethernet 3 #define ETH_IO 4 #ifdef ETH_IO 5 //ip address www.xxx.yyy.zzz 6 #define IP_www 192 7 #define IP_xxx 168 8 #define IP_yyy 1 9 #define IP_zzz 177 10 //telnet\webServer port 11 #define PORT 23 12 #endif 13 //there's an sd card? 14 #define SD_CARD 15 //additional debug functions 16 //#define DEBUG 17 #endif
Look:
This section of code defines the aspect an AVIL program has.
1 /////////////////////////////LOOK/////////////////////////////////////// 2 //max number of input arguments allowed for AVIL's programs 3 #define MAX_INPUT_ARGS_NUM 2 4 //max number of output values allowed by AVIL's programs 5 #define MAX_OUT_VALS_NUM 1 6 //max chars number of an AVIL's string 7 #define MAX_STRINGLEN 16 8 //max chars number of a program's name (more than 8 it's useless with a fat16 filesistem!) 9 #define MAX_PRG_NAME_LENGTH 8 10 //max chars number of a program's (and file's) line 11 #define MAX_FILE_LINE_LENGTH 32 12 //max number of digit of a numeric value 13 #define MAX_NUMLEN 5 14 //max chars number of a variable's name (2 is the minimum) 15 #define MAX_VARNAMELEN 3 16 //////////////////////////////////////////////////////////////////////////
These options are self-explanatory, just be careful with:
- MAX_FILE_LINE_LENGTH : this will be the max length of an AVIL program since it represent the number of chars of program dinamically loaded in SRAM during the execution of a program.
- MAX_PRG_NAME_LENGTH : you can't give to a program a name longer than this.
- MAX_STRINGLEN : when your AVIL program ask for a string input it can't be longer than this.
- MAX_VARNAMELEN: a variable's name can't be longer than this.
Execution:
In this section of code you can modify the number of nested if's and for's loop you can nest in your AVIL code.
Remember...SRAM is precious!
1 /////////////////////////////////EXECUTION//////////////////////////////// 2 //max number of nested if's in one program 3 #define MAX_NESTED_IF 2 4 //max number of nested for's loop in one program 5 #define MAX_NESTED_FOR 2 6 //////////////////////////////////////////////////////////////////////////
Memory:
This section represent the number of variables you can declare in your AVIL program for each datatype
1 /////////////////////////////////MEMORY/////////////////////////////////// 2 //boolean variables number 3 #define MAX_BOOL_NUM 5 4 //integer variables number 5 #define MAX_INT_NUM 5 6 //string variables number 7 #define MAX_STRING_NUM 2 8 //labels number 9 #define MAX_LABEL_NUM 3 10 //////////////////////////////////////////////////////////////////////////