Random Block Value.c

Author: Eric Lundby

A simple program that sets it's block value to a random number (0-255).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
void setup()
{

}

void loop()
{
    think();
}

void think()
{
    int r = rand();
    r = r % 256;
    block_value = (uint8_t)r;
    wait(200);
}