Giter Club home page Giter Club logo

tinybasicplus's Introduction

TinyBasic Plus

A C implementation of Tiny Basic, with a focus on support for Arduino. It was originally written by Gordon Brandly in the form of "68000 Tiny Basic", and then ported to C by Michael Field as "Arduino Basic", though still called "Tiny Basic" in the source files.

TinyBasic Plus is an extension and modification upon the original "Tiny Basic" by adding support for a few more devices, configurable at build time. It is designed for use on the Arduino, although builds will soon be easily possible for other platforms through command line makefiles. Provided is a makefile that builds for unix-ey type OSes. It has only been tested for Darwin (OS X).

Features added include support for fileio (SD Library), autorunning a program from the SD card, smaller footprint (PROGMEM), support for pin data IO, and support for the on-chip EEProm storage for your program.

Full list of supported statements and functions

System

  • BYE - exits Basic, soft reboot on Arduino
  • END - stops execution from the program, also "STOP"
  • MEM - displays memory usage statistics
  • NEW - clears the current program
  • RUN - executes the current program

File IO/SD Card

  • FILES - lists the files on the SD card
  • LOAD filename.bas - loads a file from the SD card
  • CHAIN filename.bas - equivalent of: new, load filename.bas, run
  • SAVE filename.bas - saves the current program to the SD card, overwriting

EEProm - nonvolatile on-chip storage

  • EFORMAT - clears the EEProm memory
  • ELOAD - load the program in from EEProm
  • ESAVE - save the current program to the EEProm
  • ELIST - print out the contents of EEProm
  • ECHAIN - load the program from EEProm and run it

