BleuLlama / TinyBasicPlus

A C implementation of Tiny Basic, with a focus on support for Arduino
403 stars 117 forks source link

Sould add Servo motor control and LCD output support #4

Closed m0ric3 closed 6 years ago

m0ric3 commented 10 years ago

using Servo.h and LiquidCrytal.h

kind of like the original TinyBasic used by Ben Heck

BleuLlama commented 10 years ago

The problem with including these libraries is that they will essentially decimate any RAM that's left for program storage. Not to mention that the program memory is almost filled as it is right now. He hasn't released any of his stuff, so we don't even know if he could write any programs of any size at all. I was aiming for more progammer friendly for space, rather than for including peripheral options.

Feel free to try out adding them in :)

-s

On Wed, Aug 14, 2013 at 12:51 AM, m0ric3 notifications@github.com wrote:

using Servo.h and LiquidCrytal.h

kind of like the original TinyBasic used by Ben Heck

— Reply to this email directly or view it on GitHubhttps://github.com/BleuLlama/TinyBasicPlus/issues/4 .

Scott Lawrence yorgle@gmail.com

CyberSpiderPrime commented 8 years ago

Using Arduino Uno and Nano, IDE 1.5 I have added LiquidCrystal.h (only, no Servo yet) to versions 0.03 and 0.13. After looking at the code Ben Heck ("The Ben Heck Show", youtube) used for his show (for me it wasn't flexible enough and hard to read/didn't make sense, make up your mind 14 or 16 characters per line), I wrote my own frame buffer (bottoms up, 2d array, can set for either 16x4 or 20x4 displays, 4 separate routines):

define lcdHeight 4 //number of rows

define lcdWidth 20 //20 or 16 character per row

byte lcdPosition = 0; //cursor position on bottom row byte frameBuffer[lcdHeight][lcdWidth]; //frameBuffer, 64 or 80 bytes byteChar(byte row, boolean sendClear) : send a row to lcd or clear a row render(): send entire frameBuffer to LCD (row order 0, 2, 1, 3 per HD44780 specs) moveUp(): dumps first line, moves others up, blanks last row, resets lcdPosition lcdChar(byte c): calls moveUp() as needed, adds byte to frameBuffer as needed, calls render LiquidCrystal lcd(7,8,9,10,11,12) in setup(), lcd.begin(lcdWidth, lcdHeight), initialize frameBuffer In outchar, change Serial.write(c) to lcdChar(c) in line_terminater, commented out the NL line when using lcd (will cause a double linefeed in my code as it will linefeed on NL or CR, will make a switch later)

I can get 0.03 working perfectly, no problems at all.

With 0.13, it seems that creating to LCD object creates a conflict.
I have tried adding the #include, object creation, #defines, global variables, and frameBuffer functions one piece at a time, compiling after each change (no errors show up during compile).
As soon as I create the LiquidCrystal lcd(7,8,9,10,11,12) object (haven't added my routines, output at this point is still Serial.write) it stops outputting. Comment it out and the sketch starts working again.

I have searched the web to find if the LiquidCrystal library has any conflicts with any other library and none is showing up. I see that the SD and SPI libraries could have one (pin 10) but I am not using those libraries at this time (not defined as present).

Any ideas on this? Where can I find previous versions between 0.03 and 0.13? I would like to walk my changes through them to see if I can find the problem. Will you be updating the code to work with IDE 1.6.x or higher? I am having the same problems as another user (revolves around the PROGMEM changes to the environment) which is why I am sticking with 1.5 at this time (seems the newer versions break older code).

BleuLlama commented 6 years ago

Not sure about the resolution on this one. If it is still an issue, @CyberSpiderPrime, please reopen the ticket.

Others have gotten PS2 jeyboard working on the device with the interpreter, but needed to put the LCD on a secondary arduino.

CyberSpiderPrime commented 6 years ago

Other than finding out that with a simple voltage divider, HC-05, and an android bluetooth chat program (BlueTerm 2) I can add remote input/output with no code changes, I haven't worked much lately with the program - was waiting on a response. The main problem I see now is the inability to compile the program with the newer IDEs (problems with PROGMEM, believe problems start shortly after Arduino IDE version 1.6 which break the program, tried several web solutions for PROGMEM problem but none fully work), haven't checked lately to see if you have fixed that yet.

My goal is/was to have an Arduino Nano in an arm mounted shell (Space Armor toy, keep ultra bright LEDs, retain battery compartment or maybe an Iron Man version Missle Launcher emptied and heavily modified), exposing useable pins, and have it control add-ons through Tiny Basic, any readable output going to a Nokia 3110 LCD, new BASIC code written on the fly.

The bluetooth module changes some parameters of the build (using an old smartphone for input/output) but not the underlying PROGMEM issue.

On Sun, Jun 24, 2018, 4:34 PM Scott Lawrence notifications@github.com wrote:

Closed #4 https://github.com/BleuLlama/TinyBasicPlus/issues/4.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BleuLlama/TinyBasicPlus/issues/4#event-1697738691, or mute the thread https://github.com/notifications/unsubscribe-auth/APsi9D_uRncVOCMet9M2oWZbFuVvyMZkks5t__fhgaJpZM4A5q99 .