Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void serialEvent() {
- if(Serial.available()){
- while(Serial.available()){
- input[count] = Serial.read();
- if (input[count] == 'q'){
- Serial.print("Неверный символ '");
- Serial.print(input[count]);
- Serial.println("', попробуйте снова");
- memset(input, 0, sizeof(input));
- count=0;
- }
- else if (input[count] == ':'){
- Serial.print("счет ");
- Serial.println(schet);
- if (schet==0){
- Serial.println("введи символ между '::'");
- schet = 0;
- }
- else if (schet==1){
- Serial.println("делаем");
- input[count]=input[count-1];
- input[count-1]='0';
- schet = 0;
- count++;
- }
- else if (schet==2){
- Serial.println("ничего не делаем");
- schet = 0;
- }
- else{
- Serial.println("много символов между '::', попробуйте снова");
- memset(input, 0, sizeof(input));
- count=0;
- }
- }
- else{
- count++;
- schet++;
- Serial.println(input);
- //Serial.print(count);
- //delay(5);
- }
- delay(5);
- }
- if (count == 16){
- memset(input, 0, sizeof(input));
- count=0;
- schet=0;
- huyak();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement