Gaming on an ATTiny-85: the controls

Half-Byte’s Hand Held Game, version 3

I have written about ATTiny-85 gaming quite a bit now. There are dozens of designs and lots of games for the various platforms that have sprung up. The ATTiny-85 is quite a capable little controller for rather complex games, both retro style and more contemporary. That is one of the nice things about this cheap little controller. However, interfacing to the chip can be a bit dodgy. You can get by with only two buttons for controls. I have seen some rather clever schemes that utilize four way directions with only two buttons. The two button Pac Man game for the TinyJoypad is a great example. However, four buttons plus an action button is always better. You can implement this scheme with only two pins used. The problem I have with this method is the actual wiring of the switches. I will, inevitably, miss a pin (usually a ground) or I will get them reversed. At any rate, these tire eyes seem to have issues with something this simple. My solution came in the form of a directional switch, like the one in the photo below. It has a four way button with center press and two additional switches. The best thing is that there is a common ground and the pins are broken out and marked. The assembly is the DAOKI Button Module Rocker Five Direction Button Module. I bought them from Amazon for about six dollars. Unfortunately, this particular item is no longer available through Amazon, however, this one is. The KOOBOOK item is identical. These operate on 2 to 9 volts and have a thumbstick feel. You can use a ribbon cable with removable connectors to allow for some freedom when playing your games. See the photo with the controller below.

You can buy these from most electronics parts dealer. I get most of my parts through Amazon, just because it is usually quick and not very expensive. You can get them via eBay, JameCo, etc. They make wiring so much better, especially for those of us who have less than stellar eyesight.

By the way, the TinyJoyPad ATTiny-85 version, is a nice little design. It is a variation of the Webboggles design from years past. Simple and well supported. If you want to get into ATTiny-85 gaming, or want portable retro style games, this is a great place to start. I have created a simple two button version based on the same platform.

DAOKI/KOOBOK Five Direction Button
TinyJoyPad control schematic

The game with the controller attached via ribbon cable.
Two button with speaker

Radio On Internet: A Hackerbox Adventure

I have been getting the wonderful Hackerboxes for months now and they have never let me down. The most recent Hackerbox is an Internet radio receiver platform. It consists of a very high quality PC board, an ESP32 WROOM, an audio decoder board, a nice LCD (color) as well as SD card slot and an IR with remote. It’s quite a little package and works very well. Hardware wise, it went together really easily. The only real issue was that the SD card board had the header pins soldered to the wrong side of the board. I could have mounted it from the back of the main board, but chose to cheat and melted solder through the holes and mounted the board on the top of the main board. You can see in the photo below.

Hackberbox #0070 – Radio on Internet, completed

Assembly was a breeze, so I am not going to say more about that, just be careful with the rotary encoder. I had an issue with the pins bending on me while inserting them into the board. Of course, that could have just been me.


Download the package from here. You can use the latest Arduino IDE to modify and/or compile and upload to the ESP32. Google or Bing “ESP32 and Arduino” if you do not know how to setup the IDE for ESP32. Once you open the INO file, the IDE will prompt you if the file is not in a directory that exactly matches the sketch name. If it isn’t, the IDE will create a directory and move the INO file into the directory. If that happens, make sure you copy the SOURCE directory into the new directory. Close and reopen the sketch. You should see all of the project files show up in the IDE tabs. Then, make sure you have the microcontroller settings and port selected correctly. (Under tools>board in the Arduino IDE, select the “DOIT ESP32 DEVKIT V1” which is the same board used in the project.)

In order to successfully compile the project, you will need to install a few libraries. First, install the ‘Adafruit ST7735 and ST7789‘ (use Tools->Manage Libraries.) You will also need to install the ‘pubsub’ library.  Go to the library manager and search pubsubclient, scroll down a bit and install the MQQTPubSubClient library.

You may also need to change some code to get the LCD displaying correctly. Open the ‘bluetft.h’ file and look for the following section:

bool dsp_begin()
  tft = new Adafruit_ST7735 ( ini_block.tft_cs_pin,
                              ini_block.tft_dc_pin, -1 ) ;        // Create an instant for TFT
  // Uncomment one of the following initR lines for ST7735R displays
  tft->initR ( INITR_GREENTAB ) ;                                 // Init TFT interface
  //tft->initR ( INITR_REDTAB ) ;                                 // Init TFT interface
  //tft->initR ( INITR_BLACKTAB ) ;                               // Init TFT interface
  //tft->initR ( INITR_144GREENTAB ) ;                            // Init TFT interface
  //tft->initR ( INITR_MINI160x80 ) ;                             // Init TFT interface
  //tft->initR ( INITR_BLACKTAB ) ;                               // Init TFT interface (160x128)
  // Uncomment the next line for ST7735B displays
  //tft_initB() ;
  return ( tft != NULL ) ;

Uncomment the ‘tft->initR(INITR_GREENTAB)’ line and comment out whichever line is not commented out. It will likely be the BLACKTAB line.

Also, make sure the pins for the Rotary Encoder are:

pin_enc_clk = 26 # GPIO Pin number for rotary encoder “CLK”
pin_enc_dt = 25 # GPIO Pin number for rotary encoder “DT”
pin_enc_sw = 27 # GPIO Pin number for rotary encoder “SW”

