Installing Blassic on the Midge/Sunspot

The Blassic Basic Interpreter for Linux/Unix systems from www.blassic.org is a classic interpreter.

On linux systems with graphics facilities, it will even emulate the graphic styles of earlier home computers and allow execution of programs writen for them.

On the Midge/Sunspot router, it is implimented without graphics functions. Also, to enable the source to be compiled without too many extra requirements, the sin/cos/tan functions were removed from the configuration.

The resulting ipkg can be installed on the Sunspot/Midge router and be called from the command line - where you can create, edit and debug basic programs - or from within a script.

See the Blassic web site for a list of commands and further info.

To install blassic onto a Midge/Sunspot via the web:-

If you have added 'picprojects' to your /etc/ipkg.conf (as in the previous page).

Type 'ipkg update' to collect an updated list of packages.

Type 'ipkg install blassic' Ipkg will install the Blassic packages.

You should be able to start the interpreter by typing 'blassic'. To exit and return to the command prompt type 'exit'.

Example - LCD message scroll

This example uses the lcd driver program drom the latest sunspot rom and stick to display a scrolling message on line 1 of a 20 character display.

It shows how a basic / blassic program can send strings to a command line program (in this case, the lcd driver).

The program never ends, if you run it from a terminal window, use ctrl-C to stop it.


5 padd$ = ""
6 GOSUB 2000
9 msg$ = "
" 10 msg$ = msg$ + "This is a message from the Sweex Router. "
11 msg$ = msg$ + " It is brought to you by a little blassic program. "
12 msg$ = msg$ + " This text could come from a web page!!!!!!"
15 x = 1
20 part$ =MID$(msg$,x,40) ' here each go round the loop
25 length = LEN(part$)
26 REM have we got to the end?
27 IF length = 0 THEN GOTO 100
30 part$ = part$ + STRING$(40-length," ")
40 PRINT part$
45 sys$ = "lcd_out_4x20 -h; lcd_out_4x20 " +CHR$(39)+ part$ + CHR$(39)
46 SHELL (sys$)
47 PRINT sys$
48 GOSUB 2050 ' delay
50 x = x + 1
60 GOTO 20
100 REM here end of message
110 GOTO 15
2000 REM cls
2010 SHELL ("lcd_out_4x20 -i")
2020 RETURN
2050 REM delay
2060 FOR delay=1 TO 1250 : NEXT : RETURN

Experimenting with Microchip PIC Processors and Networks

A PIC, Linux and a Router
Modding The Router
Modding The Router - USB/Hard Drives
Modding The Router - Software & Filesystem
New Sunspot/Midge Packages
Extra Packages for Midge/Sunspot

PIC Links


Google
 
Web