The Half-Byte Embedded Tiny Basic is a subset of Half-Byte Tiny Basic. It does not contain the video or PS/2 style keyboard support and, thus, all of the graphical functionality has been removed. Serial communication is the only way to upload or write Basic programs in this version. The purpose to provide a quick, easy way to create applications for your devices.
Half-Byte developed a programmable clock using two 8×8 LED Arrays, using the Maxim 7219 chip, an HC-06 Bluetooth module, DS1307 based RTC, DHT-11 temperature sensor and a Half-Byte Console board. Embedded Tiny Basic runs the device and, via Bluetooth, it is easy to program the clock. I use Tera Term to connect to the device and can either type in a program or copy and paste one for quick upload.
Embedded Tiny Basic is tailored for these devices, the DHT-11 and the 8×8 LED Arrays, but it would be easy enough to change for what ever sensors you wish.
The download package contains the libraries, documentation and sample code as well as the Embedded Basic sketch. Arduino IDE 1.6.x and up should work. I have used 1.6.7 and 1.8.1 for Windows Store and it compiled fine.
Embedded Basic Specific Features
- 8×8 LED ARRAY
- SCROLL variable or function
- SCROLL “quoted text”
- SET column, row, on or off
- DIRECTION direction (where direction is 1 for left, 2 for right, 3 for up, 4 for down)
- BRIGHT x (where x is a value from 0 to 15) Controls the brightness of the LED Array
- CLOCK (DS1307)
- TIME (displays the time and date on the array)
- SETTIME hours, minutes, seconds, day, month, year (sets the time and date…all parameters must be supplied.)
- x=HOUR(0) (returns the current hour to the variable ‘x’, can be any variable)
- x=MINUTE(0) (returns the current minute to ‘x’)
- x=DAY(0) (returns the current day to ‘x’)
- x=MONTH(0) (returns the current month to ‘x’)
- TEMPERATURE SENSOR
- TEMP (sends the temperature to the array)
- HUMID (sends the humidity to the array)
- x=TEMP(0) (returns the current temperature to ‘x’)
- x=HUMID(0) (returns the current humidity to ‘x’)
- TONE pin, pitch, duration (sends a tone, specified by pitch, to pin for the duration)
- Use IF IN(0)<>-1 GOTO xxxx as an interrupt. This tests the Serial in pin for something other than a -1. -1 means there is nothing coming in on the serial pin. A non -1 value means the user likely hit a key on the keyboard of the Serial device. Useful for Bluetooth connections over serial, like the HC-06.
- SAVE your program and it will autorun when the device is restarted. You will have three seconds to interrupt the autorun sequence (pressing a key will do.)
- Combine statements where possible to save space.
- Use ? instead of PRINT
- Every effort has been made to fully debug Embedded Tiny Basic, but there may be some things that have been missed. Please feel free to let us know on the blog via comments of the Facebook page.
Please feel free to share any programs you have written in Embedded Tiny Basic as well as suggestions, tips, tricks, complaints, etc. As stated above, you can do so here on the blog via comments or on the Facebook page (https://www.facebook.com/eightbitsblog/)
SAMPLE CODE: 100 SCROLL" Half-Byte Clock. " 110 TIME 120 SCROLL " Indoor temp is " 125 IF IN(0)<>-1 GOTO 500 130 TEMP 140 SCROLL " Humidity is " 150 HUMID 160 SCROLL "% " 170 H=HOUR(0):M=MINUTE(0) 180 IF H=11 IF M>30 IF M<40 TONE 8,1024,2048 200 IF IN(0)<>-1 GOTO 500 300 GOTO 100 500 SCROLL "Done" Note: line 180 acts as an alarm. If the time is 11:30am, a sound will play for about two seconds. Lines 125 and 200 checks for a signal on the Serial in pin. If it is there, control transfers to line 500 and stops.