Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Bateria(void) {
- value_1 = analogRead(A0);
- Cela_1_out = (value_1 * 5.0) / 1024.0; // see text
- Cela_1_in = Cela_1_out / (R2_Cela_1 / (R1_Cela_1 + R2_Cela_1));
- if (Cela_1_in < 0.09) {
- Cela_1_in = 0.0; //statement to quash undesired reading !
- }
- value_2 = analogRead(A1);
- Cela_2_out = (value_2 * 5.0) / 1024.0; // see text
- Cela_2_in = Cela_2_out / (R2_Cela_1 / (R1_Cela_1 + R2_Cela_1));
- if (Cela_2_in < 0.09) {
- Cela_2_in = 0.0; //statement to quash undesired reading !
- }
- value_3 = analogRead(A2);
- Cela_3_out = (value_3 * 5.0) / 1024.0; // see text
- Cela_3_in = Cela_3_out / (R2_Cela_3 / (R1_Cela_3 + R2_Cela_3));
- if (Cela_3_in < 0.09) {
- Cela_3_in = 0.0; //statement to quash undesired reading !
- }
- value_4 = analogRead(A3);
- Cela_4_out = (value_4 * 5.0) / 1024.0; // see text
- Cela_4_in = Cela_4_out / (R2_Cela_4 / (R1_Cela_4 + R2_Cela_4));
- if (Cela_4_in < 0.09) {
- Cela_4_in = 0.0; //statement to quash undesired reading !
- }
- value_5 = analogRead(A4);
- Cela_5_out = (value_5 * 5.0) / 1024.0; // see text
- Cela_5_in = Cela_5_out / (R2_Cela_5 / (R1_Cela_5 + R2_Cela_5));
- if (Cela_5_in < 0.09) {
- Cela_5_in = 0.0; //statement to quash undesired reading !
- }
- value_6 = analogRead(A5);
- Cela_6_out = (value_6 * 5.0) / 1024.0; // see text
- Cela_6_in = Cela_6_out / (R2_Cela_6 / (R1_Cela_6 + R2_Cela_6));
- if (Cela_6_in < 0.09) {
- Cela_6_in = 0.0; //statement to quash undesired reading !
- }
- value_6 = analogRead(A5);
- Cela_6_out = (value_6 * 5.0) / 1024.0; // see text
- Cela_6_in = Cela_6_out / (R2_Cela_6 / (R1_Cela_6 + R2_Cela_6));
- if (Cela_6_in < 0.09) {
- Cela_6_in = 0.0; //statement to quash undesired reading !
- }
- value_7 = analogRead(A6);
- Cela_7_out = (value_7 * 5.0) / 1024.0; // see text
- Cela_7_in = Cela_7_out / (R2_Cela_7 / (R1_Cela_7 + R2_Cela_7));
- if (Cela_7_in < 0.09) {
- Cela_7_in = 0.0; //statement to quash undesired reading !
- }
- value_8 = analogRead(A7);
- Cela_8_out = (value_8 * 5.0) / 1024.0; // see text
- Cela_8_in = Cela_8_out / (R2_Cela_8 / (R1_Cela_8 + R2_Cela_8));
- if (Cela_8_in < 0.09) {
- Cela_8_in = 0.0; //statement to quash undesired reading !
- }
- value_9 = analogRead(A8);
- Cela_9_out = (value_9 * 5.0) / 1024.0; // see text
- Cela_9_in = Cela_9_out / (R2_Cela_9 / (R1_Cela_9 + R2_Cela_9));
- if (Cela_9_in < 0.09) {
- Cela_9_in = 0.0; //statement to quash undesired reading !
- }
- value_10 = analogRead(A9);
- Cela_10_out = (value_10 * 5.0) / 1024.0; // see text
- Cela_10_in = Cela_10_out / (R2_Cela_10 / (R1_Cela_10 + R2_Cela_10));
- if (Cela_10_in < 0.09) {
- Cela_10_in = 0.0; //statement to quash undesired reading !
- }
- value_11 = analogRead(A10);
- Cela_11_out = (value_11 * 5.0) / 1024.0; // see text
- Cela_11_in = Cela_11_out / (R2_Cela_11 / (R1_Cela_11 + R2_Cela_11));
- if (Cela_11_in < 0.09) {
- Cela_11_in = 0.0; //statement to quash undesired reading !
- }
- value_12 = analogRead(A11);
- Cela_12_out = (value_12 * 5.0) / 1024.0; // see text
- Cela_12_in = Cela_12_out / (R2_Cela_12 / (R1_Cela_12 + R2_Cela_12));
- if (Cela_12_in < 0.09) {
- Cela_12_in = 0.0; //statement to quash undesired reading !
- }
- value_13 = analogRead(A12);
- Cela_13_out = (value_13 * 5.0) / 1024.0; // see text
- Cela_13_in = Cela_13_out / (R2_Cela_13 / (R1_Cela_13 + R2_Cela_13));
- if (Cela_13_in < 0.09) {
- Cela_13_in = 0.0; //statement to quash undesired reading !
- }
- value_14 = analogRead(A13);
- Cela_14_out = (value_14 * 5.0) / 1024.0; // see text
- Cela_14_in = Cela_10_out / (R2_Cela_14 / (R1_Cela_14 + R2_Cela_14));
- if (Cela_14_in < 0.09) {
- Cela_14_in = 0.0; //statement to quash undesired reading !
- }
- value_15 = analogRead(A14);
- Cela_15_out = (value_15 * 5.0) / 1024.0; // see text
- Cela_15_in = Cela_15_out / (R2_Cela_15 / (R1_Cela_15 + R2_Cela_15));
- if (Cela_15_in < 0.09) {
- Cela_15_in = 0.0; //statement to quash undesired reading !
- }
- value_16 = analogRead(A15);
- Cela_16_out = (value_16 * 5.0) / 1024.0; // see text
- Cela_16_in = Cela_16_out / (R2_Cela_16 / (R1_Cela_16 + R2_Cela_16));
- if (Cela_16_in < 0.09) {
- Cela_16_in = 0.0; //statement to quash undesired reading !
- }
- if (A0 >= 0 && A0 <= 113) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- }
- if (A0 >= 114 && A0 <= 226) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- }
- if (A0 >= 227 && A0 <= 339) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- }
- /* if (Suma_napiec >= 340 && Suma_napiec <= 452) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 453 && Suma_napiec <= 565) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 566 && Suma_napiec <= 678) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- RemoteXY.led_5_r = HIGH ? 255 : 0;
- RemoteXY.led_5_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- RemoteXY.led_5_r = LOW ? 255 : 0;
- RemoteXY.led_5_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 679 && Suma_napiec <= 791) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- RemoteXY.led_5_r = HIGH ? 255 : 0;
- RemoteXY.led_5_g = HIGH ? 255 : 0;
- RemoteXY.led_6_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- RemoteXY.led_5_r = LOW ? 255 : 0;
- RemoteXY.led_5_g = LOW ? 255 : 0;
- RemoteXY.led_6_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 792 && Suma_napiec <= 904) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- RemoteXY.led_5_r = HIGH ? 255 : 0;
- RemoteXY.led_5_g = HIGH ? 255 : 0;
- RemoteXY.led_6_g = HIGH ? 255 : 0;
- RemoteXY.led_7_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- RemoteXY.led_5_r = LOW ? 255 : 0;
- RemoteXY.led_5_g = LOW ? 255 : 0;
- RemoteXY.led_6_g = LOW ? 255 : 0;
- RemoteXY.led_7_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 905 && Suma_napiec <= 1017) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- RemoteXY.led_5_r = HIGH ? 255 : 0;
- RemoteXY.led_5_g = HIGH ? 255 : 0;
- RemoteXY.led_6_g = HIGH ? 255 : 0;
- RemoteXY.led_7_g = HIGH ? 255 : 0;
- RemoteXY.led_8_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- RemoteXY.led_5_r = LOW ? 255 : 0;
- RemoteXY.led_5_g = LOW ? 255 : 0;
- RemoteXY.led_6_g = LOW ? 255 : 0;
- RemoteXY.led_7_g = LOW ? 255 : 0;
- RemoteXY.led_8_g = LOW ? 255 : 0;
- }
- if (Suma_napiec >= 1018 && Suma_napiec <= 1023) {
- RemoteXY.led_0_r = HIGH ? 255 : 0;
- RemoteXY.led_1_r = HIGH ? 255 : 0;
- RemoteXY.led_2_r = HIGH ? 255 : 0;
- RemoteXY.led_3_r = HIGH ? 255 : 0;
- RemoteXY.led_3_g = HIGH ? 255 : 0;
- RemoteXY.led_4_r = HIGH ? 255 : 0;
- RemoteXY.led_4_g = HIGH ? 255 : 0;
- RemoteXY.led_5_r = HIGH ? 255 : 0;
- RemoteXY.led_5_g = HIGH ? 255 : 0;
- RemoteXY.led_6_g = HIGH ? 255 : 0;
- RemoteXY.led_7_g = HIGH ? 255 : 0;
- RemoteXY.led_8_g = HIGH ? 255 : 0;
- RemoteXY.led_9_g = HIGH ? 255 : 0;
- } else {
- RemoteXY.led_0_r = LOW ? 255 : 0;
- RemoteXY.led_1_r = LOW ? 255 : 0;
- RemoteXY.led_2_r = LOW ? 255 : 0;
- RemoteXY.led_3_r = LOW ? 255 : 0;
- RemoteXY.led_3_g = LOW ? 255 : 0;
- RemoteXY.led_4_r = LOW ? 255 : 0;
- RemoteXY.led_4_g = LOW ? 255 : 0;
- RemoteXY.led_5_r = LOW ? 255 : 0;
- RemoteXY.led_5_g = LOW ? 255 : 0;
- RemoteXY.led_6_g = LOW ? 255 : 0;
- RemoteXY.led_7_g = LOW ? 255 : 0;
- RemoteXY.led_8_g = LOW ? 255 : 0;
- RemoteXY.led_9_g = LOW ? 255 : 0;
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement