Claire arrive dans le brotch...
This commit is contained in:
@@ -24,9 +24,21 @@ void setup() {
|
||||
Serial.print("M running now\n");
|
||||
|
||||
}
|
||||
/* -------------------------------------------------- */
|
||||
/* ================================================== */
|
||||
short adc_pins[] = { A0, A1, A2, A4 };
|
||||
/*
|
||||
* the light captor is on A4 pin
|
||||
*/
|
||||
void readlight(void)
|
||||
{
|
||||
short value;
|
||||
delay(100);
|
||||
value = analogRead(A4);
|
||||
Serial.print("L ");
|
||||
Serial.print(value);
|
||||
Serial.print('\n');
|
||||
}
|
||||
/* ================================================== */
|
||||
short adc_pins[] = { A0, A1, A2, A3 };
|
||||
#define NB_PASSE 4
|
||||
/* -------------------------------------------------- */
|
||||
void updatevalues(short *ptr)
|
||||
@@ -57,7 +69,7 @@ void sendvalues(short *ptr)
|
||||
Serial.print(" ");
|
||||
Serial.print(ptr[foo]);
|
||||
}
|
||||
Serial.print("\n");
|
||||
Serial.print('\n');
|
||||
}
|
||||
/* -------------------------------------------------- */
|
||||
void update_and_send(void)
|
||||
@@ -66,12 +78,17 @@ void update_and_send(void)
|
||||
|
||||
updatevalues(values);
|
||||
sendvalues(values);
|
||||
|
||||
|
||||
|
||||
}
|
||||
/* ================================================== */
|
||||
void loop() {
|
||||
static int foo = 0;
|
||||
update_and_send();
|
||||
|
||||
if (foo++ > 5) {
|
||||
readlight(); foo = 0;
|
||||
}
|
||||
|
||||
delay(DELAI);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user