Tag Archive: Programming


ESP8266 -12 NOT beginner friendly

I brought this model because I wanted more GPIO’s and couldn’t find the 12a or 13 version. Man I wish I had ordered the -1 model first as this model is a pain in the ass to get working.
Using the provided wiring diagram and the arduino ide, I get the sync warnings and then the ide freezes during the upload stage (uploading stays in the progress bar!)

Have ordered a -1 model and will try playing with that before going back to the -12.

I have been using G.I.M.P SINCE 1999 (version 0.99b) but have only had a Macbook since late 2012.

A few months back I maxed out the ram to 16Gig but noticed that G.I.M.P was lagging when calling up commands and really struggling while working on a book cover (sys report showed only half the ram was in use!) its taken me ages but last week I found the issue.

When I upped the ram, I forgot to change a setting in G.I.M.P, this setting is “Tile Size”. Once I changed this to use 8 gig, G.I.M.P started working perfectly. If anyone is finding this issue, I hope this post helps you out!

XMOS startkit Step 1

So after spending all day yelling at my XMOS startkit I finally got a basic hello world flashing led code to work. This code flash’s one of the two leds closest to the ram.

#include <xs1.h>
#include <timer.h>

port p = XS1_PORT_1D;
int main() {
 while (1) {
     p <: 0;
delay_milliseconds(200);
p <: 1;
delay_milliseconds(200);
}
}

So how does all this work?

First up we need to reference the required header files. The most important one is xs1.h contains the core functions for working with XMOS Chips. We add this by adding the line

#include <xs1.h>

This contains the port definitions so that our programs will know what port p = XS1_PORT_1D means.

The second one required for the program to work is

#include <timer.h>

This allows us to use the timing function of the chip (I may be mistaken here in that it could actually be a core “C” header!) and allows the code to understand what delay_milliseconds(200); means.

After we have those two lines we need to define which pin our LED is connected to. According to the Startkits hardware manual the two of the leds are labelled D1 & D2 and are accessed through ports 1A and 1D (see page 10/17) and to access them we need to add

port p = XS1_PORT_1D

By changing port p = XS1_PORT_1D; to port p = XS1_PORT_1A; you can change between one of the two leds that are located next to the 256KB SPI flash chip. According to the schematic diagram in the hand book, these leds are connected between the chips pin and ground making them active low. To turn them on the chip needs to supply power to the led and this is done with the following.

p <: 1;

If you noticed the code, I put this line near the end, this is because on each cycle the following

 while (1) {
     p <: 0;

Checks to see if the if the variable “p” high (1), if it is, the pin is set low (0) by the following line. then after a delay, if the variable “p” is high the it will be set low and XS1_PORT_1D will be switched off.

If I understand myself, then all this will make sense and you (the reader) should be able to follow this.

Well I have had enough programming for today so time to pack up.

Well for the revamp of my web site I wanted 1 Jquery UI powered accordion to power the sites navigation and 1 for the blog style posts.
After searching for ages I still couldn’t come up with the solution, While on holiday it finally hit me all I had to do was define 2 instances (if that’s the correct terminology) and bingo it worked.

My code:
$(function() {
$( “#accordion” ).accordion();
$( “#news_accordion” ).accordion();
});

Then I just had to call them at the required positions with
id=”news_accordion”
and
id=”accordion”
and it all works !!!
just need to sort out a size issue and I’m finished and can go onto the other scripts.