IronJungle
Senior Member
I did a code mod on my Etch a Sketch Temperature Data Logger to have the stylus just "move around randomly".
Since the PICAXE 18M2 random number generator is pseudo, the patterns were not very entertaining. In a word they were very predictable. If I had a timer chip, etc. I could just use the seconds or such to seed the RANDOM command from time to time. But I don't have that option. Here is my solution and I would like comments.
I can say for certain that the Etch a Sketch display drawn is now very unpredictable and a zillion time improvement. My code:
touch16 TouchRandomizer, b0 'lower bits w0
touch16 TouchRandomizer, b1 'w0 upper
RANDOM w0
I leave the touch pin on the 18M2 open/floating so it is moves all over the place when viewed in debug.
Comments?
Since the PICAXE 18M2 random number generator is pseudo, the patterns were not very entertaining. In a word they were very predictable. If I had a timer chip, etc. I could just use the seconds or such to seed the RANDOM command from time to time. But I don't have that option. Here is my solution and I would like comments.
I can say for certain that the Etch a Sketch display drawn is now very unpredictable and a zillion time improvement. My code:
touch16 TouchRandomizer, b0 'lower bits w0
touch16 TouchRandomizer, b1 'w0 upper
RANDOM w0
I leave the touch pin on the 18M2 open/floating so it is moves all over the place when viewed in debug.
Comments?
Last edited: