.Knob-limiter.c

Author: Bart Wessel

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
      A knob-cubelet that sets a limit, by Bart.
*/
unsigned char  limit = 0;
unsigned char   input = 0;

void setup()
{
}

void loop()
{
sense();
}

void sense()
{
    limit = get_knob();
    input = weighted_average(neighbor_data);

    if(input > limit)
    {
        block_value = limit;
    }
    else
    {
        block_value = input;
    }
}