Showing posts with label LED. Show all posts
Showing posts with label LED. Show all posts

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)



Saturday, 9 August 2014

A Bit of Soldering

Made a start soldering some components on the Tandy Mulitface board.

Bare board:
DSCN3159

As the instructions are in the form of a downloadable pdf file I put it on the iPad so I could easily see what to do next:
DSCN3160

Resistors and diodes fitted:
DSCN3164

So far it is going a lot easier than I thought it would as the solder pads can look very close together. For the resistors I was able to use a 12W iron with a narrow bit but the diodes soaked up the heat too fast so I had to resort to a 15W with a larger bit for them.

I gave up after that as my eyes were beginning to go out of focus!

Later another small kit arrived, the MyPiFi LED board, so I decided to put that together. This is a simple board with three LEDs and a switch. Useful for me to test out a bit of programming:

DSCN3165

The example scripts are for Python but I typed one in and kept getting syntax errors when I ran it. I think I may be short of a couple of GPIO files there.

I also tried it in FUZE BASIC and eventually got the LEDs working. Just got to get the switch working then I'll explain the differences that need to be make to pin allocations for it to run in FUZE.