Tag Archives: C

Using SendInput to type unicode characters

I received a query from reader Partha D about generating unicode keystrokes using the SendInput function in Windows. As I understand it, Partha wants to generate one or more unicode keystrokes when a particular keyboard shortcut is pressed. The following … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , | 2 Comments

Writing bytes to a serial port in C

This is a (relatively) simple example of a C program to send five bytes to a serial port in Windows. In this case, I’m sending the five characters “hello” via COM22 at 38400 baud, but of course the program can … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | 41 Comments

Simple interrupt-driven sampling example for the dsPIC30F4011

Reader Swetha wrote in with a query about performing 10Hz sampling on a dsPIC30F4011 in some kind of energy monitoring system. The following example illustrates a basic structure for interrupt-driven sampling using Timer 1. I compiled this program with Microchip’s … Continue reading

Posted in PIC | Tagged , , , , , , , , | 6 Comments

Nasty 4-channel logic analyser using dsPIC30F4011

This post is about a quick and dirty 4-channel logic analyser that I hacked together to get a snapshot of four parallel binary signals from something I was building. I just want to quickly capture this information here for the … Continue reading

Posted in PIC | Tagged , , , , , , , , | 2 Comments

Variable exponent in Mandelbrot algorithm

In my previous two posts, I generated images of the Mandelbrot Set using the conventional iterative mapping function to generate the sequence of complex values for each point in the area of the complex plane that was shown. I’m struggling … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

More Mandelbrot

Here’s a modified version of the mandelbrot program from the previous post. This time, the generated images are in colour and output in binary PPM format (which is still uncompressed, but a bit more space efficient than the plain text … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 1 Comment

Visualising the Mandelbrot Set

I suppose it’s about 20 years since I first read about Benoit Mandelbrot and his pioneering work on fractal geometry. Ever since then, I have been intrigued by how fractal images with beautiful and complex textures can emerge from very … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 7 Comments