Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Tuesday, 10 February 2015

New Toy!

Today, my wife’s surprise for me arrived. I had NO idea what it was … she kept telling me that I’d love it and that it was something that we had spoken about previously.

Turns out, she was dead right … I love it!

My surprise was a USB Digital Microscope (50x optical 200x digital magnification).

My eyesight has been getting poorer over the last couple of years and I’ve been getting more and more into wanting to solder SMD … in fact general soldering was only happening because of my 20x desk lamp/mag. It seems that, as my interest/need for closer and finer work has increased, my eyesight has degraded correspondingly, ah the joys of getting older.

The stand that comes with the device is nice, but not that practical. The first thing that I did was take the magnifying glass off one of my “Third Hand” tools and mount the microscope on that.

plugable - Digital Microscope

That lifts the scope end of the device up by about 10 cm, giving me enough room under the scope to actually work.

Next, I played with the software that comes with the scope. It’s pretty simple to use, but it has enough functionality to make it very useful.

Now I can …

look at components on an Arduino clone and identify them.

freetronics eleven 01

freetronics eleven 02

look at my SMD components in their packaging (and identify them)

NE555 SMD

some NE555 SMD

SMD 2N2222 Transistors

0805 2N2222 transistors

SMD LED White

0805 Super bright White LED

Identify Diodes

IN4148 Diodes

IN4148

See the colours of resistors … although, I’m still colour-blind. I’m still taking it on faith that these are 10Ω resistors

10 Ohm Resistor

One day, I’ll write some software to identify the resistor by colour … ‘till then, I’ll use my multimeter for that.

Look at some of my soldering work and identify the IC type

 

ATTiny85 Shift Register sub board

As well as inspect my soldering and printed circuit boards

Round LED board

attiny84 shield traces

Overall, I am very happy with my present … now I need to set it up on the laptop on my electronics workbench. I probably also need to make a better stand for it. I’ve got a mini camera tripod, maybe I can make an adaptor for the attachment … hmmm … gears are whirring in my head.

Thursday, 9 October 2014

Testing Arduino Code

There are a couple of ways that you can test your Arduino code, not least of which is compiling your sketch and then uploading it to your microprocessor and making sure it runs OK … however, that doesn’t help in revealing any problems in the code.

If there are major problems then, sure, the IDE will whine and you’ll hear about it. But what if there’s a silent problem in your code that you can’t necessarily find sooner?

I’m currently looking at using a C language IDE (CodeLite) as a testing ground for my code. I haven’t gone too far yet, so there are likely to be some issues (for instance, the byte data type is missing in GCC … apparently, so I’m using the char data type instead).

My thinking is that I should be able to use the C IDE to reveal any problems in my code by sending the data that I want to monitor to stdout and use stepping to inspect the values and variables as it goes along.

Other things to consider … a standard C application starts with int main() rather than void setup() and you have to explicitly define and call the loop() function, oh there are other differences that I’m sure to find along the way, but for simply testing function blocks to make sure that the data that my function is sending (and to a lesser extent, the function structure and flow), can be inspected discretely.

Playing with my Shift Register code, I created the following main.c file

code_grab

and then I ran the code …

cmd_grab

showing that the values being passed are correct.

I can also create a couple of different functions that do the same so that I can then have a look at them from an efficiency, memory and timing perspective to decide on which way is the best for my application.

Anyway, it’s all learning, poking and prodding. I’m not sure how others approach testing their Arduino code … but then, I’m a software tester by profession.

Paypal Donations

Donations to help me to keep up the lunacy are greatly appreciated, but NOT mandatory.