SMART Response XE With New Arduino Basic Port

by DanGeiger in Circuits > Arduino

1273 Views, 6 Favorites, 0 Comments

SMART Response XE With New Arduino Basic Port

Ard_Basic.jpg

In my previous Instructable I ported a version of Tiny Basic to the SMART Response XE. I have been working off and on to port the more robust Arduino Basic from Robin Edwards (https://github.com/robinhedwards/ArduinoBASIC) to this device. This code allows for floating point math, arrays, and it keeps a buffered copy of the screen so you can use position x,y to set the cursor and don't suffer from the line-end problems I created in my previous Basic port. Here are some of the improvements:

1) Floating point math!! Numbers are stored internally as floats so you are no longer limited to integers. You can see in the picture I posted that it is busy calculating the positions of Jupiter's Moons.

2) The screen is buffered so you have more options to print your layout and it doesn't suffer from line overflow and backspace issues.

3) You can now use arrays of any size.

4) BATT is now an operator like RND and returns the current battery voltage in mV. To see the battery voltage use print batt. This allows you to write this value into your programs now.

5) INKEY was changed to return the ASCII value of the key pressed instead of a string. This gives you access to the 10 function keys along side the screen. This returns -16(F0) to -7(F9). To get the corresponding function key number just use INKEY+16.

6) I added ATN function to round out the trig functions.

7) The BYE command puts the unit to sleep and the button on top of the unit wakes it up. Current is 5mA while operating, and 30uA when asleep. There is probably more I could do to get the unit into deep sleep, but I am at the point that everything I try to fix causes something else to break.

8) SAVE and LOAD commands will save a program to the internal EEPROM. only one program can be saved here. The MSAVE and MLOAD command will save and load from the XE's external 1Mb flash. MSAVE 4 will save the current program to memory slot 4. You can use memory slots 0 to 9.

If you have a unit and method to program it, I have included the HEX file below to make life easier for you.

Supplies

SMART Response XE unit

HEX file

SR XE programmer

The posted files (sorry, Instructables doesn't allow zips) includes the Arduino code including the libraries. Use the ones included here as I have modified them specifically for this application.

See my other Instructable for more details on how to program and use these units.