Line 19... |
Line 19... |
19 |
Wire.begin(); // join i2c bus (address optional for master) |
19 |
Wire.begin(); // join i2c bus (address optional for master) |
20 |
// I2C pins PC4 - , PC5 - |
20 |
// I2C pins PC4 - , PC5 - |
21 |
// |
21 |
// |
22 |
pinMode(3, OUTPUT); // LED pro blikani, aby bylo videt, ze to neco dela |
22 |
pinMode(3, OUTPUT); // LED pro blikani, aby bylo videt, ze to neco dela |
23 |
Serial.begin(9600); // Zmerena intenzita osvetleni se bude vypisovat na seriovou linku |
23 |
Serial.begin(9600); // Zmerena intenzita osvetleni se bude vypisovat na seriovou linku |
- |
|
24 |
Serial.println("LABduino luxmeter demo - (c) MLAB, kakl 2012"); |
24 |
} |
25 |
} |
25 |
|
26 |
|
26 |
int data = 0; |
27 |
int data = 0; |
27 |
int light_sensor_setup; |
28 |
int light_sensor_setup; |
28 |
|
29 |
|
29 |
void led_blink() |
30 |
void led_blink() |
30 |
{ |
31 |
{ |
31 |
digitalWrite(3, HIGH); // set the LED off |
32 |
digitalWrite(3, HIGH); // set the LED off |
32 |
delay(500); |
33 |
delay(100); |
33 |
digitalWrite(3, LOW); // set the LED on |
34 |
digitalWrite(3, LOW); // set the LED on |
34 |
delay(500); |
35 |
delay(700); |
35 |
} |
36 |
} |
36 |
|
37 |
|
37 |
|
38 |
|
38 |
int set_light_sensor(int mode) |
39 |
int set_light_sensor(int mode) |
39 |
{ |
40 |
{ |