Random scribbles

The same series of scribble pixel commands:

Polargraph scribble pixel not so random!

Look closely, exact same pixel shapes for each one.  I know random numbers are hard to come by in the digital world, but I did expect the arduino random() function to be slightly less deterministic.  Funny.

I think the differences in the line shapes can be put down to different motor speeds / accelerations.

2 thoughts on “Random scribbles

  1. If its like the C++ one you need to seed the generator, doing a quick google it looks like you want ot add a
    randomSeed(analogRead(0));

    to the start of the code, which will fire the random number generator up using an analog read from pin 0 to get a properly random seed for the generator.

    if you dont seed the generator (or you seed it with a consistant value) you’ll get the same sequence of numbers every time
    (We actually use the fact it will give the same thing every time to make the random functions in inkscape behave the same when you reload a file.)

    see for ref: http://arduino.cc/de/Reference/RandomSeed

Leave a Reply