Posts

Showing posts from September, 2007

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…

Google's new offspring

I've used for some time their Google Docs service that offered on-line Spreadsheets and Text editing and now the third complement has come to life: Presentations have been added to the mix and offer, like the other tools, easy collaboration among a group of users of the same documents.

I've used a shared spreadsheet for marking lab sessions across a group of teachers and it proved quite useful.

Of course none of these tools compare very well against a locally installed Office application, but it just uses on any networked computer and its free and your documents are accessible from anywhere on the net.

When you factor in the possible collaboration between several people on the same documents Google's proposal becomes much more attactive plus you save lots of emails.

Excel 2007 bug

Image
I've just read on Slashdot about an error in Excel's multiplication. Details can be found in this Google group thread. In short, it seems a multiplication whose result gives 65,535 (which is 2^16 -1 or 0xFFFF in hex) will return 100,000.

I haven't tested it myself yet, but it seems several other people did. I would be worried if I were using that software for any calculation.

Update: I've already tested and it happened indeed (see the picture). Cell A1 shows the offending formula and A2 shows you the result of that formula (which should be 65,535 instead). However, I've tested other multiplications whose result should be the same and they all seemed to work ok. That's funny. (BTW, decimal point is "," in my locale in case you are wondering).

HDR with RAW files

Image
While I mentioned HDR on a previous entry, at the time I comented the need of three (or more) different exposures to obtain an HDR image. More recently I have learned that you can use the same software to obtain the same result with just one photo.

The basic idea is that camera sensor have significantly more resolution than the 8 bits per color of JPEG. Some cameras -- unfortunately the most expensive ones -- allow you to access to the original sampled data. The so called RAW format. After some processing a JPEG file can be obtained changing, for example, the exposure one f-stop up or down (this is like dark-room magic).

In the above image I took a single exposure and I used Canon's RAW processing software to obtain three JPEG files with exposure values -1, 0 and +1 from the original shot. Then the three were combined with (the trial version of) Photomatix software.

Original shot is shown below for you to compare.











Update: Actually, thanks to one of your postings I've learned that …

Supress belief

After returning from holidays I've came across two different stories that somehow did not look right and turned out to be a scam or a hoax.

First one was a person who told me about a recent e-mail she got from a friend who, interestingly, claimed to be in Nigeria and lost her wallet in a cab. The twist was that the message was apparently coming from a real person that she knew.

I tend to be quite suspicious whenever somebody asks me money by email, specially if the requester is based in Nigeria (419 scam is a classic).

This time it was a new variation, based on hijacking a person's email account (gmail, hotmail, etc) so they take control of that person's email and they use his/her address book contacts. This way the person receiving the scam email believe they are talking to a person they know. If they are lucky you will rush to Western Union to wire the money trying to help your friend.

The second weird news came from a good friend who was worried about the news that spread …