Tag Archives: driver

Update to: Python USB and TEMPer V1.2

Unfortunately my every day job has gotten most of my time lately and I haven’t been able to make much progress on anything. But today I had some time to play around with my new cubieboard based Fileserver and the old Microsoft Kinect I had laying around for a while now (I’ll write about that in the next post). And while I was playing around I got reminded of a very powerful Python library called numpy, which helped me solve a minor problem I still had with my TEMPer USB driver. Previously I had a problem with reading temperatures below zero, as the TEMPer protocol uses a signed integer as a datatype for the temperature and Python doesn’t have a native one Byte signed integer. But luckily numpy remedies the problem with its own datatypes, among them a one Byte signed integer (int8). So I shortly turned away from my Kinect/cubieboard endavour to fix the TEMPer driver. The solution is simple, I add numpy to my imports and convert the retrieved temperature value to numpys int8, so the final code looks like this:

Flattr this!