Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //══════════════════════════════════════════════════════════════════════════════════════════════════════//
- // Tlačítko //
- // Funkce pro ovládání tlačítek, má dva vstupní parametry : 1) Pin PISO registru, na které je připojeno //
- // 2) CVID - trojznak definovaný v programu TStoCOM //
- // Funkce posílá pomocí sériové linky hodnotu v rozsahu 0-1 (násobitel je 1) //
- //══════════════════════════════════════════════════════════════════════════════════════════════════════//
- int aktualStavTlacitka = 0;
- int staryStavTlacitka[POCET_VSTUPU];
- //══════════════════════════════════════════════════════════════════════════════════════════════════════//
- void Tlacitko(int pointer, String CVID) {
- if(tlacitko[pointer] != staryStavTlacitka[pointer])
- {
- if(tlacitko[pointer] == 1) {
- Serial.print(CVID);
- Serial.print("1");
- Serial.print("\r\n");
- }
- else if(tlacitko[pointer] == 0) {
- Serial.print(CVID);
- Serial.print("0");
- Serial.print("\r\n");
- }
- else {
- Serial.print("Chybna poloha tlacitka!");
- Serial.print("\r\n");
- }
- staryStavTlacitka[pointer] = tlacitko[pointer];
- }
- }
- //══════════════════════════════════════════════════════════════════════════════════════════════════════//
Advertisement
Add Comment
Please, Sign In to add comment