Posts

Showing posts from May, 2011

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…

Use Processing and Kinect in Ubuntu

I'm working on a project that uses Kinect depth camera to detect a person silhouette as I have mentioned before in this blog.

Part of the development was done using a Mac because I found a library that enabled me to use Kinect directly from Processing (which I've found very convenient for prototyping).

It did not hurt that an OpenCV library for processing was also available.

What was missing was a version of the Kinect's Processing library to be used with GNU/Linux. Fortunately, someone took the time to tweak the Mac version to make it work and to post the process online. It did not work for me exactly as it was but it was close. So just in case you want to experience with it, here are the steps that worked for me:

Get a copy of the library:
git clone git://github.com/shiffman/libfreenect.gitCreate a and move to a build directory inside libfreenect folder
cd libfreenectmkdir buildcd buildcmake ..make sudo make installGo to wrappers/java and edit build.sh file (remove -m…

Fixing a broken compact-flash socket (sort of)

Image
A few days ago an incorrect manipulation of the compact flash memory broke my Canon reflex camera memory socket. It was a very bad moment as I was not able to use it in my recent trip to China.

Though I was able to get some thin tweezers I was only capable of breaking the bent pin. So my camera was useless now.

Once back home, I've tried a simple solution that worked nicely, so nicely I want to share it with you: I just took a strand of copper from an electric wire and I stuffed it in to the hole of the compact flash memory that corresponded to the broken pin. It created kind of a small copper wire brush that makes contact with the broken pin once the memory is inserted. It is a cheap solution to the problem that I've found surprisingly good.

If you have several broken pins you may try this, but I am not so confident you'll get a decent contact for all of them at the same time.