March 14th, 2017

Translating Console Applications in Free Pascal

Lately, I noticed that DefaultTranslator and LCLTranslator cannot be used to select a language in a console applications. They pull in the complete LCL package and the SetDefaultLang wants to translate all of the forms in the project even as there are none. So I decided to rip out the form updating code in LCLTranslator and to save that modified version in a unit called UnitTranslator [...more].

I found this out when looking at the tcalc demonstration program for my simple parser. I have updated that project accordingly [...more]

January 30th, 2017

NodeMCU, MQTT and Domoticz - part 2

This post continues the exploration of NodeMCU, MQTT and Domoticz begun on the 15th and 17th of January. The subject is how to subscribe to MQTT messages in NodeMCU so as to perform a task based on messages published by other devices to the MQTT broker. In particular a virtual switch in the home automation software will set the WeMos D1 Mini LED on or off [...more]

January 21th, 2017

Wemos D1 mini and NodeMCU - reworked

The January 15th post has been reworked slightly to better explain the work flow when using NodeMCU with command line tools. In particular, setting the baud rate correctly makes for a smoother experience [...more]

January 17th, 2017

NodeMCU, MQTT and Domoticz - part 1

This post continues with the previous one. In it I show how to establish a WiFi connection and how to update a device (a temperature sensor) in the home automation software Domoticz. This is done in two ways: using an MQTT broker and directly using an HTTP request [...more]

January 15th, 2017

Wemos D1 mini and NodeMCU

When I purchased my first ITEAD Sonoff WiFi switches, I also got a Wemos D1 mini board. I thought using a ESP8266 development kit would be a good way to prepare for hacking the switches. In this post, I relate how I learned to program the ESP8266 using a tool chain made up of NodeMCU firmware and Python command line utilies: esptool, nodemcu-uploader and miniterm. [...more]

August 30th, 2016

Conversion of measurement units

Free Pascal's run time library contains Delphi compatible units ConvUtils and StdConvs. Unfortunately, both units contain a few errors. Lately, I have attempted to fix the code and hope to eventually submit these corrections for inclusion in a future version of the compiler [...more]

July 13th, 2016

One Pass Mathematical Parser

While porting code to FreePascal/Lazarus, I have made some changes changes to the mathematical expression parser I initially wrote in Delphi. The one pass parser for Free Pascal is complete, so is the documentation [...more]

July 6th, 2016

List Separator in Linux

There is no default list separator in Linux. In that case, what value does Free Pascal assign at startup to the ListSeparator field of the DefaultFormatSettings? The short answer is that the list separator is the comma ‘,’ as used in the USA and it is not adjusted according to the user’s locale. That is not always acceptable [...plus]

April 4th, 2016

Free Pascal/Lazarus gotchas

After running into yet another small difference between Free Pascal/Lazarus and Delphi, I decided to write up a few of these gotcha's. They have to do with assigning procedural types and event handlers, calling a function without parameters using a procedural variable, and the rather similar problem of recursion of functions without parameters. I have also covered the creation of Debug and Release build modes and the addition of DEBUG and RELEASE symbols in the appropriate build mode [...more].

January 27th, 2016

Sliderbars - Part 2

Two new components have been added to the package discussed on the 24th. The first, called TSliderPlane, is a two-dimensional version of TSliderBar. The second component is called TColorPlane. It is very specialized, showing any plane in the RGB cube. It can be used to build a colour selector with just two or three lines of code. [...more]

January 24th, 2016

First Lazarus component: sliderbars

My first components for Lazarus, slider bars, , are now available. They can be used to make an RGB colour selector dialogue. See how simple it can be in the second demonstration program included in the archive. [...more]