In respect of it being legal to create, distribute and sell a program to do that, I don't see any legal problems there.
In terms of breaching Copyright, I don't believe that automatically producing code which is in the PICAXE basic-like programming language would be an infringement, but the techniques and algorithms you use to do that may infringe Patents held by others.
You also need to be careful as to how you use the "PICAXE" name ( <i>"device" </i> ) as that's a Trademark of Revolution Education Limited ...
http://www.rev-ed.co.uk/picaxe/forum/Topic.asp?topic_id=3178
In a wider sense of legality and Copyright issues, terms and conditions of employment and many other things play a part in a full answer.
In terms of, "If I produce this, could Rev-Ed take legal action against me for producing a program which did that ?", I believe the answer is almost cetainly no [*], although I am not a professional lawyer, so this must not be taken as authoritative legal advice.
[*] They could, but I don't believe they'd win any such legal action.
Edited by - hippy on 10/31/2005 4:19:51 PM