Posts

ESP32 Camera

Image
In November 2019 I added a note to a previous blog post that looked at the Arduino project strategy from the angle of a bemused fan regarding a bargain ESP32 board with a camera interface. The delivered price at the time appeared to be £4.95 for the board and £1.99 for the camera. I placed an order in November but I have only now fully opened the package. It turned out that the £4.95 included a camera (OV2640 I think) so I now have a spare. I knew that this board did not have a USB interface so I also ordered a serial to USB board that could run at 3.3 or 5 volts. This cost £2.90. I also took note that the ESP32 chip was known to run hot so I looked out a suitable heat sink. I ordered the board because it seemed to offer a great deal for the money with 4MB of SRAM, Wi-Fi, Bluetooth and micro SD card slot in addition to the camera port and 512Kb of on chip SRAM. As this could reputedly be programmed in C using the Arduino IDE I was keen to give it a whirl once some other projects we

Arduino Regular Expressions

The first chapter of a wonderful book titled “Beautiful Code” (O’Reilly 2007) was written by Brian Kernighan who described an episode from when he and Rob Pyke were writing a book together called “The Practice of Programming”. They wanted to include a discussion on regular expressions but also wanted to include the code of an implementation. Existing code bases would have been a book length by themselves. Rob Pyke developed 30 lines of C code in less than two hours that implements a substantial part of the day to day usage of regular expressions. The code can be described as beautiful for its elegant efficiency. The final line of the chapter reads “I don’t know of another piece of code that does so much in so few lines while providing such a rich source of insight and further ideas”. The code handles the following constructs: Character Meaning c Matches any literal character (in this case ‘c’) . (full stop) Matches any single character

An Arduino Sudoku Solver

Image
I saw a link to Peter Norvig’s post on “ Solving Every SudokuPuzzle ” on Hacker News where he had constructed a Python program to do just that. His purpose was to cure the world of Sudoku but as Sudoku appears to be an ongoing although mild mental affliction I thought his solution might be worth exploring for the Arduino platform. I had a look at the JavaScript versions linked from the page as my Python knowledge is less even than rudimentary. I also had a good look at the C++ solution posted by Pau Fernandez . My draft plan was to write a solver for the MKR WiFi 1010 platform and to interact with it via an HTML page hosted by that board. Peter Norvig’s post explains how he applied constraint propagation to the task of searching for a solution that does not require waiting for the heat death of the universe to run to completion. Take a look, as he certainly explains it better than I can although I will have a stab at it. A 9 by 9 Sudoku grid contains 81 cells. The rules