Coding for the challenged

Ever since the dawn of time coding has been a foreign language to me. I pick up bits and pieces but largely it gets forgotten or lost.

Tonights issue is about interrupts and debouncing buttons. What better thing to do whilst listening to the 6m white noise contest (also known as vhf from my qth).

The idea is simple. I made a shack clock from a gps and an arduino. I made it tell the time, tell me the position I’m in (no I don’t mean like that) an calculate the locator square. Now then all I want to do is link these together with a simple button press. Press the button and it changes from one function to the next.

Holy arduino, this isn’t straightforward at all. Buttons need debouncing and interrupts don’t like this or that. I feel a long development time in my future…still there’s not much on 6m and 2 contacts in the first hour isn’t going to win me any awards.

Big vhf haul from IO84em

Its not often I get a bumper crop of contacts on the UKAC series but 2m offers probably the best opportunity. Last weeks 6m contest gave just a handful of contacts but last night 26 contacts that ranged from Perthshire in the north to the south coast. I usually don’t hang about past about 21:30 anyway and as conditions were deteriorating I decided to come home and sort out the log.

UKAC 2m

Operating /p with just 10w and a 5 ele beam means I can go out with the minimal equipment but I was very jealous of the Wasdale Mountain Rescue truck who had not read the memo about Sandwith being ‘my spot’. Not only had they beat me to the best spot but they had a Clark pump up mast that looked great. I’ll bet their best dx was worse than mine ;-)

All in all a good evenings work. Made better by the warm and wind free evening. I’m beginning to think I’ll wake up in a bit.

Time to play with GPS and Arduino

I’ve always enjoyed playing about with time. Accurate time is not really a fascination but I do like a clock to tell the time. The MSF 60khz time signal is one source and I have played about with that system with an Arduino and it works well, when there is a good signal for a whole minute. GPS time has always been a bit of a thing for me because you can set it to UTC and it’ll always show UTC and frankly there are a lot more libraries available to play with. GPS Tiny & GPS Tiny+ are two of those and this evening I ‘forked’ a sketch to use a cheapo off the shelf gps module to tell the time and date on a 16×2 LCD. Nothing spectacular but hey if I can do it then so can anyone. Here’s a short sweet video of it in action (near the window!)

sketch goes a little like this


#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
/*
This sample sketch demonstrates the normal use of a TinyGPS++ (TinyGPSPlus) object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 8(rx) and 9(tx).
*/
static const int RXPin = 8, TXPin = 9;
static const uint32_t GPSBaud = 9600;
// The TinyGPS++ object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
ss.begin(GPSBaud);
lcd.begin(16,2);
lcd.setCursor(1,0);
lcd.print("Tiny GPS+ Time");
delay(3000);
lcd.setCursor(1,2);
lcd.print("by Alex, g7kse");
delay(5000);
lcd.clear();
}
void loop()
{
// This sketch displays information every time a new sentence is correctly encoded.
while (ss.available() > 0)
if (gps.encode(ss.read()))
displayInfo();
if (millis() > 5000 && gps.charsProcessed() < 10)
{
lcd.print("No GPS detected");
for (int positionCounter = 0; positionCounter < 20; positionCounter++) {
while(true);
}
}
}
void displayInfo()
{
lcd.setCursor(4,0);
{
if (gps.time.hour() < 10) lcd.print(F("0"));
lcd.print(gps.time.hour());
lcd.print(F(":"));
if (gps.time.minute() < 10) lcd.print(F("0"));
lcd.print(gps.time.minute());
lcd.print(F(":"));
if (gps.time.second() < 10) lcd.print(F("0"));
lcd.print(gps.time.second());
}
lcd.setCursor(3,2);
{
if (gps.date.day() < 10) lcd.print(F("0"));
lcd.print(gps.date.day());
lcd.print(F("/"));
if (gps.date.month() < 10) lcd.print(F("0"));
lcd.print(gps.date.month());
lcd.print(F("/"));
lcd.print(gps.date.year());
}
}

My name is Alex, I am dumb (occasionally)

May normally brings a bit of Es fun for me in sunny St Bees. I duly put up the 6m antenna (which annoys the xyl). Tuned into 50.150 and started listening about. Nowt.

I left it a few days and went back when I knew there was Es. Nothing heard…strange.

Carried on listening. Considered starting a white noise listening club.

This evening I checked all the cables

I had wired up a co-ax patch lead…to thin air.

I’ll be contacting Ofcom to hand my license back in and accepting the dunces cap for however long it takes me to stop being so dumb! My sincerest apologies to one and all .

 Winking smile

FabLab first

After some cautious first steps my first laser cut parts have been made. The case for the clubs upcoming WSPR kit build prototype has been, well, lasered.

IMAG0293

There’s a couple of minor points to address but for a first effort I’m pretty pleased.

The idea was to cut for a single sheet a ‘desktop’ case for the U3 WSPR transmitter that could display a callsign or something similar on the front as a customisation as well as being simple and space efficient. Yep, you can buy a case but its quite nice to be able to make one in Cumbria rather than China. I should be able to get 4 and a half of them out of a single 300mmx600mm sheet.

All I have to do now is fix the faults and make it right next time.