IO, Documentation

  • INPUT variable - let the user input an expression (number or variable name
  • PEEK( address ) - get a value in memory (unimplemented)
  • POKE address - set a value in memory (unimplemented)
  • PRINT expression - print out the expression, also "?"
  • REM stuff - remark/comment, also "'"

Expressions, Math

  • A=V, LET A=V - assign value to a variable
  • +, -, *, / - Math
  • <,<=,=,<>,!=,>=,> - Comparisons
  • ABS( expression ) - returns the absolute value of the expression
  • RSEED( v ) - sets the random seed to v
  • RND( m ) - returns a random number from 0 to m

Control

  • IF expression statement - perform statement if expression is true
  • FOR variable = start TO end - start for block
  • FOR variable = start TO end STEP value - start for block with step
  • NEXT - end of for block
  • GOTO linenumber - continue execution at this line number
  • GOSUB linenumber - call a subroutine at this line number
  • RETURN - return from a subroutine

Pin IO

  • DELAY timems*- wait (in milliseconds)*
  • DWRITE pin,value - set pin with a value (HIGH,HI,LOW,LO)
  • AWRITE pin,value - set pin with analog value (pwm) 0..255
  • DREAD( pin ) - get the value of the pin
  • AREAD( analogPin ) - get the value of the analog pin

NOTE: "PINMODE" command removed as of version 0.11

Sound - Piezo wired with red/+ on pin 5 and black/- to ground

  • TONE freq,timems - play "freq" for "timems" milleseconds (1000 = 1 second)
  • TONEW freq,timems - same as above, but also waits for it to finish
  • NOTONE - stop playback of all playing tones

NOTE: TONE commands are by default disabled

Example programs

Here are a few example programs to get you started...

User Input

Let a user enter a new value for a variable, enter a number like '33' or '42', or a varaible like 'b'.

10 A=0
15 B=999
20 PRINT "A is ", A
30 PRINT "Enter a new value ";
40 INPUT A
50 PRINT "A is now ", A

Blink

hook up an LED between pin 3 and ground

10 FOR A=0 TO 10
20 DWRITE 3, HIGH
30 DELAY 250
40 DWRITE 3, LOW
50 DELAY 250
60 NEXT A

Fade

hook up an LED between pin 3 and ground

10 FOR A=0 TO 10
20 FOR B=0 TO 255
30 AWRITE 3, B
40 DELAY 10
50 NEXT B
60 FOR B=255 TO 0 STEP -1
70 AWRITE 3, B
80 DELAY 10
90 NEXT B
100 NEXT A

LED KNOB

hook up a potentiometeter between analog 2 and ground, led from digital 3 and ground. If knob is at 0, it stops

10 A = AREAD( 2 )
20 PRINT A
30 B = A / 4
40 AWRITE 3, B
50 IF A == 0 GOTO 100
60 GOTO 10
100 PRINT "Done."

ECHAIN example

Write a small program, store it in EEPROM. We'll show that variables don't get erased when chaining happens

EFORMAT
10 A = A + 2
20 PRINT A
30 PRINT "From eeprom!"
40 IF A = 12 GOTO 100
50 PRINT "Shouldn't be here."
60 END
100 PRINT "Hi!"

Then store it in EEProm

ESAVE

Now, create a new program in main memory and run it

NEW
10 A = 10
20 PRINT A
30 PRINT "From RAM!"
40 ECHAIN

List both, and run

ELIST
LIST
RUN

Device Support

Current

  • Arduino - ATMega 168 (~100 bytes available)
  • Arduino - ATMega 368 (~1100 bytes available)
  • SD cards (via SD Library, for FILES, LOAD, SAVE commands, uses 9k of ROM)
  • EEProm (via EEProm Library, uses 500 bytes of ROM)
  • Serial IO - command console

Future

  • PS2 Keyboard for standalone use (maybe)
  • Graphics support via common function names and ANSI/ReGIS escape codes

Known Quirks and Limitations

  • If LOAD or SAVE are called, FILES fails subsequent listings
  • SD cards are not hot-swappable. A reset is required between swaps.

Authors and Contributors

Links

Licensing

Mike Field based his C port of Tiny Basic on the 68000 Tiny BASIC which carried the following license:

******************************************************************
*                                                                *
*               Tiny BASIC for the Motorola MC68000              *
*                                                                *
* Derived from Palo Alto Tiny BASIC as published in the May 1976 *
* issue of Dr. Dobb's Journal.  Adapted to the 68000 by:         *
*       Gordon Brandly                                           *
*       12147 - 51 Street                                        *
*       Edmonton AB  T5W 3G8                                     *
*       Canada                                                   *
*       (updated mailing address for 1996)                       *
*                                                                *
* This version is for MEX68KECB Educational Computer Board I/O.  *
*                                                                *
******************************************************************
*    Copyright (C) 1984 by Gordon Brandly. This program may be   *
*    freely distributed for personal use only. All commercial    *
*                      rights are reserved.                      *
******************************************************************

However, Mike did not include a license of his own for his version of this. From discussions with him, I felt that the MIT license is the most applicable to his intent.

I am in the process of further determining what should be done wrt licensing further. This entire header will likely change with the next version 0.16, which will hopefully nail down the whole thing so we can get back to implementing features instead of licenses. Thank you for your time.

MIT License

Copyright (c) 2012-2013

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tinybasicplus's People

Contributors

bleullama avatar drawkula avatar guruthree avatar imchristina avatar megamemnon avatar rmd6502 avatar testato avatar thomedes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinybasicplus's Issues

GOSUB on ESP8266 crashes

I am trying to get TinyBASIC plus working the on the ESP8266 to be used by some kids for a robotics camp. Everything seems to work except for the gosub command. The processor crashes every time it is used.

10 print "test"
20 gosub 100
30 goto 10
100 print "gosub"
110 return

This is my test program. Has anyone come across this issue?

I did some debugging and it appears the crash occurs in gosub:
struct stack_gosub_frame is 12 bytes which I assume is due to word alignment.
STACK_GOSUB_FLAG is copied.
The program crashes at f->txtpos = txtpos.

sp -= sizeof(struct stack_gosub_frame);
f = (struct stack_gosub_frame *)sp;
f->frame_type = STACK_GOSUB_FLAG;
f->txtpos = txtpos;
f->current_line = current_line;

I think I know the problem. progmem is a char array and may not be 32-bit aligned for the stack to be used at the end of progmem. Not sure how to get around it yet except maybe creating a separate 32-bit array for the stack.

Ivan

[FAQ?] Please explain the license changes in TBPs family tree

TBP is indirectly based on [Gordon Brandly]'s 68000 Tiny Basic with this copyright:

******************************************************************
*                                                                *
*               Tiny BASIC for the Motorola MC68000              *
*                                                                *
* Derived from Palo Alto Tiny BASIC as published in the May 1976 *
* issue of Dr. Dobb's Journal.  Adapted to the 68000 by:         *
*       Gordon Brandly                                           *
*       12147 - 51 Street                                        *
*       Edmonton AB  T5W 3G8                                     *
*       Canada                                                   *
*       (updated mailing address for 1996)                       *
*                                                                *
* This version is for MEX68KECB Educational Computer Board I/O.  *
*                                                                *
******************************************************************
*    Copyright (C) 1984 by Gordon Brandly. This program may be   *
*    freely distributed for personal use only. All commercial    *
*                      rights are reserved.                      *
******************************************************************

Is it really safe to use the MIT license for derived ports?

(This really is a question only, not an accusation!)

Terminal freezes after multiple funtion calls

Compiled tiny basic 0.13 and uploaded to UNO. Arduino 1.0.3 linux. Seems to run fine, until i use funtions often. I.e. Dread() or rnd(). Then terminal freezes (refuses input chars, ctrl-c is not recognised anymore).
When i make changes indicated in othe issue, and compile with 1.1.x arduino for linux, the terminal does not freeze, but outputs characters afte completing program with multiple fubtion calls.
Example: make a simple basic program that reads digital inout 256 successive times.

Solution ( i dont know how to use github, commit and such, but found the solution to the problem)

The memory allocation reserves 1160 bytes for system variables. Change this to 1200 bytes, then the problems are gone.

Maybe this is due to compiling under linux.

I post this here so some may benefit.

V0.13 not running on Arduino Mega 2560 anymore

Last tested V.0.02a - it was running on Arduino Uno and on Arduino Mega 2560.
Now V 0.13 is running fine on Arduino Uno (much more RAM and great EEPROM storage) but is not running on Mega 2560 anymore. Pin13LED is blinking all the time (blink-blink-pause blink-blink-pause ...) but nothing on the serial console. Used pure Arduino Mega 2560 (no shields) and sketch was unchanged as downloaded.

const in order to be put into read-only

I am having an issue with getting this to compile on 1.6.4...

variable 'keywords' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

I have tried adding 'const' to:

static unsigned char keywords[] PROGMEM

This does not work

const static unsigned char keywords[] PROGMEM

Anyone have any idea how to fix this??

suggestions for improvement

Dear BleuLlama,

Looking at your V0.15 I have 3 bug fixes for you, and one suggestion

Bug fixes:
1/ fix backspace issue
on line 753
replace
printmsg(backspacemsg);
with
printmsgNoNL(backspacemsg);

2/ fix delay command (allows multiple commands on one line in the basic program)
on line 1275
replace
goto execnextline;
with
goto run_next_statement;

3/ fix strange response INPUT when faulty key entry is given
move following:

             txtpos = tmptxtpos;

from: line 1492
to: a new location in between line 1488 and 1489

Suggestion for improvement:
add possibility to abbreviate commands in the basic program (i.e. use n. for next, dw. for dwrite)
on line 593 insert following code
else if(txtpos[i] == '.')
{
txtpos += i+1; // Advance the pointer to following the keyword
ignore_blanks();
return;
}

Regards,

Volhout

Build Error on Arduino IDE for Ubuntu 14.04

When I try to upload the code to my Arduino Uno it returns the following error:

In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:8:0, from TinyBasicPlus.ino:81: TinyBasicPlus.ino:278:33: error: variable ‘keywords’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’ TinyBasicPlus.ino:370:33: error: variable ‘func_tab’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’ TinyBasicPlus.ino:385:31: error: variable ‘to_tab’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’ TinyBasicPlus.ino:390:33: error: variable ‘step_tab’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’ TinyBasicPlus.ino:395:34: error: variable ‘relop_tab’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’ TinyBasicPlus.ino:415:36: error: variable ‘highlow_tab’ must be const in order to be put into read-only section by means of ‘**attribute**((progmem))’

Any idea what is causing this?

"Size of array 'program' is negative" and many more errors

I get this error when I compile TinyBasicPlus.ino:

Arduino: 1.6.5 (Windows 8.1), Board: "Adafruit Trinket 16MHz"

Build options changed, rebuilding all

TinyBasicPlus:270: error: size of array 'program' is negative
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
                 from TinyBasicPlus.ino:81:
TinyBasicPlus:278: error: variable 'keywords' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus:370: error: variable 'func_tab' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus:385: error: variable 'to_tab' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus:390: error: variable 'step_tab' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus:395: error: variable 'relop_tab' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus:415: error: variable 'highlow_tab' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
TinyBasicPlus.ino: In function 'void setup()':
TinyBasicPlus:1923: error: 'Serial' was not declared in this scope
TinyBasicPlus.ino: In function 'unsigned char breakcheck()':
TinyBasicPlus:1966: error: 'Serial' was not declared in this scope
TinyBasicPlus.ino: In function 'int inchar()':
TinyBasicPlus:2015: error: 'Serial' was not declared in this scope
TinyBasicPlus.ino: In function 'void outchar(unsigned char)':
TinyBasicPlus:2062: error: 'Serial' was not declared in this scope
size of array 'program' is negative

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

sd card

I have tiny basic on my arduino uno. The code says that if I enable fileio it adds 9k of usage. But when I enable it, it has only 9 bytes free so i cant do anything.

kindly help me with this weired error of eeprom header

C:\Users\Mohammad\Desktop\TinyBasicPlus\TinyBasicPlus.ino:87:0: warning: "ARDUINO" redefined [enabled by default]

#define ARDUINO 1

^

:0:0: note: this is the location of the previous definition

C:\Users\Mohammad\Desktop\TinyBasicPlus\TinyBasicPlus.ino:151:48: fatal error: EEPROM.h: No such file or directory

#include <EEPROM.h> /* NOTE: case sensitive */

[FYI] TinyBasic Plus v0.14 on ESP8266

Nothing dramatic, just a "for your information" issue:

TBP-0.14 compiles without changes in Arduino for ESP8266:

TinyBasic Plus v0.14
2801 bytes free.
OK
>_

After change of #define RAMEND 4096-1 to #define RAMEND 32768-1:

TinyBasic Plus v0.14
31473 bytes free.
OK
>_

A more dynamic way to set RAMEND probably is known somewhere... ;-)