In order to use the IR remote, make sure there are IR codes listed in the config. Here are a few:

# Some IR codes
ir_A857 = upvolume = 2
ir_E01F = downvolume = 2
ir_C23D = stop
ir_02FD = stop
ir_906F = mute
ir_E21D = uppreset = 11
ir_A25D = downpreset = 1
ir_A25D = preset = 0
ir_30CF = preset = 1
ir_18E7 = preset = 2
ir_7A85 = preset = 3
ir_10EF = preset = 4
ir_38C7 = preset = 5
ir_5AA5 = preset = 6
ir_42BD = preset = 7
ir_4AB5 = preset = 8
ir_52AD = preset = 9

You can setup the radio via a web interface. When you first start it, you can open a browser, change your WiFi to point to ‘ESP32Radio’ and goto:

From there, you can change the configuration and have the radio point to your router. Goto the configuration page and scroll until you see the WiFi settings. Enter the SSID/password in that format (like: Challenger/yourpassword)

Once you save the new configuration, the radio will restart and connect to your router. Open the Serial monitor and watch the output. It will tell you the new IP for the web interface. It also displays on the LCD, but it is quick. Use the serial monitor instead. Don’t forget to point your WiFi back to your router (I forgot…spent 30 minutes trying to fix it…)

All of the pins are specified in the config settings. This makes it easy to change them.

pin_enc_clk = 25                 # GPIO Pin number for rotary encoder "CLK"
pin_enc_dt = 26                  # GPIO Pin number for rotary encoder "DT"
pin_enc_sw = 27                  # GPIO Pin number for rotary encoder "SW"
pin_ir = 35                      # GPIO Pin number for IR receiver VS1838B
pin_sd_cs = 22                   # GPIO Pin number for SD card "CS"
pin_spi_miso = 19                # GPIO Pin number for SPI bus MISO
pin_spi_mosi = 23                # GPIO Pin number for SPI bus MOSI
pin_spi_sck = 18                 # GPIO Pin number for SPI bus clock
pin_tft_cs = 15                  # GPIO Pin number for TFT "CS"
pin_tft_dc = 2                   # GPIO Pin number for TFT "DC"
pin_vs_cs = 5                    # GPIO Pin number for VS1053 "CS"
pin_vs_dcs = 16                  # GPIO Pin number for VS1053 "DCS"
pin_vs_dreq = 4                  # GPIO Pin number for VS1053 "DREQ"

Some things to remember…

When entering Internet stations, do not use the ‘http://’ or ‘https://’. Enter the URL without those.

Example: preset_11 = # 11 – Classic Rock (in the cofig file, or in the user interface.)

If stations change at random intervals, open up defaultprefs.h and remove the line gpio_34 = station =

The PubSubClient by Nick O’Leary works fine.

Read the PDF documentation in the project.

Unassembled project
Web Interface

The ATTiny 85 Handheld Game – New Games

The ATTiny 85 Handheld Game – New Games

Half-Byte ATTiny-85 Hand Held Game, based on the WebBoggles design

There are several new games contributed to the hand held game devised by Webboggles (and adapted by me for the Half-Byte Handheld Game.) Check them out by going here:

Among the new games are:

  • PONG
  • and the original games in bundles of two

There are variations of the hardware, for example, the PONG game really needs a potentiometer or paddle control. Schematics are included.

The games are free for personal use.  

Please show WebBoggles your appreciation.

Tetris Schematic:

Tetris Multi-Button

Frogger Schematics:

Frogger Attiny Schematic

Running Tiny Basic on the Micro: Bit

I was looking for some things to use in teaching my kids some programming with the BBC Micro: Bit and came across Tiny Basic on the Micro: Bit.  The implementation of Tiny Basic is a cross between Arduino Tiny Basic and Palo Alto Tiny Basic.  It’s very comprehensive and includes things like LED control, sensor reading, and serial communication via USB.  This is a great way to introduce kids and adults alike to the wonderful world of programming, hardware and the Micro: Bit. 

Full source is available, unfortunately, the GITHUB is in Japanese.  HOWEVER, you can use Google or Bing translate to translate the page for you. 

I have taken the liberty of bringing some of the information to you.  I had a bit of an issue making it work, so, here’s what I found so you don’t have to worry about it.


You can, of course, download the full source and associated libraries and compile it yourself and then import into the Micro: Bit.


