Showing posts with label hobby. Show all posts
Showing posts with label hobby. Show all posts

Sunday, January 17, 2010

A different community



Last night I met up with a different community, an obscure underground movement that challenges the educational values held by the captains of democracy. They call themselves happy hackers.
Technology has become more affordable to the mass-market, but at the same time more accessible. You can perform scientific observations, investigations and home learning now, more than ever before. It's a bit like open-source, but for education.

For more on what they do, visit my e-journal.
For that that find this prospect scary, do not visit my techno blog/journal.

Tuesday, October 13, 2009

Programming STDERR

It's frustrating when you want to get something to work, and nobody's solution fits. I had already gotten quite far on a problem and had it almost done when I found this neat solution to the problem of piping error messages sent to STDERR to a file on MSDN.

I needed to either write a huge perl-script(and without a debugger that's a cramp) or reidirect the stderr and stdout from a static code analysis tool called splint so that I can gather statistics on any dodgy lines of 'C' code.
Why a beer? Well that's a celebration of a slight change in the wind. Where it will go is probably nowhere, but it's a change nonetheless.

/edit
Returning to the redirecting of standard error and pipes, the downside it the default pipe-buffer size, in fact although you can easily increase the pipe buffer size, we all know a huge buffer is in-efficient. You see, unlesss you can empty a smaller buffer in the background while the child-process is filling it, the child will get blocked if it tries to overflow the buffer. A very bad thing, normally solved by spawning a thread to process and empty things while you wait for the child to terminate. I hate and love threads, so forgoing a complex solution, I solved this by simply waiting 100ms for the child to terminate, and then emptying the stream buffer in between by polling using WaitForProcess(). It appears to solve the problem, but exactly how?.... because someone has to close the stream in order to detect the end and not get blocked yourself in the parent waiting for a read on a dead stream?
As it so happens, the parent can happily close it's copy of the redirected stream handle and then keep reading from the duplicate knowing all will unblock when the child terminates (because the handle closes in the child when it does so). Problem solved.

Friday, July 24, 2009

Instructable fun

I built one of these yesterday quickly - http://www.instructables.com/id/Pocket-Drunken-Robot/

I have a few motors, anyone who wants one can mail me, and I can look at P&P to cover things, so you can build your own one.

A hint from me is to cut your template with quite long arms for the battery holder, you want just over 1 inch square to start. Have fun.

I have also recycled/rinced some tiny LED displays that go by the part SLX 2016, where X is RGY(Red Green etc.) You will need to use 10 output pins on your micro to control this beast, but it's very bright (too bright for my webcam).


I am going to hunt for a few more of these in the dumpster, they are text-only, and tiny, but they have some cool possibilities.

Friday, July 17, 2009

Latest toy.


Oscilloscope for doing diagnostics. And playing of course / this one can trace up to 60Mhz at -3dB. It's interesting once you really get into it, spec sheets for 'scopes are not that easy to read. So if you are buying one, have all the stats in a list, because comparing is not trivial. This one grafts fine for about 18Mhz clock, all I need now is some decent probes of various types. Will prolly get a pair off Ebay next week (which is where I snatched this pic:-] ).

He's pulling through doctor!

No, it was not that bad, and I refer not to 'that' use of pulling either, operation looks successful no? At least I can walk without limping, and can move the knee through most of the normal angle to be able to get up and down stairs. the doctor say I should be able to dance again int 2 weeks; Just like the sanitary pad advert that boasts you will be able to do anything, for example abseiling dancing or riding a bike afterwards, It prompted little Johnny to go to the chemist and get some so he could get onto his new bike - yes I can run - but then again I never could dance before anyway.

My latest Microcontroller project is a tiny game of battleships. I wrote all the code from scratch and tested it in a Win32 application console-app, which I will port to the AVR micro. It's probably the tiniest Battleships game ever - 5x8. I got the idea from a PIC project, since I could not use any of the code, I have shamelessly used the requirements-spec to create my own implementation in the 'C' language. Next week I will post the code to avrfreaks.net, so there you have it.

back trace - www.zaphodikusrealm.blogspot.com

Monday, March 16, 2009

Microcontroller hackingness stuffness

It's nothing great really, but since arriving in the UK, I've posted a little about resuming a hobby in electronics. One thing that has happened to electronics since I as in school is that CAD and digital electronics have become affordable areas to hack about in.

For instance, if you have a very fast micro-controller (which is a CPU with some peripherals), and I say fast, because micros are not fast, they are intentionally slow because they are not supposed to be used for applications that use lots of data. A CPU is different, it typically has minimal peripheral support and maximal memory bus support, and generally uses 100x more juice. OK, back onto topic - a fast enough micro can actually simulate lots of things you would have done in a basic analog circuit, but at a lower component-count. Enter Atmel AVR. I could have opted for PIC chips, but something in me always opts for the fresh or the underdog over going with the stale or the old leaders.

Here is where it starts.
3 AA batteries to run it, some optional transistors and you have a moving display.

Thursday, December 06, 2007

Transistor is 60


Article : http://www.news.com/8301-10784_3-9829403-7.html. Wow, and I thought I was getting old. Technology does move a-pace. And to think that a semiconductor used to have at least 5 pins before. Today so much is easier though the cleverness of those who went before, although their "invent" is not really lost and covered over by everyone who appreciates the detail.
Go on, have you hugged a tranie today?
Hey, bring that sheep back!

Wednesday, August 15, 2007

Electronic kit building

2 things have re-awakened in my fancy world this holiday. One of them is electronics.



Some pics of the little creepy simple light-attracted bug. It took only half an hour to build. This circuit is nice in only 2 ways, cheap, shows how a motor can drive the bug without any gearing, and thirdly simple, having a very low transistor count.

I was dissapointed on 2 counts with velleman. the website is wrongly silkscreened onto the board as http://www.vellleman.be/ . It should be www.velleman.be ,they also have a USA office and site. Why on earth screw up something that important. Secondly (but not last) is they give you 2 diodes, but neither of them have a place on the PCB... well actually I used one as a rear-axle.. and that is where the puzzle lay, because the horrid diagram they provided on the box shows a diode to prevent damage if the battery is the wrong way about (would actually heat the diode a bit IMHO, since it is drawn as going across the supply of 2 AAA batteries.) but it is not on the PCB, unless you solder it onto the underside! UGLY.
Overall a nice simple kit. Next is a microcontroller project He He!.