It coughs on "INPUT" and some other stuff (I haven't logged them) with a reboot but simple stuff like...

>10 print "moo"
>run
moo

...works.

Maybe some ESP8266 fans will have fun looking closer at this?
On the other hand, there is a full blown ESP-BASIC out there.

Well... it's just an info...

virtmem library support

It would be great if you use the virtmem library from github.com/rhelmus/virtmem so you can increase ram memory using SD card.

Added functionality to TinyBasic

dear BleuLama,

I added (over the last years) functionality to your tinybasic.
Maybe you want to look at it and add this to your build (I am not planning my own repository).
Please find the code at: https://drive.google.com/open?id=1pI16iXnYMfVHf-DZn9ZWRupsfPwg4KOA

Added:

  • 2 servo support on UNO pin 9 and 10 (used PWMServo lib because it is not very memory hungry).
    and from MEGA at pins 11,12,and 13 (3 servo's). These run autonomous, need no CPU support.
    "SERVO pin, value" , and "NOSERVO pin". As long as one servo is active, AWRITE is not supported.
  • keyword abbreviation. Makes code less readable, but more compact.
    i.e. "DWRITE" can be abbreviated to "DW. And "PRINT" to "P."

Regards,

Volhout (Harm)
[email protected]

Was this tested for the SD Cards ? - Seems like 'FILES' cmd does not work.

Was this tested for the SD Cards ?

  • I formatted both 2GB and 256MB SD Cards with the SD Card Formatter app.
  • When I enter 'FILES' cmd , it just return lines of garbage (one line per filename ?)
  • I tried 'SAVE' cmd saving a basic program ; 'FILES' cmd still returns garbage , but oddly SD Card linked to PC sees the saved file and the basic code.

If the card has any files - then 'FILES' cmd returns garbage lines.
If the card is empty - then 'FILES' cmd just returns an empty line.

I repeatedly formatted and tested the SD Cards.

Seems like 'FILES' cmd does not work.

  • corrupted stream ? - not waiting for characters ready ? ... ?

:(

minor note on link in comments

on line 41 in TinyBasicPlus.ino there is a link for the original 68000 code. The carrier has just recently trashed all that content. It can, however, still be found at,
https://web.archive.org/web/20020209152817/http://members.shaw.ca:80/gbrandly/68ktinyb.html

Most likely the listing is the important bit.
https://web.archive.org/web/20020216031216/http://members.shaw.ca:80/gbrandly/Tbi68k.asm

Probably not super important but this project seems to be as much about history as current events. :)

TVout libraries causing problems

when I include tye TVout library, not even using it just including, i get the error: 'unsigned char* sp' redirected as different kind of symbol

even if I get this fixed, how, would I output the console to TV?

Stuck on "HELLO TinyBasic Plus v0.13" on Leonardo

Tiny BASIC used to run great on my Leonardo, howevever I could never get the DREAD or AREAD commands to work, so I looked I tried typing AREAD( A, 13 ) and I had a crash and ever since I try re-uploading the code, the serial monitor gets stuck in the "HELLO TinyBasic Plus v0.13" message, it wont take any command or even gibberish, whatever I send doenst even show up in the monitor. I've tried re-downloading and using different Serial communication softwares and nothing seems to help.

certain things cause it to send gibberish to the serial terminal

files returns gibberish for the filenames, even 8.3 short filenames
and sometimes the thing just starts spitting out gibberish to the terminal, try loading a file from SD card to see what I mean (just imagine seeing HHHHHHH repeating indefinitely until you hit the reset button on the card)

Started on ATMEGA8 ! keyboard+Nokia3310LCD needed!

Hi.
Impressed!!!
just started on Atmega8 8MHz with no-quartz! 640 bytes of basic RAM! EEPROM!
Now it blinking all LEDs on my board in FOR-NEXT loop!
I am afraid it has no capasity for ps/2 and lcd libraries.
Maybe just add one more atmega8 and make simple console with it?

Would adding 23LC1024 increase the SRAM, 39 bytes free

After compilling TinyBasicPlus i received a message
" HELLO
TinyBasic Plus v0.15
39 bytes free.
1024 EEProm bytes total.
OK

mem
39 bytes free.
1024 EEProm bytes total.
877 EEProm bytes available.
"
Adding 23LC1024 increase the SRAM ?

ENABLE_EAUTORUN on leonardo

Not sure if this is an issue anymore, but it should be looked into.

On an old ticket, ENABLE_EAUTORUN was set true, on a Leonardo (32u4 AVR).. presumably with no program stored. It would print out the splash text, and just sit there, as other input/output was inhibited since it was supposed to be loading from the EEPROM.

Why did this happen? Is it still an issue?

Modify expression builder to allow "."

I love this version of TinyBasic and use it often with my students. How can the expression builder be modified to accept decimal numbers? Allowing for this would vastly expand the usability of the program as it's simple to include floating point functions once the expression builder allows for those numbers to be entered. Hard coding FP numbers causes no issues, i.e hard coding Pi then calling it in a allows the basic geometry command has the correct output of an equation.

Math functions

I've been thinking that some math functions could be useful, even if they are limited by the short int integer format. I'm happy to write these myself, but thought it'd be worth getting some feedback before implementation. I'm currently thinking of the following:

  • SQRT(x) for square roots
  • POW(x,y) for exponents (x^y)
  • MOD(x,y) for modulus or division remainder (e.g. returns 2 for 8 % 3)
  • SIN(x), COS(x), TAN(x) for sine/cosine/tangent where x is in degrees and the output is returned as -127 to 127 mapping to -1 to 1
  • ASIN(x), ACOS(x), ATAN(x) for arcsine/arccos/arctangent taking -127 to 127 and returning 0 to 360.

I see #33 mentions MIN and MAX already, otherwise I would add these to my list.

Several SD card issues

Shield: seeedstudio SD shield version 4.2
SD card: 512 mini SD card with adapter (works with other programs using SD library)
device: arduino UNO R3
saving files resets the arduino as if "bye" was entered
files that are saved are blank
cannot add new files manually in windows 7 without it spitting gibberish
EDIT: the gibberish issue was with the card, not the sketch

ATMega 328p

Hello,
I have an arduino uno with a ATMega 328p, I am able to load the code to the arduino but when opening the serial window I get the follow:

HELLO
TinyBasic Plus v0.13
1039 bytes free.
1024 EEProm bytes total.
OK
>

I am trying to run the memory command MEM but nothing happens:

HELLO
TinyBasic Plus v0.13
1039 bytes free.
1024 EEProm bytes total.
OK
>MEM

I try a restart BYE:

HELLO
TinyBasic Plus v0.13
1039 bytes free.
1024 EEProm bytes total.
OK
>MEMBYE

As you see it just adds BYE on the end of my last command. Will this just not work on an ATMega 328p or am I doing something wrong?

Thanks for your help!

PLEASE ADD INPUT COMMAND FOR USER INPUT

I would love someone to add the input command so a programme can ask for a user input weather its a name or a variable e.g. Pick a number between 1 and 10. this would make programmes so much more us full /functional.

Kind regards,
Justin Harris

Spagetti code

I examined TinyBasicPlus.ino file. But, I saw much goto statements.

May functions be applied in this file instead of goto statements?

is there a Way to connect an 1602/2004 screen to an Arduino running Tinybasic and showing everything on it?

Hello!
I just found my first Arduino Uno and found out that i have put TinyBasic on it. And i like it!!
I just went through the code and think that the stuff gets written to the Serial monitor with serial read/write. So, now to the question. Is it possible to display the stuff from the Serial Monitor to an LCD? i think i should be able to use lcd.write instead of Serial.read/write. Will that be possible?
Best Regards
ChaosLeo07

SPI support

Create commands to send/receive SPI commands.

Useful for storing data in SPI-Based memory devices, reading SPI sensors, SPI based displays, etc.

printnum( E2END+1 ); what is this problem?

Help, i am newcomer and i have esp8266 and i in compilation see the error "TinyBasicPlus:1071:13: error: 'E2END' was not declared in this scope

printnum( E2END+1 );

         ^

exit status 1

'E2END' was not declared in this scope
"
what is this?
sorry for this text, i am 12 years old

I2C Support

Create commands to send/receive I2C commands.

Useful for storing data in I2C-Based memory devices, reading I2C sensors, I2C based displays, etc.

FOR loop with top limit of 32767

I don't know if that is a error inherent to basic language in general, but when i use the value 32767 as the top limit for the FOR loop, the loop will run forever since the variable will go from 32767 to -32768 and keep running.

FILES

Every time i try the command FILES it don't work.
But i can SAVE things and LOAD/CHAIN things .
Is it a bug or somting please help

Minimizing SRAM usage

My goal is to be able to run slightly larger programs.

I'm still learning this code (though I've read the original Palo Alto Tiny BASIC code, version 1 and 2!). I'm considering tokenizing keywords to save RAM. Would you be interested in that or should I fork the project?

I'm confused as to what else is using RAM besides the 26 variables and the call stack. What other opportunities would there be to minimize RAM usage?

arduino 1.6.5 - variable 'xxx' must be const in order to be put into read-only section

When using Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno" (gcc 4.8.1 was introduced in arduino 1.5.7BETA):
TonyBasicPlus.ino:278:33: error: variable 'keywords' must be const in order to be put into read-only section by means of 'attribute((progmem))'
TonyBasicPlus.ino:370:33: error: variable 'func_tab' must be const in order to be put into read-only section by means of 'attribute((progmem))'
TonyBasicPlus.ino:385:31: error: variable 'to_tab' must be const in order to be put into read-only section by means of 'attribute((progmem))'
TonyBasicPlus.ino:390:33: error: variable 'step_tab' must be const in order to be put into read-only section by means of 'attribute((progmem))'
TonyBasicPlus.ino:395:34: error: variable 'relop_tab' must be const in order to be put into read-only section by means of 'attribute((progmem))'
TonyBasicPlus.ino:415:36: error: variable 'highlow_tab' must be const in order to be put into read-only section by means of 'attribute((progmem))'
variable 'keywords' must be const in order to be put into read-only section by means of 'attribute((progmem))'

After using 'const'keyword the following errors appear:
TinyBasicPlus-arduino1.6.5.ino:776:23: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino: In function 'short int expression()':
TinyBasicPlus-arduino1.6.5.ino:905:22: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino: In function 'void loop()':
TinyBasicPlus-arduino1.6.5.ino:1144:21: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:1382:21: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:1390:23: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:1677:26: error: invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]
TinyBasicPlus-arduino1.6.5.ino:476:13: error: initializing argument 1 of 'void scantable(unsigned char_)' [-fpermissive]
invalid conversion from 'const unsigned char_' to 'unsigned char_' [-fpermissive]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.