Monday 11 August 2014

First bit of FUZE BASIC

The aim was to get the MyPiFi LED board working on the RPi B+ with FUZE BASIC. I don't have the FUZE hardware, just running the B+ with keyboard, mouse and HDMI TV as monitor.

Firstly the MyFiPi board overhangs some of the extra pins on the B+ board, as will probably be the case with most, if not all, boards designed for the RPi A and B boards. It does not touch them so is not a problem, unless you need to use the hidden pins.

DSCN3183

FUZE BASIC seems to have its own method of numbering the GPIO pins. The example Python scripts use 11 for Red, 13 for Amber and 21 for Green. These numbers didn't work in FURZE Basic so I wrote a short program to cycle through all the pins and noted down which pin worked which LED. Then I could get down to writing my first working program to cycle the LEDs in the traditional UK traffic light cycle:

DSCN3182      DSCN3185

I couldn't use the full colour names as some are reserved words.

Anyway, after a few attempts and correcting a few errors it finally did what it was supposed to do.
The code allows for the program to be stopped and all LEDs switched off by holding down any key on the keyboard  (WHILE inkey = -1 CYCLE)



2 comments:

  1. John, this is very impressive. I still have the arduino programme for this but I just used a bread board for it. That I found hard enough.
    One slight criticism.......Folk are going to have to be sharp off the mark and quick on the brakes. This looks much harder than Arduino.

    ReplyDelete
    Replies
    1. Adrian. A relief to have got something working. Next job will be back to soldering. I need good daylight for that. Working in the Summerhouse is best as there is little, if any shadowing so I can see which is metal and which is finger.

      Delete