Revision beea48aa forklift/code/analog.c

View differences:

forklift/code/analog.c
3 3

  
4 4
int line_threshold = 150;
5 5

  
6
int line_read(int which);
7
void line_update(int* values);
8
int line_locate(int* values);
9

  
10 6
void analog_init(void)
11 7
{
12 8
  // ADMUX register
......
58 54
  return analog_read(ADC_LINE);
59 55
}
60 56

  
61
void line_update(int* values)
57
void line_update(char* values)
62 58
{
63 59
  int i;
64 60
  for(i = 0; i<5; i++)
65
    values[i] = line_read(i) < line_threshold ? LWHITE : LBLACK;
61
    values[i] = line_read(i) < line_threshold ? LBLACK : LWHITE;
66 62
}
67 63

  
68
int line_locate(int* values)
64
int line_locate(char* values)
69 65
{
70 66
  int i;
71 67
  int wsum = 0;
......
85 81

  
86 82
int line_read_pos(void)
87 83
{
88
  int values[5];
84
  char values[5];
89 85
  line_update(values);
90 86
  return line_locate(values);
91 87
}

Also available in: Unified diff