Posts

Showing posts from November, 2006

Moving code from ESP8266 to ESP32

Image
A while ago I made a mashup of Dan Royer's code CNC 2 Axis Demo with my own code for trapezoidal motion stepper and servo control for ESP8266.

I assumed porting the code to the ESP32 would be trivial, and that was true for the most part: changes like library name being Wifi.h instead of Wifi8266.h were not a problem. UDP now does not like multicharacter writes but you can use print instead. So far so good.

However, when it came to the interrupt code I was stuck with the stepper interrupt causing an exception sometimes. And to make things weirder, the servo interrupt worked flawlessly (both of them had the IRAM_ATTR directive if you ask me).

Going little by little, I could narrow down the culprit to a floating point operation during the interrupt, that would cause problems sometimes but not always. Browsing around I found this post. Where the solution was simple: do not use floats within the interrupt routines but doubles. The reason was the float calculation would be performed by…

Command line scanning

I needed to get scanned some pages of a catalog. I own a cheap Acer 3300U scanner that works nicely under Linux. It is not fast: It scans a 300dpi A4 color page in 50 seconds and it halves that when using gray instead. Lowering scan resolution to 150dpi reduces the scan to around 15 seconds.

But if you plan to scan more than one page you need to save each one and you have to provide a name for them. That means some mouse clicks and some typing at the keyboard. I was wondering if it was a better way, something like an automated script. I learned that there is a command line tool in the scan-tools package called scanimage that does just that: It allows you to launch a scan from a script. So what I did was to create a simple for loop and I used the loop variable to increase the page count. Each iteration was scanning a new page and converting it to a JPEG file with a sequential name.

After a power problem with the scanner I learned that next reconnection used a different device name, so I …

The YouTube of slide shows

I've just came across this service. I'm sure they have been around for a while, but it is now when I learn about it. It seems like a good idea and a useful service. The sample below is just to show you how it works.

Network SecurityView more presentations from hj43us.

It is too bad that animations are lost in the process. But rest looks quite ok (all but some minor alignment problems). It imported the above document from an OpenOffice 2.0 Impress document.

Making the move ...

As things were quite smooth lately, I chose to spice it up a bit: I've moved four of my blogs to the new Blogger beta. I was quite scared as there was a warning message telling you the process cannot be undone. So if I am not lucky with how it works I can do nothing.

This is the first post and it seems to be working ok. The editing tools look quite the same but loading times look a bit longer. So don't be shy and use this damn "comment" thing to make us know your opinion as a user (no Mom, you do not have to do it).

Update: Good news, what it has been improved is the publishing delay. Now it seems almost instantaneous. No more time waiting for a post to be published. Well done!

Sweet 4GB pendrive

I've bought --from a brick and mortar shop-- a 4GB ECO pendrive (pendrive is also the brand name). It is a stylish and small pendrive with a rotating cap that hides or discovers the USB socket. It works nicely in Linux and it does too in Windows and OSX. However, it takes a non-negligible time to be detected under WinXP. It turns out that the device is not only emulating a hard-drive but a floppy disk too. So if you have a laptop and you still keep one of these old applications that insist on writing on drive A: you might be pleasantly surprised with this unit.

You do not get any differentiation when plugging it in on a Linux box: Two different drives show up (one with 1.5MB capacity and another with 4GB). It seems only the 4GB is recognized by OSX though.

My only complain is that the manufacturer only includes a keyring but not a necklace to carry the unit around. And the rotating cap is made of plastic so your metal keys will ruin its looks in a couple of days.