md
Programming Index
May 4, 2020

Seeeduino XIAO Serial Communication Interfaces (SERCOM)

There are some good explanations on how to add a serial communication interface on SAM D21 based boards. However all those that I have found are for boards with many more I/O pins than the XIAO so that they are not that pertinent for this tiny board. In this post, I explain just what the problem is and how it is nevertheless possible to add a supplementary SPI, I²C or USART port on the XIAO as long as another type of communication interface is forgone [...more]

May 3, 2020

Adding the Seeeduino XIAO in PlatformIO

A very knowledgeable reader of the first version of the Overview of the SAMD21 Arm Cortex-M0+ Based Seeeduino XIAO kindly provided instructions to manually install the XIAO board definition in the PlatformIO development environment. Because all the hard work was already done for me, it was a simple two-step procedure [...more]

April 11, 2020

Asynchronous Ping for an ESP8266 Internet Watchdog

While reviewing my ESP8266 router watchdog code, it struck me that using a blocking (or synchronous) ping library to check the status of the Internet connection was not the proper approach. In this post, I present an example project that monitors if the Internet can be reached using the AsyncPing library by akaJes [...more]

Last Update: May 11, 2020. First version: April 4, 2020

Overview of the SAMD21 Arm Cortex-M0+ Based Seeeduino XIAO

This post contains my first impressions of the Seeeduino XIAO from Seeed Studio. Because I don't really have much experience with micro-controllers except for a bit of work with the ESP8266 and the occasional experiment with Arduino boards, this overview will be at a rather superficial level. Nevertheless, it describes some 15 Arduino sketches showing different capabilities of this new development board. Hopefully, this will be of interest to others starting out with this impressive little board [...more]

April 3, 2020

Blink with a Wio Lite RISC-V

Seeed Studio has come out with a new board called the Wio Lite RISC-V with ESP8266. The unusually shaped board is based on the 32-bit RISC-V GD32VF103CBT6 micro-controller by GigaDevice. In addition there is a Wio core based on an ESP8266 which should provide Wi-Fi connectivity. The development software is not yet completed at least for the Arduino platform, but I did manage blink the on board LED with the PlatformIO development environment on a Linux desktop [...more]

March 31, 2020

"Hello World!" with the Longan Nano

These are my first steps with the Sipeed Longan Nano based on the 32-bit RISC-V GD32VF103CBT6 micro-controller by GigaDevice. Development of three Blink projects is done in the PlaformIO environment using the Arduino framework on a Linux desktop. The first blinks an LED, the second also sends the state of the LED to a serial port while in the third, the state of the LED is shown on the included display [...more]

March 28, 2020

Raspberry Pi Hardware Watchdog: Two Pies Please

This is about using a Raspberry Pi as a hardware watchdog of another Raspberry Pi. The watchdog Pi could be a Raspberry Pi Zero or Zero W while the monitored Pi is a "mission critical" server such as a home automation system. Hopefully, the intelligent watchdog will prove better than the hardware watchdog for crypto-currency mining rigs that I have been using for some time, but which suffers from three problems which are important enough to warrant its replacement [...more]

March 21, 2020

Warm and Cold Reboots of the Raspberry Pie

In preparation for the new hardware watchdog that will monitor the home autpmation system on a Raspberry Pi, I delved into the details of software and hardware resets of the Pi under the Raspbian operating system. I found that both aspects were well thought out by their respective developers so that it will be relatively easy to create an "intelligent" hardware watchdog for the Pi [...more]

February 21, 2020

The DS3231 Century Flag and Day of Week Register

Somehow, I got sidetracked while trying to follow up the previous post with DS3231 real time clock alarms and the SQW interrupts. Instead I looked into how the DS3231 and Linux keep track of centuries and the day of week [...more]

Last Update: February 23. First version: February 18, 2020

I2C clock and EEPROM memory module for Raspberry Pi

When installing a new hardware clock, I learned a bit more about the DS3231. The clock module also contains AT24C32 type 32K bit EEPROM memory (4K 8-bit bytes). Rereading the post, I realize that its main subject may very well be the I2C bus on the Raspberry Pi [...more]

Last Update: March 20, 2020. First version: February 5, 2020

Rethinking the Raspberry Pi Hardware Watchdog

