We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[브릿지 Serial 처리 해결]
while(1){ if(Serial1.available()){ Serial1.flush(); String str = Serial1.readStringUntil('*'); str = Serial1.readStringUntil('/'); function_state = str.toInt(); str = Serial1.readStringUntil('/'); X = str.toInt(); str = Serial1.readStringUntil('/'); Y = str.toInt(); str = Serial1.readStringUntil('*'); Serial_control_flag = true; break; } }
보내는 데이터를 * / [기능] / [X좌표] / [Y좌표] / *
[에어포인트 기능 해결]
if(digitalRead(Click_button) == LOW && lock == 0){ //Click Function packet = packet + "*"; packet = packet + DATA_PASSPAGE; packet = packet + "/"; packet = packet + X ; packet = packet + "/"; packet = packet + Y; packet = packet + "/"; packet = packet + "*"; Serial1.println(packet); lock_check = true; lock++; } else if(digitalRead(Drawing_button) == LOW && lock == 0){ packet = packet + "*"; packet = packet + DATA_DRAWING ; packet = packet + "/"; packet = packet + X ; packet = packet + "/"; packet = packet + Y; packet = packet + "/"; packet = packet + "*"; Serial1.println(packet); lock++; drawing_flag = ~drawing_flag + 2; lock_check = true; } else if(digitalRead(ZoomIn_button) == LOW && lock == 0){ //ZoomIn Function packet = packet + "*"; packet = packet + DATA_ZOOMIN; packet = packet + "/"; packet = packet + X ; packet = packet + "/"; packet = packet + Y; packet = packet + "/"; packet = packet + "*"; Serial1.println(packet); lock++; zoomin_flag = ~zoomin_flag + 2; lock_check = true; } else if(digitalRead(Motion_button) == LOW){ //Motion Control packet = packet + "*"; packet = packet + DATA_MOTION; packet = packet + "/"; packet = packet + X ; packet = packet + "/"; packet = packet + Y; packet = packet + "/"; packet = packet + "*"; Serial1.println(packet); } else{ if( drawing_flag == true || zoomin_flag == true ){ packet = packet + "*"; packet = packet + DATA_DEFAULT; packet = packet + "/"; packet = packet + X ; packet = packet + "/"; packet = packet + Y; packet = packet + "/"; packet = packet + "*"; Serial1.println(packet); } }
-> 기능을 수행할때마다 기능수행에 따른 딜레이가 있는데 이에 맞춰서 lock 기능을 이용하여 해결
전역변수부분 48 line
//Program Locker unsigned int lock = 0; boolean lock_check = false;
lock 카운터 부분 76 line
/* * Locker : 카운트 레지스터를 이용한 프로그래밍 적인 딜레이 연출 * No delay() API */ if(lock_check == true){ lock++; if(lock > 400){ lock = 0; lock_check = false; } }
The text was updated successfully, but these errors were encountered:
참고로 업데이트 된 소스는 arduino(src)에 위치해있습니다.
Sorry, something went wrong.
No branches or pull requests
[브릿지 Serial 처리 해결]
보내는 데이터를 * / [기능] / [X좌표] / [Y좌표] / *
[에어포인트 기능 해결]
delay API 보다 훨씬 안정적
-> 기능을 수행할때마다 기능수행에 따른 딜레이가 있는데 이에 맞춰서 lock 기능을 이용하여 해결
전역변수부분 48 line
lock 카운터 부분 76 line
The text was updated successfully, but these errors were encountered: