interpreter for Arduino

Hi all,
I made my own interpreter and intepreted language (starting from uBasic), it has some interesting features and can run programs from sd card (so you don't have to load the entire program in SRAM).

It can be used as a standalone interpreter or you can set up a minimal shell you can use interactively (from serial or ethernet) or to remotely manage i/o from a bash script!
You can also customize the language with user definde function.

Hope you'll have a look!

http://avil.altervista.org/

Impressive Project!

Good documentation!

Well done! :slight_smile:

Thank you! :slight_smile:

I recently added the possibility to define subprograms and as soon as possible I would like to port this interpreter on an esp8266 since I think that (on more powerful hw) it could be used to create an easy and convenient "environment" for IOT rapid prototyping.

Ciao!

Hi all,
I received some positive feedback about this project so I decided to develop a nice example of application made using the AVIL interpreter.

I made an "industrial like" controller for a meArm robot extending the language with a few functions.
You'll be able to:

  • manually jog your meArm
  • "teach" the robot as many positions as you want (they'll be stored on the sd card)
  • let the meArm interact with the real world using the digital I/O of the Arduino board
  • control the arm with AVIL programs stored on the sd card

Have a look here!

And here to learn more about it!

meArm Robot Controller

Ciao!

I fixed some problems in the website, now you can have access to a complete documentation here:

http://avil.altervista.org/

in statement 3.2.1 print - println SyntaxHighlighter " Can't find brush for: sh"

Can you use AVIl to accomplish the following?

start:
rec 783 30
chp 1
rec 783 10
chp 0
goto start 10 // loop for 10

and

alfa:
rec 200 10
chp 1
scan 300 20
chp 0
a = input (hr)
if hr < 60 goto alfa
beta:
...

Hi,

Thank you for your feedback,I fixed the error message in the docs!

...I can't really understand what are you trying to do but you can for sure use a "for" loop in your code instead of doing it with a "goto".

3_Language_Reference/3.2_Statements/3.2.6_for.html

If you want you can also implement a custom instruction following this guideline:

5.1_add_a_custom_function_to_AVIL_in_5_steps.html

So yuo can extend the language to fit your needs!

Ciao!

I am using Arduino Uno r3 and SD.

In sysArduinoUNO.h on line 29 I typed CHIP_SELECT = 10;
Avil has returned the error "init code".
I tested the Arduino and SD card with the SD program of SparkFun Electronics

** SD - a slightly more friendly wrapper for sdfatlib **

Below the printout of this program, works perfectly on chip_select 4, 8, 10.

Initializing SD card...Wiring is correct and a card is present.
Card type: SDHC
Volume type is FAT16

Volume size (bytes): 1986756608
Volume size (Kbytes): 1940192
Volume size (Mbytes): 1894
Files found on the card (name, date and size in bytes):
CAT 2017-05-30 12:10:58 163
CP 2017-05-30 12:10:58 542
DIOR 2017-05-30 12:10:58 161
DIOW 2017-05-30 12:10:58 190
EDITL.AV 2017-05-30 12:10:58 1666
ERRDESC 2017-05-30 12:10:58 2526
FREC 2017-05-30 12:10:58 247
FREE 2017-05-30 12:10:58 139
GETPM 2017-05-30 12:10:58 161
LS 2017-05-30 12:10:58 136
MAHOWTO 2017-05-30 12:10:58 413
MEADEMO.AV 2017-05-30 12:10:58 556

Where to look for a problem, maybe turning on the debug feature will show the problem.
Any program from FAT16 directory does not work
error code is
"read begin failed
fat16info:
SD error
ErrorCode: 2
ErrorData: 1 "

Hi,

If you're using an Ethernet Shield you must set CHIP_SELECT=4 otherwise it will not work.

If you're using an external SD module (could you link me wich one are you using?)be sure to comment the #define ETH_IO at line 39 of compopt.h (http://avil.altervista.org/Index/2_Configurations.html)
In this way the pin 10, normally used to select the ethernet interface, will be free.

Ciao!

Everything is done according to your guide, checked several times.
My SD card is type no-name but working good with full speed in other programs.
I think the problem is with the SS pin (10) or Slave Select.
When using the ethernet module there is no problem.
I don't have ETH module.

Serial.print("\nInitializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(10, OUTPUT); // change this to 53 on a mega

// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card is inserted?");
Serial.println("* Is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");

When using the ethernet module there is no problem.
I don't have ETH module.

...I can't really understand wich hardware are you using...

mmm...so you're using an Arduino Uno directly connected to an SD card?(no SD module like this one?)

Can you post the wiring between arduino and the SD card (and other eventual hardware) and attach the compopt.h file?...I will try to replicate the problem in the next days.

Yes, I'm using Arduino Uno connected directly to SD card (without SD module).

This set works well on other programs.

compopt.zip (1.51 KB)

At the moment I can't replicate your problem since I can't build a voltage divider to drive directly the SD card without a module.

But now I'm curious about this issue and I will do it in a few days...hold on! :slight_smile:

...by the way I tried to connect my Ethernet shield to my Arduino Uno "by wires" (not stacking them) and I'm able to choose the chip select that I want for the SD card...so the problem it's not on the fat16 library I suppose...

I look forward to the results of your work

level.jpg

I installed the W5100 ethernet card.
Ping to 192.168.1.177 work correctly.
Putty via telnet to 192.168.1.177 gives the message "network error Connection time out"

putty1.jpg

Hi!

...look like it's a network problem...are you sure everything it's ok?

I tried to download an install AVIL from it's repo and install it as it is on a win7 machine.

Then I loaded the "AVILshell" example of the library and I tried to telnet the Arduino with putty, hit Enter to get a first answer from the shell...et voilà...it just worked out of the box:

I just fixed a little bug that caused a bad formatting output in putty (not present in linux shell), so if you want make a new download of AVIL.

Thanks a lot for your feedback.

With the new Avil software, Putty shows "network error connection time out".

That kind of errors is usually linked to some wrong settings in Putty.

Did you try with another telnet client?

Open the windows command prompt and try to connect line this:

after the connection input some characters and hit Enter to have a first answer from the board!

I'm quite sure it's working...I tested it on several different machine! :slight_smile: :slight_smile:

...by the way...I tried to connect an external micro sd module like this:

I just uploaded the AVILshell sketch commenting the #define ETH_IO directive in compopt.h, then I connected my PC to Arduino trough serial and everything seems ok...

I also tried to change the CHIP_SELECT value to 10 in sysArduinoUNO.h (of course I moved the blue wire in the picture to the pin 10) and I can't reply your problem...

I will try in the next day to connect directly to an SD card without module (I just have to wait for a voltage shifter)...but I think there is no big difference since this module is nothing more than a voltage shifter + an sd holder!

My ETh WP5100 card does not have a MAC address.
I have tried on several copies of Arduino R3, always the same error.
In the CMD under windows 7 telnet does not display characters but also does not give a time-out error message.
I still tried on the original Arduino R3 plate, not on the Arduino clones.