Although the hardware watchdog for crypto-currency mining rigs has been operating without apparent problems as a device for monitoring the home automation system for several months, I am not entirely satisfied with it for three reasons. It is time to develop a replacement. So here is the announcement of a research program on this subject. Please excuse this pompous last sentence, but I intend to document five or even six approaches in the coming weeks. [...more]

January 16, 2020

Using the Sparkfun Tiny AVR Programmer in Ubuntu 18.04

After fumbling around for a couple of hours, I have finally managed to flash the traditional blink sketch on an ATtiny85 with the Sparkfun Tiny AVR Programmer using the Arduino IDE (version 1.8.10) in Ubuntu 18.04. Perhaps others will run into some of the difficulties I encountered so here is how I go about it [...more]

October 8, 2019

Push Button and LED on a Single GPIO Pin

When a microcontroler project needs more input and output pins than the available number, it is always interesting to use a single pin for more than one purpose. I show in this post how to use a single GPIO pin as an output to control a light-emitting diode and as an input to read the state of a normally open push button switch. [...more]

September 25, 2019

An ESP8266 Based Router Watchdog

After a considerable delay, I have finally begun to improve the router monitor built around a Sonoff Wi-Fi switch that I mentioned back in April 2018. Among the improvements, I have added manual override of the monitoring function and MQTT functionality which makes it possible to remotely control the router monitor through an MQTT broker [...more]

Update May 28, 2019. First version: May 18, 2019

Tide Data in Canada with Python

Here is a short note showing that it is possible to access tide data in Canada made available on the Web by the Canadian Hydrographic Service using a Python script. It's just a debut [...more]

February 28, 2019

Emulated IR Remote Control

or How to Use a $ 1,000 Desktop Computer to Emulate a $ 5 Infrared Remote Control. The note introduces a Free Pascal/Lazarus program that emulates a very old IR remote control that will soon be totally unusable [...more]

October 30, 2018

Install Free Pascal and Lazarus on Linux with FPCUPdeluxe

This is a rewrite of the August 17, 2018 post named Installing Free Pascal and Lazarus with fpcupdeluxe on Ubuntu 18.04. I followed the instructions in that initial post but the Free Pascal compiler and Lazarus IDE would not install on a fresh Mint 19 distribution. It turns out that my initial instructions left out some requirements that needed to be installed. These were present when I first used FPCUPdeluxe because of previous installations [...more]

October 9, 2018

Moteur de recherche Qwant

I added a fourth search engine to search my entire website. Qwant, like DuckDuckGo, promises to keep no information about the searches made. The site uses an unusual URL syntax to limit searches to a particular website. I decided to use an approach other than the one recommended to do this local searches. [...more (in French)]

The translation into English of the post entitled More Weather API is now completed.

September 29, 2018

More Weather API

In February, I found out how to recover weather conditions and forecasts from Yahoo Weather with a program written in Pascal. I decided to extend my exploration to other suppliers: Apixu, Dark Sky, MET Norway, OpenWeatherMap et Weatherbit.io [...more]

September 3, 2018

ESP8266/Arduino Core version 2.4.2 et WPS

Support for ESP8266 Wi-Fi connection with Wi-Fi Protected Setup (WPS) is not available in the current version of the ESP8266/Arduino core (version 2.4.2). However, it can be included by generating a new ESP8266 card definition file [...more]

September 1, 2018

Installing Ubuntu 18.04.1, Additions and Adjustements

This post is a continuation of the discussion about switching to the latest LTS version of Ubuntu. Two major applications are added to the distribution: Virtual Box and the Arduino integrated development environment. I have also added Timeshift which backups the system at regular intervals. Other less important topics discussed are the removal of the annoying emoji icons in Thunderbird and the addition of the Microsoft's core fonts [...more (in French)]

August 17, 2018

Installing Free Pascal and Lazarus with fpcupdeluxe on Ubuntu 18.04

Lately, I installed the newest (svn trunk) versions of the Free Pascal compiler and the Lazarus IDE from scratch with the fpcupdeluxe tool on a fresh Ubuntu 18.04.1 desktop. There was a slight complication associated with OpenGL libraries. But after much, self inflicted, tribulations everything seems to be working as expected. [...more]

I renamed the February post about Free Pascal / Lazarus on Ubuntu 17.10 to better differentiate the two posts.

August 13, 2018

Installing Ubuntu 18.04.1