All you really need is the compiled HEX file.  To get that…

  1. Download

  2. Connect the  micro:bit.
    You should see the Micro:bit drive “MicroBIT”
    Unzip the download file
    From the bin folder, copy the file  ttbasic_microbit.ino.hex to the micro:bit (you can drag and drop it into the Micro: Bit folder.

  3. When the program write is finished, connect the serial with terminal software (TeraTerm, for example) etc.

  4. Set up your terminal software as follows:

    Terminal communication conditions Communication speed 115200bbs, parity none, stop bit 1, flow control: No; set the transmission delay to 1 ms/character.

Once you have downloaded the hex file to the micro: bit and setting up and connecting to your favorite terminal app, you should reset the micro: bit and see something like:

tinybasicformicrobitThe dialect of Tiny Basic is similar to Half-Byte Tiny Basic, but, it has far more capability.  With more memory to work with, no graphics and Micro: Bit hardware, there are a bunch of things you can do.

The following is copied directly from the web site.

Available keys

  • Cursor Move Cursor Key
  • Delete, CTRL-X: Delete characters at cursor position
  • BackSpace: Delete characters before cursor and move forward
  • PageUP, PageDown, ctrl-r: Refresh the screen
  • HOME, END: Move cursor to left or right edge in row
  • INS: Toggle toggle switching for insert sand
  • Enter: Line entry confirmed
  • Press ESC twice, ctrl-c: suspend execution program
  • CTRL-L, F1: Clear Screen
  • CTRL-R, F5: Screen Refresh

Pin-assigning and pin-specifying

  • Pin: Specified by PN0 through PN32, or 0 through 32
  • Pin mode specification command :GPIO pin , OUTPUT | INPUT_PU INPUT_PD INPUT_FL”
  • Digital Output:OUT Pin, HIGH| LOW|0|1
  • Digital input: variable =IN(pin)
  • Analog input: variable =ANA(pin)

Sample Program

Colored text on the screen

10 FOR I=0 TO 10
20 FOR J=0 TO 10
30 COLOR RND(8): ? "*";
35 WAIT 100
50 ?

Flashing LEDs on board

20 OUT 3,LOW
35 "@loop"
40 OUT 26,HIGH
50 WAIT 300
60 OUT 26,LOW
70 WAIT 300
80 GOTO "@loop"

Analog value display

10 CLS
20 A=ANA(PN0)
30 LOCATE 5,5:?A;"    "
40 GOTO 20
Button input determination
10 CLS
20 IF !IN(BTNA) ?"Button A"
30 IF !IN(BTNB) ?"Button B"
40 WAIT 200
50 GOTO 20
LED Matrix Dot Display
10 CLS 1
20 D=1
30 FOR Y=0 TO 4
40 FOR X=0 TO 4
60 WAIT 100
90 IF D D=0 ELSE D=1
100 GOTO 30
LED Matrix Message Display
10 CLS 1
20 MSG LEFT,200,"Hello"
30 FOR I=O TO 30
40 MSG DOWN,50,I/10
50 WAIT 50
60 MSG LEFT,100,I%10
80 WAIT 500
90 GOTO 20
Assign ed.m. character A to display
10 POKE FNT+ASC("A")*5+0,`00000000
20 POKE FNT+ASC("A")*5+1,`01010000
30 POKE FNT+ASC("A")*5+2,`00000000
40 POKE FNT+ASC("A")*5+3,`10001000
50 POKE FNT+ASC("A")*5+4,`01110000
60 MSG TOP,0,"A"
10 SETFONT ASC("A"),$00,$50,$00,$88,$70
Neopixel Blue Trajectory Rotation
10 'Neopixel(1)
20 NPBEGIN 0,16
40 FOR I=0 TO 7
50 NPRGB I,0,0,(2<<I)-1
80 WAIT 50
90 GOTO 70
4x4Keypad input key determination (simple chattering measures available)
10 'Keypad 4x4
20 G0=-1
30 @(10)=1013,920,840,780,670,630,590,560,502,477,455,435,400,320,267,228
40 G0=G
50 G=GRADE(ANA(1),10,16)
60 IF G<>G0 WAIT 1 GOTO 40
70 IF G>=0 ?"KEY=[";G+1;"]"
80 GOTO 40
Time display (display the time when you press A button)
1 'トケイ
20 SETDATE 2018,1,16,12,0,0
30 IF !IN(BTNA) GOSUB "@ShowTime"
40 WAIT 200
50 GOTO 30
60 "@ShowTime"
80 MSG LEFT,80,#-2,T1;":";T2;":";T3;" "
(new!) Browsing Misaki Font Data
1 '美咲フォントの利用
10 S="あ"
30 FOR Y=0 TO 7
40 D=PEEK(A+Y)
50 FOR X=0 TO 7
60 IF D&($80>>X) ?"■"; ELSE ?"  ";
80 ?
(new!) Character display with NeoPixcel (8×8 matrix type)
10 'NeoPixelで文字表示
20 SETFONT 0,$50,$A8,$88,$88,$70
30 MSG TOP,0,CHR$(0)
40 NPBEGIN 12,64
60 S="こんにちは☆さい玉":C0=RGB8(0,2,3)
90 FOR Y=0 TO 7
100 D=PEEK(A+Y)
110 FOR X=0 TO 7
120 IF D&($80>>X) C=C0 ELSE C=0
140 NEXT X
150 NEXT Y
160 NPPUT 0,MEM,64,1
170 WAIT 400
180 NEXT I
190 GOTO 70
(new!) LED Matrix Font Creation Tool (Created by Mr. Goeda)
10 CLS:CLS 1:CLV:LET @(20)=79,42
20 FOR I=0 TO 4:FOR J=0 TO 4
40 K=INKEY()
50 X=X+(K=KRIGHT)*(X<4)-(K=KLEFT)*(X>0)
60 Y=Y+(K=KDOWN)*(Y<4)-(K=KUP)*(Y>0)
80 IF K=32:IF C=@(20) P=@(21) ELSE IF C=@(21) P=@(20)
90 IF K<>32 GOTO 40
100 ?CHR$(P);
110 FOR I=0 TO 4:D=0
120 FOR J=0 TO 4:C=VPEEK(J,I)
130 IF C=@(21) D=D+(1<<(7-J))
140 NEXT J:@(I)=D
150 NEXT I
160 GOSUB 500:GOTO 40
500 LOCATE 0,10:?"SETFONT ASC(";CHR$(34,90,34,41);
510 FOR I=0 TO 4:?",$";HEX$(@(I),2);:NEXT I
520 SETFONT ASC("Z"),@(0),@(1),@(2),@(3),@(4)
530 MSG TOP,0,"Z"

From then on is the original document

TOYOSHIKI Tiny BASIC for Arduino

The code tested in Arduino Uno R3. Use UART terminal, or temporarily use Arduino IDE serial monitor.

Operation example

> list 10 FOR I=2 TO -2 STEP -1; GOSUB 100; NEXT I 20 STOP 100 REM Subroutine 110 PRINT ABS(I); RETURN

OK >run 2 1 0 1 2

OK >

The grammar is the same as PALO ALTO TinyBASIC by Li-Chen Wang Except 3 point to show below.

(1) The contracted form of the description is invalid.

(2) Force abort key PALO ALTO TinyBASIC -> [Ctrl]+[C] TOYOSHIKI TinyBASIC -> [ESC] NOTE: Probably, there is no input means in serial monitor.

(3) Other some beyond my expectations.

(C)2012 Tetsuya Suzuki GNU General Public License

RCA Voyager III Tablet Mini Review

MVIMG_20190727_221225Tablets seem to be more of a commodity product than the revolutionary product they were a decade ago.  Indeed, it seems that everyone has a branded tablet and the company that owns the RCA name now also has a tablet: The RCA Voyager III. This tablet is powered by a quad core processor with a 1024 by 600 pixel display (IPS…boo) and runs Android 8.1. Oh, it’s $49.95 from Wal-Mart.  As of this writing, it was being sold as an impulse item in the ‘back to school’ section near the front of the store.  It’s bargain bin price reflects it bargain bin quality and performance.

The device has 16gb for storage, but is upgradable via MicroSD.  When installed, the SD card can either be formatted and made ‘internal’IMG_20190727_231620 to the device, which means no other device can read its contents OR you can use it as a separate storage for your own media.  That’s how I am using the 2 gb card I put in it.

Even though it is a fifty dollar tablet, it does have some things to like.  For example, out of the box setup was quick and easy.  As it runs Android 8.1 AND has the full Google suite, it has Google Play and, thus, a ton of software. As with my phones, the first thing I did was install Launcher 10 to add a more sensible shell in the guise of Windows Mobile 10.  Gotta have my tiles.

The tablet’s screen is responsive, touch wise.  Any lags are due to the slowness of the processor, I think.

Now, speaking of the screen, this leads me into what is not good about the device.

  • The screen is, simply put, awful.  It is fuzzy, low res and muted.
  • Performance is also mediocre.  Tapping an icon to start an app results in a few second delay followed by the app actually staring, if it can.
  • The feel of the device is, well, cheap.  It is all plastic. At least Kindles have a more ‘premium’ feel, well, compared to this, anyway.
  • The cameras are terrible.
  • Sound is tinny as hell.
  • Did I mention the cameras?
  • Battery life seems a tad lower than the advertised time of 6 hours.  It’s probably more like 4 to 5 with real world use.
  • And, perhaps, the worst thing of all: a proprietary power adapter. RCA eschewed the USB charging scheme for a small mini plug, like you would have found 15 years ago.  UGH.


Now, in summary, don’t get me wrong: the tablet is not a great product on it’s own: you must keep in mind that it is cheap and, as such, does not make use of new tech or high quality parts.  BUT, keeping that cheapness in mind, it’s not a bad buy.  If you are out and about and need something a bit bigger than your phone, and you do not care about quality, this tablet won’t let you down.  It is adequate for light web surfing, listening to a podcast, simple games and checking that credit card balance. An Amazon Fire 7 may be a better buy, for the same price.  On second thought, the Fire 7 probably should be your first choice.  IF you cannot pick up a Fire 7 AND you have an immediate need for a crappy tablet, this thing is probably a good bet.  Perhaps.

UPDATE! – March, 2020

I am surprised and please to share that RCA has sent several over the air updates to firmware AND Android.  I am not yet sure about the updates, but, the tablet does seem a bit more responsive and stable.  Stay tuned, I will update with more.

BBC Micro:Bit

66252304_2329475737122168_1827825187962224640_oThe BBC Micro: Bit is, to say the least, an outstanding product.  Designed to give the youth of Great Britain a headstart in the world of computing, the device made its way outside of the UK and has been available in the US for a time now.  I decided to give it a spin and, boy, talked about impressed.  It’s very small, very simple and very po67347291_2344305822305826_4275078865820319744_owerful. For under twenty US dollars, you get a micro that contains two buttons, a 5×5 LED matrix, ample RAM and EPROM, a simple but effective bus, battery power as an option via a built in connector, accelerometer, Bluetooth and more.  This thing is super simple to program as well (which was the goal.)  You can use Microsoft’s MakeCode IDE, the MakeCode website, A micro Python development IDE (via the WEB) and even Arduino IDE.  MakeCode is, perhaps, the easiest to use. It appears to work and look like the Scratch environment where you, literally, drag and drop controls to connect them together and form your program. You can get surprisingly sophisticated with this.  Each Micro: Bit is capable of communicating with other Micro: Bits, which allows for multiuser games or other uses.


There is also a fair amount of third party support for Micro: Bit.  Add on LCD screens (which I have purchased one), controllers, cases, etc. I am in the process of reviewing a few and will write about them later. 

I am using these (I bought three, one for each of my younger children and one for myself—naturally.)  Both of my young ones seem to have taken to the device, with my youngest, who is six, being the most fascinated with the device.66520223_2334648659938209_3996346474836262912_o

The pricing for the device, under twenty US dollars, is perfect and the accessories are inexpensive as well.  Getting into hardware and software is easier and cheaper than ever.  This is a great way to enter the field.

Stay tuned for code, more photos and other tidbits on this terrific little device.

Sony PlayStation Retro Console…Thoughts

So, Sony decided to enter the retro ‘mini’ console craze that has seen the likes of Atari, Intellivision, Colecovision, Commodore, Sega and Nintendo become fun again.  They released a mini console replica of the original Playstation console from the nineties.  Now, I am not going to go into detail over what games came bundled or how much fun they are (a LOT) but, instead, I want to comment on the design, ease of use and a few nits over what is, otherwise, a decent product. Purists will bitch about it and the gaming press has villified Sony over the console, but, I am not (!) going to do that.


First, let me get my complaints about the console out of the way. 

Number 1: No power supply. Yes, this thing ships with ONLY a USB cable for power. Sony assumes you will plug it into your modern television’s USB port.  However, that did not work for me. I am not sure why, the set I use it on has a powered USB port, but, the console refused to get its power from there.  A normal USB wall wort worked fine.

Number 2: The unit took forever (OK, a few added seconds) to power up. When I plugged it into the wall wort, nothing appeared to happen. But, after a few seconds, the LED lit up an amber color. Pressing the power button turned the LED green and the console came to life.  It works fine.  So, I tried the USB port on the set again…nada, zero, zilch.  Didn’t get power from there.  The old Roku, though, did.  Odd.

Number 3: The interface is terrible.  The circular carousel isn’t the issue, its the quality of the presentation.  Yes, I get that it emulates something from the 90s, but, on a larger screen, it’s difficult to read.  The HDMI output is greatly appreciated, but, the presentation should match. The games, don’t necessarily have to, but everything else should. And, this leads to Number 4 and 5…

Number 4:  Why HDMI only?  The set I was going to put it on has bad HDMI inputs (yes, all three ports are dead) so, I wanted to use COMPOSITE, but, no, no composite output.

Number 5: Sony should release more games (as some other company has) for the console.  The 20 games included are fun, but, it would be nice to have more.

Number 6:  Last, the size of the console is a problem for me.  While it is cute, its a bit small (the controllers are, however, full size) and very light…which is the issue.  The attached controllers (both are USB and I am grateful for that) and if you move excitedly, you end up pulling the console with you.  A minor thing, but, annoying nonetheless.


There is a lot to like about the console.  It is unobtrusive (to a fault) and easy to set up. The controllers are familiar, so there is zero learning curve if you have played Playstation at all.  The selection of games is nice and, Tekken 3, is the bomb. The games, to me, are faithful enough and seeing the Sony logo is really cool (even though I am not much of a Sony guy) as it reminds me of the fun I had on my PS ONE.

Even with the paltry 20 games that are included, they are good games…but…if you want more from Sony, that is a no go, HOWEVER…if you search on Amazon, you can find a few products that add more games.  I ordered one

such device (a USB stick and a four port USB hub) that added 51 fighting gams (most of the Street Fight type) and an additional product that adds another 101 games.  So, for under 80 dollars, you can relive the early to mid nineties PlayStation experience. 

Even with my six ‘nits’ against the device, it was well worth the forty bucks I paid on Prime Day (it doesn’t cost much more if you shop around) and it even excited my two younger kids, both of which grew up on XBox 360 and Nintendo Wii and Switch.  Their initial thoughts…”wow, those are OLD” But, they loved the games. And, really, that’s all that should matter.

The Mini PlayStation is great deal.  Contrary to what has been written about it, it comes packed with nostalgia, good games and a nifty little case that is a tad on the small side.  You and your kids will love it.

Upgrading your car: replacing that old CD Player with a new touchscreen system with Bluetooth and more

AltimaHybridI have a 2007 Nissan Altima Hybrid. It is nothing fancy, and isn’t in the best shape. Oh, the body is in good shape, it needs a little TLC, like paint and other cosmetic fixes.  Creature comfort wise, though, it came with a workable CD/Radio, cruise, power seats and…that’s about it.  Well, I also have a 2007 Infiniti with a lot of bells and whistles.  So, I wanted some of that in my Nissan.  I set about to see what I could do.  I found out that there are A LOT of possibilities.  And, they don’t cost an arm and a leg.  So, I swam through a sea of similar head end units and found one for under $40 (US).  The unit has MP3 audio, SD and USB ports, plays a plethora of video formats, FM Radio, backup camera support, 7 inch, HD touch screen, Bluetooth and supports video in and out.  Wow. For forty bucks.  Well, in order to install this, you need an installation kit. So…I got one of them AND the correct wiring harness for the 2007 Altima with digital enviro controls.  The installation kit was twenty five dollars (US) and fits the car perfectly. 

The items arrived, days apart, of course.  I tested the headend and it appeared to be fully functional so I preassembled the installation kit and mounted the head in the kit.  I then soldered the harnesses so they would be ready.  20181023_201024

Installation was relatively easy…except, the head was about 5 mm too wide and, maybe one mm too high for the kit.  I was able to make it work by trimming the bezel and, since the kit is plastic, was able to slightly bend one bracket just enough to where the mounting holes lined up. The bezel that goes on the front had to be trimmed a bit for the knob.

received_328936107898619Installing the whole thing in the car was even easier.  Pop off the vent cover, pull off the bottom cover (just under the enviro controls and remove the two screws at the top and two at the bottom and pull the unit out.  You then have to remove the environ controls. There is one Torx screw on each side. Take them out, then bend the tabs up that hold it in the cage and pull it out. It snaps into the new cage. Screw the Torx screws back in and then connect all of the harnesses and the antenna.  Put the whole unit back in, screw in the four screws and then put the vent cover back.  Start the car and setup the unit.  Simple. It took me about thirty minutes.


Setup is fairly easy: tap the setup icon, set the language, FM Frequency, Video standard (NTSC or PAL) and set received_529731680832352the Boot logo if you want (enter 1983 on the keypad and look for your car manufacturer.) You can set the time by tapping on the clock and setting the date and time.  Its a bit cumbersome, but easy to do.

Pairing your phone is simple.  On your phone, look for GTB-KIT or something like CARKIT. You can import your phone book and phone log once paired.  It is the easiest pairing in a Bluetooth device I have seen.

The FM radio has three ‘banks’ of presets. You can let the device do it for you by pressing the PS button on the FM screen. You can then add or delete all you want.  NOTE: there is no AM radio on most of these cheap devices. Mine is the MP5-7023B and looks to be a clone of nearly all of the cheap head ends out there. The user interface, while looking OK, is not that easy to understand. Discoverability is not, apparently, a concern for the developers.

20181023_202611The MP3 player, photo viewer and movie player all require a USB stick or SD card, even though that is labelled ‘TF Card’. You need to create three folders: Music, Video and Photos.  Photos ONLY works with JPG files.  PNG and BMP(!) do not appear to work.  Video works with pretty much every codec and container out there. Music plays MP3, OGG, WAV and a few others.  Oh yeah, FLV video is supported.

I didn’t want the default non-Logo to display when the unit starts, I wanted the Nissan logo. Fortunately, in setup, there is a logo feature that allows you to pick one of couple of dozen or so manufacturer logos. Many are European or Asian and unfamiliar to me.  The Nissan logo was there, so I picked it.  To get to the page, go into setup, tap the Logo button and enter 1983. The page will display. Simply select the logo you want by tapping it.  Hit the Home button to save. Boom, done.

What I don’t like

The user interface is really wonky.  It is pleasant enough, with a kind of Windows 8 look for the home screen.  Lots of blue is used.  This is all fine, but, it is REALLY sluggish.  The touch screen is not very sensitive either.  In bright light, it washed out, big time.  The knob serves many purposes, but is mainly confusing. Not only can you turn it, like a real knob, but you can also push it in. It is context aware, but inconsistent.

The equalizer function works for all music playback, but is only available on screen if you are in the FM Radio app. 20181023_211917 Otherwise, you must press the knob, several times, to get to the very small icon for the EQ, then you turn the knob for one of four or so presets.  You cannot create your own sound, though.

The remote woks great, but, the buttons are difficult to press and you must be in line of sight with the IR receiver. And, why the remote? I would rather have had a steering wheel control.  However, the remote does make navigating the touch screen much easier.

Bluetooth works fine, but the music playback from your phone is not complete. All you get is Previous, Next, 20181023_201049Pause and Play. You get no info about what is playing or the album art. 

What I like

For the price, everything. This thing was forty bucks.  Yes, it is far from perfect and, likely, won’t last.  I am OK with that, as long as I can get six months or more.  I plan to get a nicer one with DVD and GPS, but, this will work in the interim.  Speaking of GPS, I am working on a DIY GPS that will utilize a Raspberry Pi and GPS module I got from Radio Shack, years ago, for my Arduino stuff. The MP5 has an external video input that I will use for the GPS.  I also have a backup camera I am going to install in the car. The unit supports this as well.

If you have an older vehicle that could use an upgrade like this, you can certainly do it on the cheap.  The thing to keep in mind, though, is the installation kit. More common cars, like the Altima, will probably have the kits readily available. Otherwise, you might have to get creative.   All in all, it is a worthy upgrade and didn’t break the bank or take hours to do.


Building your own programmable clock

20180120_204454Wow, it’s been quite a while since the last posting.  I thought we would start the year off with a cool project, a reboot of my Half-Byte Clock, featuring Embedded Tiny Basic. This time, I use an Arduino Nano and a nice canvas/wooden ‘case’ to house it all.

Instead of using the somewhat large Half-Byte Console board, I use the Nano so it fit inside the wooden frame. The frame is roughly one inch thick, just big enough for the Nano and all of the components to fit. On this particular iteration, the light sensor and speaker are on the back of the frame and, because of poor planning, the temperature sensor sticks out of the side. I intend to remedy that, but that will be later.  I am too busy to worry about that right now.

The Components

For the project, you will need:Samsung 6980

    • Arduino Nano or similar 328 based microcontroller board
    • HC-06 Bluetooth module
    • DHT-11 Temperature sensor
    • Light Sensor (I used the OSEP LIGHT 01 module)
    • Two or Three 8×8 LED Matrix displays, assembled with controller
    • DS3231 RTC for Arduino (Real Time Clock)
    • Small speaker (I stole this out of a toy cell phone I purchased at Dollar Tree)
    • Case/Frame/Canvas

My total cost is about twenty five dollars. The most costly part was the canvas frame-$8.95 at Target. All other parts were sourced from Hobby Town or Amazon.


The clock features programmability via Half-Byte Embedded BasiSamsung 6945c, though you can use whatever code you like. This project, though, is aimed at a reprogrammable device that can display the time/date, temperature/humidity, output sound, use the ambient light to brighten or darken the display and be programmable over Bluetooth.  You have about 1k of RAM to store your Basic code and, once saved, will remain in memory, even if you unplug it. Upon power up, if there is something in memory, it will auto start after five seconds.

Wiring it Up

I was going to get all fancy and draw a diagram, but I think the pin connections will make more sense to more people, so that’s what I am going to do.  There are also photos you can look at.  As my hands aren’t as steady as they once were, my soldering leaves a lot to be desired.

DHT 11:

  • Data line to pin 2 of Nano
  • (+) to +5v on NanoSamsung 7010
  • (-) to GND on Nano



  • SCL to A5
  • SDA to A4
  • GND to GND
  • VCC to +5v


Light Sensor:

  • Pin S to A0 on NanoSamsung 7008
  • (+) to 3.3v on Nano
  • (-) To GND on Nano


LED Array:

  • data to pin D12    DIN pin of MAX7219 module
  • load to pin D10    CS pin of MAX7219 module
  • clk to pin D11       CLK pin of MAX7219 module



  • GND to GND
  • + to Pin D8 on NanoSamsung 7014


HC-06 Bluetooth:

  • VCC to +5v
  • GND to GND
  • RX to TX on Nano
  • TX to RX on Nano

Sample Embedded Basic Startup Apps:

Example 1:

100 PRINT "Welcome to Half-Byte LED Programmable Clock"
111 SCROLL " Clock."
112 IF HOUR(0)<12 SCROLL " Good Morning! "
114 IF HOUR(0)>11 IF HOUR(0)<18 SCROLL " Good Afternoon! "
116 IF HOUR(0)>17 IF HOUR(0)<=23 SCROLL "  Good Evening!  "
120 TIME
125 IF IN(0)<>-1 GOTO 600
130 SCROLL ".   Temp is "
140 TEMP
145 SCROLL "F  "
150 SCROLL "Humidity is "
170 SCROLL "  Hello!  "
180 IF IN(0)<>-1 GOTO 600
190 IF RND(99)>50 GOTO 110
200 SCROLL "       "
205 O=MINUTE(0)
210 W=15
220 H=7
230 X=RND(W)
240 Y=RND(H)
250 P=RND(W)
260 Q=RND(H)
265 IF IN(0)<>-1 GOTO 600
290 SET X,Y,0
300 SET 16+(X),Y,1
310 SET 16+(X),H-Y,1
320 SET 16+(W-X),Y,1
330 SET 16+(W-X),H-Y,1
340 IF IN(0)<>-1 GOTO 600
350 SET 16+(P),Q,0
360 SET 16+(P),H-Q,0
370 SET 16+(W-P),Q,0
380 SET 16+(W-P),H-Q,0
390 IF IN(0)<>-1 GOTO 600
400 K=MINUTE(0)
410 IF K-O>1 GOTO 110
590 GOTO 230

Example 1 will randomly display random dot pattern for about a minute. It also analyses the time and inserts ‘Morning’, ‘afternoon’ or ‘evening’ in the greeting.  If you are connected via USB or Bluetooth, you can interrupt the app by sending a character followed by the ENTER key.


200 SCROLL "        "
210 W=15
220 H=7
230 X=RND(W)
240 Y=RND(H)
250 P=RND(W)
260 Q=RND(H)
300 SET 16+(X),Y,1
310 SET 16+(X),H-Y,1
320 SET 16+(W-X),Y,1
330 SET 16+(W-X),H-Y,1
340 IF IN(0)<>-1 GOTO 600
350 SET 16+(P),Q,0
360 SET 16+(P),H-Q,0
370 SET 16+(W-P),Q,0
380 SET 16+(W-P),H-Q,0
390 IF IN(0)<>-1 GOTO 600
590 GOTO 230

Example 2 is the kaleidoscope from Example 1


100 SCROLL " Half-Byte Clock "
110 H=HOUR(0)
120 IF H<12 SCROLL " Good Morning! "
130 IF H>11 IF H<18 SCROLL " Good Afternoon! "
140 IF H>17 IF H<=23 SCROLL "  Good Evening!  "
150 TIME
160 IF IN(0)<>-1 GOTO 600
170 SCROLL " Temp is "
180 TEMP
190 SCROLL "F  "
200 SCROLL "Humidity is "
215 SCROLL "%         "
220 SET 20,2,1
230 SET 23,2,1
240 SET 20,4,1
250 SET 23,4,1
260 SET 21,5,1
270 SET 22,5,1
280 FOR X=1 to 5
300 SCROLL"  "
320 SCROLL"  "
530 IF IN(0)<>-1 GOTO 600
540 NEXT X
580 SCROLL "       "
590 GOTO 110

Example 3 displays the date and time as well as the humidity and temp. It also shows an animated smiley face.


100 SCROLL ” Half-Byte Clock ”
110 H=HOUR(0)
120 IF H>=0 IF H<12 SCROLL ” Good Morning! ”
130 IF H>11 IF H<18 SCROLL ” Good Afternoon! ”
140 IF H>17 IF H<=23 SCROLL” Good Evening! ”
150 TIME
155 IF H=17 IF MINUTE(0)>=0 IF MINUTE<=10 SCROLL ”  TIME FOR name TO COME HOME!”: TONE 8,3000,3000
160 IF IN(0)<>-1 GOTO 600
163 SCROLL ” ”
170 SCROLL “Temp is ”
175 TEMP
177 SCROLL “F  Humidity is ”
190 SCROLL “%”
200 SCROLL ”   ”
220 SET 20,2,1: SET 23,2,1
240 SET 20,4,1: SET 23,4,1
260 SET 21,5,1: SET 22,5,1
280 FOR X=1 TO 5
281 DELAY 40
300 SCROLL ”  ”
320 SCROLL ”  ”
530 IF IN(0)<>-1 GOTO 600
560 NEXT X
580 SCROLL ”       ”
590 GOTO 110
600 SCROLL “Interrupted!”

Example 4 is an example of an ‘alarm’. It evaluates the hour and minute and displays a custom message and then generates a tone. It also features the animated smiley.

Samsung 7025With some clever coding, you could write a game, create an interesting art display, message board and more.  There are unused pins on the Nano that you can also use to wire up something to control (like a pet watering device, lights, etc.)  All of the sensors are available in Basic or, if you choose to write your own custom code, use the pin outs above to read or write to them. You are only limited by your imagination. And, well, that tiny bit of RAM that these things have. C’mon, we went to moon on less.

Using Half-Byte Embedded Tiny Basic to Teach

HBPortableLabIt is 2017 and we have a slew of low cost or free tools available that teach anyone how to program a computer.  Just for Windows, we have something called Small Basic, from Microsoft. It is free and has a bunch of material you can use to teach anyone, especially children, how to code. There is also Python, Minecraft and a host of other, modern tools.

So, why use something as crude as Tiny Basic? One that requires a terminal? Well, there are a few reasons you may want to do this.

Cost, for one. 

It is free. It runs on Arduino and Arduino clones.  You can use it to also teach basic electronics.

And, that is what I am doing…using it to teach not only programming, but also how computers work.  It is really more for the latter as Small Basic cannot manipulate sensors and other hardware like Tiny Basic can.  Since Tiny Basic includes instructions for reading temperature sensors and a real time clock, it is perfect for teaching things like turning on something on if the temperature gets above a given number or it if is 5 o’clock, turn off something.

I recently started doing this with my step son.  We used Embedded Tiny Basic on my ‘portable’ lab, which contains an Arduino UNO clone, a 2 x 16 LCD, breadboard and voltmeter.  We first made one green LED blink, then added a second, red LED blink.  I used Tiny Basic to explain how to talk to the LED’s and used the DELAY instruction to make the LED’s blink at a constant interval.  I also took the opportunity to teach him binary.  We had discussed it previously, but I don’t think he really got it. Until now.  Using the DWRITE statement, which takes two parameters…pin number and a zero for off or 1 for on.  Having him use that code got him to understand the concept.  Small steps.

His mind is wandering now…’I can build a robot…a game…something to tell me when Xander is coming down the hall…’ Xander is his four year old brother. 

There are those of you out there who are thinking that this is a terrible idea, using Tiny Basic, that is.  Well, no, not really.  He is getting real instruction with a more object oriented and modern language while using Tiny Basic to learn the nitty gritty of the hardware.  You do not need a modern, object oriented language to blink an LED. 

I will post future updates on our progress as well as sample code.  Below is the code we used to blink the LED’s.

110 FOR X=1 TO 50
120 DWRITE 3, 1
140 DWRITE 3,0
160 NEXT X

(For single LED-it was on digital pin 3)