This long post is composed of my notes for future reference that describe the installation of Ubuntu 18.04.1 on an empty hard drive. I preferred to install the new version of Ubuntu rather than update version 17.10 used since November 2017. [...more (in French)]

June 24, 2018
Update: June 27, 2018

A Third ESP8266 Watchdog, Final Version

At last, the final version of the loop watchdog is available as a library that can be loaded into the Arduino IDE. This version only works with the real-time clock RAM of the ESP8266. [...more]

June 12, 2018

Automatic Recovery from a Cycle of ESP8266 Restarts

This post, a continuation of the one of June 9, proposes a strategy for breaking out of a cycle of restarts caused by an exception or the action one of the ESP8266 watchdogs. Assuming it's the consequence of a programming error, it proposes an automatic over the air download of an earlier version of the ESP firmware. [...more (in French)]

June 9, 2018

A Third ESP8266 Watchdog, Simplified Version

Rather than translate the three English language posts about ESP8266 watchdog timers that date from August and September of last year, I decided to rewrite them in French hoping to stumble into a clearer presentation and producing simpler code. In this post, a simplified version of a third watchdog created to detect when the main loop of an Arduino sketch is no longer executed is presented. [...more (in French)]

June 5, 2018

A Better ESP8266 Loop Watchdog with Better Recovery UPDATE

While working on an ESP8266 project, I was disappointed with my loop watchdog. It did not report the name of the "module" in which the watchdog was biting. The cause of the error was difficule to ascertain. Hopefully the problem has now been found. The corrected archive is now named lwdt_full_example_0206.zip.

Looking over the code, I decided there was room for improvement... of course. I have rewritten the version that works with RTC memory, I have yet to try the revision with EEPROM memory. And of course, I will have to test thoroughly. [...more]

May 25, 2018

Blinking a LED, an Arduino Library

This is my second Arduino library that takes care of the minutia of flashing a LED. It's a blinky! Obviously, there is nothing much to it, I just wanted a reusable module that had some flexibility yet was simple to use. [...more]

May 23, 2018

Detecting Multiple Button Clicks in an Arduino Sketch

The Sonoff (an ESP8266 device often mentioned here) has one user input: a push button. I needed a routine to return the number of times the push button was pressed in quick succession or to indicate that the button had been pressed for a long time. With help from expert artcles found on the Internet, I implemented an Arduino library that meets my need and seems to work with all boards. [...more]

May 16, 2018

Internet Radio Player based on MOC

Presenting an internet radio player for Linux based on the Music On Console player. It is a test bed for an Internet radio player to be built around a Raspberry Pi to be connected to an older sound system. The source code is available. The application written with Lazarus, the open source Free Pascal RAD IDE. [...more]

April 9, 2018

CSS float and clear attributes and clearfix

In HTML, floating areas in a <div> type block do not change the size of the block. This can result in a local alignment problem. There are more or less well-known solutions, this is about some of them [...more]

April 6, 2018

Using Multiple Search Engines From A Single HTML Form

Just two days ago, I removed the search bar from the top of every page on this site. I wanted to have more than one search engine but I did not have a compact way to do it. Then I thought of an input box for the search words followed by three buttons for each of the search engines [...more]

March 2, 2018

The cthreads Unit in Linux (Free Pascal)

Pursuant to the previous post, this is another short note about enabling threads in Free Pascal programs for the Unix/Linux environment. [...more]

February 24, 2018

Running a Process in a Thread (Free Pascal)

Another Free Pascal short note about running a process in a thread. In it I show how the aplay utility can be launched to play a wav file in a thread so that the application GUI remains responsive and it becomes possible to stop aplay at any time [...more]

February 23, 2018

Updating Free Pascal and Lazarus with fcpupdeluxe on Ubuntu 17.10

This is just a short note about using FCPUpdeluxe to upgrade or install the Free Pascal Compiler and Lazarus IDE and LCL on a Linux system. I assume that it would be mostly the same on a Windows system. [...more]

February 17, 2018

The Yahoo! Weather API with Free Pascal

Mea culpa for a very local solution to getting weather reports in a previous post which would have been of interest to only a few. Here is a solution using Yahoo! YQL queries with a potentially wider audiance [...more]

For older posts see the Archives

This page lists posts published in the last two years on the subject of programming. Archives contains links to all the pages published on this site. It is also possible to do a searches limited to the content of this site with the search box at the top of all pages.