JcGaming

cx

Dec 12th, 2025
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.23 KB | None | 0 0
  1. #include "IR_remote.h"
  2. #include "keymap.h"
  3.  
  4. IRremote ir(3);
  5.  
  6. #include <Servo.h>
  7.  
  8. volatile char BLE_bit_temp;
  9. String BLE_value;
  10. String G_Bluetooth_value;
  11. volatile int G_degree;
  12. volatile int re_string_len;
  13. volatile float Left_photosensitive;
  14. volatile float Right_photosensitive;
  15. volatile int Lightseeking_Degree;
  16. volatile float f;
  17. volatile int speed_value;
  18. volatile int D_mix;
  19. volatile int D_mid;
  20. volatile int D_max;
  21. volatile boolean Funtion_FLag;
  22. volatile int G_string_len;
  23. volatile int BLE_Change_SPEED;
  24.  
  25. Servo myservo;
  26.  
  27. float checkdistance() {
  28. digitalWrite(12, LOW);
  29. delayMicroseconds(2);
  30. digitalWrite(12, HIGH);
  31. delayMicroseconds(10);
  32. digitalWrite(12, LOW);
  33. float distance = pulseIn(13, HIGH) / 58.00;
  34. delay(10);
  35. return distance;
  36. }
  37.  
  38. // ------------------ UPDATED FUNCTION ------------------
  39. void Ultrasonic_Avoidance() {
  40. Funtion_FLag = true;
  41. while (Funtion_FLag) {
  42. int Front_Distance = 0;
  43. int Left_Distance = 0;
  44. int Right_Distance = 0;
  45. int Right_IR_Value = 1;
  46. int Left_IR_Value = 1;
  47. Left_IR_Value = digitalRead(A1);
  48. Right_IR_Value = digitalRead(A2);
  49. Front_Distance = checkdistance();
  50. Serial.println(Front_Distance);
  51.  
  52. // 1) If front is clear -> go straight
  53. if (Front_Distance > D_mid) {
  54. digitalWrite(2, HIGH);
  55. analogWrite(5, (3.5 * 22.5));
  56. digitalWrite(4, LOW);
  57. analogWrite(6, (3.5 * 22.5));
  58. }
  59. // 2) If obstacle in front (<= D_mid) -> stop, scan, and turn
  60. else {
  61. digitalWrite(2, LOW);
  62. analogWrite(5, 0);
  63. digitalWrite(4, HIGH);
  64. analogWrite(6, 0);
  65.  
  66. // Emergency backup if very close or both side IRs triggered
  67. if (Front_Distance <= D_mix || (Left_IR_Value == 0 && Right_IR_Value == 0)) {
  68. digitalWrite(2, LOW);
  69. analogWrite(5, (4.5 * 22.5));
  70. digitalWrite(4, HIGH);
  71. analogWrite(6, (4.5 * 22.5));
  72. delay(300);
  73. digitalWrite(2, LOW);
  74. analogWrite(5, 0);
  75. digitalWrite(4, HIGH);
  76. analogWrite(6, 0);
  77. }
  78.  
  79. // Scan left
  80. myservo.write(165);
  81. delay(500);
  82. Left_Distance = checkdistance();
  83.  
  84. // Scan right
  85. myservo.write(15);
  86. delay(500);
  87. Right_Distance = checkdistance();
  88.  
  89. // Center sensor
  90. myservo.write(90);
  91.  
  92. // 3) Decide direction based on left/right distances
  93. if ((D_mix < Left_Distance && Left_Distance < D_max) &&
  94. (D_mix < Right_Distance && Right_Distance < D_max)) {
  95. // Both sides open: turn toward the side with more space
  96. if (Right_Distance > Left_Distance) {
  97. digitalWrite(2, HIGH);
  98. analogWrite(5, (9 * 22.5));
  99. digitalWrite(4, HIGH);
  100. analogWrite(6, (9 * 22.5));
  101. delay(150);
  102. } else {
  103. digitalWrite(2, LOW);
  104. analogWrite(5, (9 * 22.5));
  105. digitalWrite(4, LOW);
  106. analogWrite(6, (9 * 22.5));
  107. delay(150);
  108. }
  109. } else if (D_mix < Left_Distance && Left_Distance < D_max ||
  110. D_mix < Right_Distance && Right_Distance < D_max) {
  111. // Only one side open
  112. if (D_mix < Left_Distance && Left_Distance < D_max) {
  113. digitalWrite(2, LOW);
  114. analogWrite(5, (7 * 22.5));
  115. digitalWrite(4, LOW);
  116. analogWrite(6, (7 * 22.5));
  117. delay(150);
  118. } else if (D_mix < Right_Distance && Right_Distance < D_max) {
  119. digitalWrite(2, HIGH);
  120. analogWrite(5, (7 * 22.5));
  121. digitalWrite(4, HIGH);
  122. analogWrite(6, (7 * 22.5));
  123. delay(150);
  124. }
  125. } else if (Right_Distance < D_mix && Left_Distance < D_mix) {
  126. // Both sides blocked: spin in place
  127. digitalWrite(2, HIGH);
  128. analogWrite(5, 0);
  129. digitalWrite(4, LOW);
  130. analogWrite(6, (9 * 22.5));
  131. delay(250);
  132. digitalWrite(2, LOW);
  133. analogWrite(5, 0);
  134. digitalWrite(4, HIGH);
  135. analogWrite(6, 0);
  136. }
  137.  
  138. // Stop after deciding
  139. digitalWrite(2, LOW);
  140. analogWrite(5, 0);
  141. digitalWrite(4, HIGH);
  142. analogWrite(6, 0);
  143. }
  144.  
  145. // BLE exit check
  146. BLE_value = "";
  147. while (Serial.available() > 0) {
  148. BLE_value = BLE_value + ((char)(Serial.read()));
  149. delay(2);
  150. }
  151. if ('%' == String(BLE_value).charAt(0) && 'Q' == String(BLE_value).charAt(1)) {
  152. Funtion_FLag = false;
  153. digitalWrite(2, LOW);
  154. analogWrite(5, 0);
  155. digitalWrite(4, HIGH);
  156. analogWrite(6, 0);
  157. }
  158. }
  159. }
  160. // ------------------ END UPDATED FUNCTION ------------------
  161.  
  162. void Ultrasonic_Follow() {
  163. Funtion_FLag = true;
  164. while (Funtion_FLag) {
  165. int Infrared_Trigger_Flag = 0;
  166. int Front_Distance = 0;
  167. int Left_Distance = 0;
  168. int Right_Distance = 0;
  169. int Right_IR_Value = 1;
  170. int Left_IR_Value = 1;
  171. Left_IR_Value = digitalRead(A1);
  172. Right_IR_Value = digitalRead(A2);
  173. Front_Distance = checkdistance();
  174. if (Front_Distance < 5 && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  175. digitalWrite(2,LOW);
  176. analogWrite(5,(3 * 25.5));
  177. digitalWrite(4,HIGH);
  178. analogWrite(6,(3 * 25.5));
  179.  
  180. } else if (Front_Distance < 5 && (Left_IR_Value == Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  181. digitalWrite(2,LOW);
  182. analogWrite(5,(4 * 25.5));
  183. digitalWrite(4,HIGH);
  184. analogWrite(6,(0.056 * (4 * 255)));
  185. } else if (Front_Distance < 5 && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value == Infrared_Trigger_Flag)) {
  186. digitalWrite(2,LOW);
  187. analogWrite(5,(0.056 * (4 * 255)));
  188. digitalWrite(4,HIGH);
  189. analogWrite(6,(4 * 25.5));
  190. } else if (Front_Distance < 5 && (Left_IR_Value == Infrared_Trigger_Flag && Right_IR_Value == Infrared_Trigger_Flag)) {
  191. digitalWrite(2,LOW);
  192. analogWrite(5,(3 * 25.5));
  193. digitalWrite(4,HIGH);
  194. analogWrite(6,(3 * 25.5));
  195. } else if (Front_Distance > 10 && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  196. digitalWrite(2,HIGH);
  197. analogWrite(5,(4 * 25.5));
  198. digitalWrite(4,LOW);
  199. analogWrite(6,(4 * 25.5));
  200. } else if (Front_Distance > 10 && (Left_IR_Value == Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  201. digitalWrite(2,LOW);
  202. analogWrite(5,(4 * 25.5));
  203. digitalWrite(4,LOW);
  204. analogWrite(6,(4 * 25.5));
  205. } else if (Front_Distance > 10 && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value == Infrared_Trigger_Flag)) {
  206. digitalWrite(2,HIGH);
  207. analogWrite(5,(4 * 25.5));
  208. digitalWrite(4,HIGH);
  209. analogWrite(6,(4 * 25.5));
  210. } else if ((5 <= Front_Distance && Front_Distance <= 10) && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value == Infrared_Trigger_Flag)) {
  211. digitalWrite(2,HIGH);
  212. analogWrite(5,(4 * 25.5));
  213. digitalWrite(4,LOW);
  214. analogWrite(6,(0.056 * (4 * 25.5)));
  215. } else if ((5 <= Front_Distance && Front_Distance <= 10) && (Left_IR_Value == Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  216. digitalWrite(2,HIGH);
  217. analogWrite(5,(0.056 * (4 * 25.5)));
  218. digitalWrite(4,LOW);
  219. analogWrite(6,(4 * 25.5));
  220. } else if ((5 <= Front_Distance && Front_Distance <= 10) && (Left_IR_Value != Infrared_Trigger_Flag && Right_IR_Value != Infrared_Trigger_Flag)) {
  221. digitalWrite(2,LOW);
  222. analogWrite(5,0);
  223. digitalWrite(4,HIGH);
  224. analogWrite(6,0);
  225. }
  226. BLE_value = "";
  227. while (Serial.available() > 0) {
  228. BLE_value = BLE_value + ((char)(Serial.read()));
  229. delay(2);
  230. }
  231. if ('%' == String(BLE_value).charAt(0) && 'Q' == String(BLE_value).charAt(1)) {
  232. Funtion_FLag = false;
  233. digitalWrite(2,LOW);
  234. analogWrite(5,0);
  235. digitalWrite(4,HIGH);
  236. analogWrite(6,0);
  237.  
  238. }
  239. }
  240. }
  241.  
  242. void Infrared_Tracing() {
  243. Funtion_FLag = true;
  244. int Left_Tra_Value = 1;
  245. int Center_Tra_Value = 1;
  246. int Right_Tra_Value = 1;
  247. int Black = 1;
  248. int white = 0;
  249. while (Funtion_FLag) {
  250. Left_Tra_Value = digitalRead(7);
  251. Right_Tra_Value = digitalRead(9);
  252. if (Left_Tra_Value != Black && Right_Tra_Value != Black) {
  253. digitalWrite(2,HIGH);
  254. analogWrite(5,50);
  255. digitalWrite(4,LOW);
  256. analogWrite(6,50);
  257.  
  258. } else if (Left_Tra_Value == Black && Right_Tra_Value != Black) {
  259. digitalWrite(2,LOW);
  260. analogWrite(5,45);
  261. digitalWrite(4,LOW);
  262. analogWrite(6,45);
  263. } else if (false) {
  264. } else if (false) {
  265. } else if (Left_Tra_Value != Black && Right_Tra_Value == Black) {
  266. digitalWrite(2,HIGH);
  267. analogWrite(5,45);
  268. digitalWrite(4,HIGH);
  269. analogWrite(6,45);
  270. } else if (Left_Tra_Value == Black && Right_Tra_Value == Black) {
  271. digitalWrite(2,LOW);
  272. analogWrite(5,0);
  273. digitalWrite(4,HIGH);
  274. analogWrite(6,0);
  275. } else if (false) {
  276. }
  277. BLE_value = "";
  278. while (Serial.available() > 0) {
  279. BLE_value = BLE_value + ((char)(Serial.read()));
  280. delay(2);
  281. }
  282. if ('%' == String(BLE_value).charAt(0) && 'Q' == String(BLE_value).charAt(1)) {
  283. Funtion_FLag = false;
  284. digitalWrite(2,LOW);
  285. analogWrite(5,0);
  286. digitalWrite(4,HIGH);
  287. analogWrite(6,0);
  288.  
  289. }
  290. }
  291. }
  292.  
  293. float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
  294. {
  295. return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
  296. }
  297.  
  298. void G_Drive() {
  299. Funtion_FLag = true;
  300. while (Funtion_FLag) {
  301. while (Serial.available() > 0) {
  302. G_Bluetooth_value = G_Bluetooth_value + ((char)(Serial.read()));
  303. delay(2);
  304. }
  305. if (0 < String(G_Bluetooth_value).length()) {
  306. Serial.println(G_Bluetooth_value);
  307. G_string_len = String(G_Bluetooth_value).length();
  308. if (7 >= G_string_len && ('@' == String(G_Bluetooth_value).charAt(0) && '#' == String(G_Bluetooth_value).charAt((G_string_len - 2)))) {
  309. G_degree = String(String(G_Bluetooth_value).substring(1,(G_string_len - 2))).toInt();
  310. Serial.println(G_degree);
  311. float value = (BLE_Change_SPEED / 10) * 15;
  312. double d_speed = 0.00;
  313. if (0 <= G_degree && G_degree <= 90) {
  314. d_speed = (mapfloat(G_degree, 0, 90, 0, 1));
  315. digitalWrite(2,HIGH);
  316. analogWrite(5,value);
  317. digitalWrite(4,LOW);
  318. analogWrite(6,(d_speed * value));
  319.  
  320. } else if (90 < G_degree && G_degree <= 180) {
  321. d_speed = (mapfloat(G_degree, 180, 90, 0, 1));
  322. digitalWrite(2,HIGH);
  323. analogWrite(5,(d_speed * value));
  324. digitalWrite(4,LOW);
  325. analogWrite(6,value);
  326. } else if (-180 < G_degree && G_degree <= -90) {
  327. d_speed = (mapfloat(G_degree, (-180), (-90), 0, 1));
  328. digitalWrite(2,LOW);
  329. analogWrite(5,(d_speed * value));
  330. digitalWrite(4,HIGH);
  331. analogWrite(6,value);
  332. } else if (-90 < G_degree && G_degree < 0) {
  333. d_speed = (mapfloat(G_degree, (-90), 0, 1, 0));
  334. digitalWrite(2,LOW);
  335. analogWrite(5,value);
  336. digitalWrite(4,HIGH);
  337. analogWrite(6,(d_speed * value));
  338. }
  339.  
  340. } else if ('%' == String(G_Bluetooth_value).charAt(0) && 'Q' == String(G_Bluetooth_value).charAt(1)) {
  341. Funtion_FLag = false;
  342. digitalWrite(2,LOW);
  343. analogWrite(5,0);
  344. digitalWrite(4,HIGH);
  345. analogWrite(6,0);
  346. } else if ('%' == String(G_Bluetooth_value).charAt(0) && '+' == String(G_Bluetooth_value).charAt((G_string_len - 2))) {
  347. BLE_Change_SPEED = String(String(G_Bluetooth_value).substring(1,(G_string_len - 2))).toInt();
  348. Serial.println(BLE_Change_SPEED);
  349. } else if ('%' == String(G_Bluetooth_value).charAt(0) && '-' == String(G_Bluetooth_value).charAt((G_string_len - 2))) {
  350. BLE_Change_SPEED = String(String(G_Bluetooth_value).substring(1,(G_string_len - 2))).toInt();
  351. Serial.println(BLE_Change_SPEED);
  352. } else if ('%' == String(G_Bluetooth_value).charAt(0) && 'L' == String(G_Bluetooth_value).charAt(1)) {
  353. digitalWrite(2,LOW);
  354. analogWrite(5,((BLE_Change_SPEED / 10) * 22.5));
  355. digitalWrite(4,LOW);
  356. analogWrite(6,((BLE_Change_SPEED / 10) * 22.5));
  357. } else if ('%' == String(G_Bluetooth_value).charAt(0) && 'R' == String(G_Bluetooth_value).charAt(1)) {
  358. digitalWrite(2,HIGH);
  359. analogWrite(5,((BLE_Change_SPEED / 10) * 22.5));
  360. digitalWrite(4,HIGH);
  361. analogWrite(6,((BLE_Change_SPEED / 10) * 22.5));
  362. } else if ('%' == String(G_Bluetooth_value).charAt(0) && 'S' == String(G_Bluetooth_value).charAt(1)) {
  363. digitalWrite(2,LOW);
  364. analogWrite(5,0);
  365. digitalWrite(4,HIGH);
  366. analogWrite(6,0);
  367. } else {
  368. digitalWrite(2,LOW);
  369. analogWrite(5,0);
  370. digitalWrite(4,HIGH);
  371. analogWrite(6,0);
  372.  
  373. }
  374. G_Bluetooth_value = "";
  375.  
  376. }
  377. G_Bluetooth_value = "";
  378. }
  379. }
  380.  
  381. void Light_Seeking() {
  382. Funtion_FLag = true;
  383. while (Funtion_FLag) {
  384. Left_photosensitive = analogRead(A0) / 10;
  385. Right_photosensitive = analogRead(A3) / 10;
  386. if (Left_photosensitive > 55 && Right_photosensitive > 55) {
  387. digitalWrite(2,LOW);
  388. analogWrite(5,0);
  389. digitalWrite(4,HIGH);
  390. analogWrite(6,0);
  391.  
  392. } else {
  393. if (Left_photosensitive > Right_photosensitive) {
  394. Lightseeking_Degree = ((float)(Right_photosensitive / Left_photosensitive)) * 90;
  395. Serial.println("float:");
  396. Serial.println(((float)(Right_photosensitive / Left_photosensitive)));
  397.  
  398. } else if (Left_photosensitive <= Right_photosensitive) {
  399. Lightseeking_Degree = 180 - ((float)(Left_photosensitive / Right_photosensitive)) * 90;
  400. }
  401. if (Lightseeking_Degree <= 90) {
  402. f = ((float)(Lightseeking_Degree)) / 90;
  403. digitalWrite(2,HIGH);
  404. analogWrite(5,speed_value);
  405. digitalWrite(4,LOW);
  406. analogWrite(6,(speed_value * f));
  407.  
  408. }
  409. if (Lightseeking_Degree > 90) {
  410. f = ((float)(180 - Lightseeking_Degree)) / 90;
  411. digitalWrite(2,HIGH);
  412. analogWrite(5,(speed_value * f));
  413. digitalWrite(4,LOW);
  414. analogWrite(6,speed_value);
  415.  
  416. }
  417.  
  418. }
  419. BLE_value = "";
  420. while (Serial.available() > 0) {
  421. BLE_value = BLE_value + ((char)(Serial.read()));
  422. delay(2);
  423. }
  424. if ('%' == String(BLE_value).charAt(0) && 'Q' == String(BLE_value).charAt(1)) {
  425. Funtion_FLag = false;
  426. digitalWrite(2,LOW);
  427. analogWrite(5,0);
  428. digitalWrite(4,HIGH);
  429. analogWrite(6,0);
  430.  
  431. }
  432. }
  433. }
  434.  
  435. void Infraed_Remote() {
  436. Funtion_FLag = true;
  437. while (Funtion_FLag) {
  438. if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_UP) {
  439. digitalWrite(2,HIGH);
  440. analogWrite(5,100);
  441. digitalWrite(4,LOW);
  442. analogWrite(6,100);
  443.  
  444. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_DOWN) {
  445. digitalWrite(2,LOW);
  446. analogWrite(5,100);
  447. digitalWrite(4,HIGH);
  448. analogWrite(6,100);
  449. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_LEFT) {
  450. digitalWrite(2,LOW);
  451. analogWrite(5,50);
  452. digitalWrite(4,LOW);
  453. analogWrite(6,50);
  454. delay(200);
  455. digitalWrite(2,LOW);
  456. analogWrite(5,0);
  457. digitalWrite(4,HIGH);
  458. analogWrite(6,0);
  459. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_RIGHT) {
  460. digitalWrite(2,HIGH);
  461. analogWrite(5,50);
  462. digitalWrite(4,HIGH);
  463. analogWrite(6,50);
  464. delay(200);
  465. digitalWrite(2,LOW);
  466. analogWrite(5,0);
  467. digitalWrite(4,HIGH);
  468. analogWrite(6,0);
  469. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_OK) {
  470. digitalWrite(2,LOW);
  471. analogWrite(5,0);
  472. digitalWrite(4,HIGH);
  473. analogWrite(6,0);
  474. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_1) {
  475. digitalWrite(2,LOW);
  476. analogWrite(5,100);
  477. digitalWrite(4,LOW);
  478. analogWrite(6,100);
  479. } else if (ir.getIrKey(ir.getCode(),1) == IR_KEYCODE_3) {
  480. digitalWrite(2,HIGH);
  481. analogWrite(5,100);
  482. digitalWrite(4,HIGH);
  483. analogWrite(6,100);
  484. }
  485. BLE_value = "";
  486. while (Serial.available() > 0) {
  487. BLE_value = BLE_value + ((char)(Serial.read()));
  488. delay(2);
  489. }
  490. if ('%' == String(BLE_value).charAt(0) && 'Q' == String(BLE_value).charAt(1)) {
  491. Funtion_FLag = false;
  492. digitalWrite(2,LOW);
  493. analogWrite(5,0);
  494. digitalWrite(4,HIGH);
  495. analogWrite(6,0);
  496.  
  497. }
  498. }
  499. }
  500.  
  501. void setup(){
  502. Serial.begin(9600);
  503. BLE_bit_temp = 'a';
  504. BLE_value = "";
  505. G_Bluetooth_value = "";
  506. G_degree = 0;
  507. re_string_len = 0;
  508. IRremote ir(3);
  509.  
  510. Left_photosensitive = 0;
  511. Right_photosensitive = 0;
  512. Lightseeking_Degree = 0;
  513. f = 0;
  514. speed_value = 120;
  515.  
  516. // Distances (cm)
  517. D_mix = 5; // emergency very close
  518. D_mid = 20; // UPDATED: main obstacle distance
  519. D_max = 400;
  520.  
  521. myservo.attach(10);
  522. Funtion_FLag = false;
  523. G_string_len = 0;
  524. BLE_Change_SPEED = 60;
  525. myservo.write(90);
  526. pinMode(A1, INPUT);
  527. pinMode(A2, INPUT);
  528. pinMode(12, OUTPUT);
  529. pinMode(13, INPUT);
  530. pinMode(2, OUTPUT);
  531. pinMode(5, OUTPUT);
  532. pinMode(4, OUTPUT);
  533. pinMode(6, OUTPUT);
  534. pinMode(7, INPUT);
  535. pinMode(8, INPUT);
  536. pinMode(9, INPUT);
  537. pinMode(A0, INPUT);
  538. pinMode(A3, INPUT);
  539. }
  540.  
  541. void loop(){
  542. while (true) {
  543. while (Serial.available() > 0) {
  544. BLE_value = BLE_value + ((char)(Serial.read()));
  545. delay(2);
  546. }
  547. if (0 < String(BLE_value).length()) {
  548. Serial.println(BLE_value);
  549. if (128 > String(BLE_value).length()) {
  550. if ('%' == String(BLE_value).charAt(0) && '#' == String(BLE_value).charAt(2)) {
  551. switch (String(BLE_value).charAt(1)) {
  552. case 'G':
  553. G_Drive();
  554. break;
  555. case 'T':
  556. Infrared_Tracing();
  557. break;
  558. case 'P':
  559. Light_Seeking();
  560. break;
  561. case 'I':
  562. Infraed_Remote();
  563. break;
  564. case 'F':
  565. Ultrasonic_Follow();
  566. break;
  567. case 'A':
  568. Ultrasonic_Avoidance();
  569. break;
  570. }
  571. BLE_value = "";
  572.  
  573. } else {
  574. BLE_value = "";
  575.  
  576. }
  577.  
  578. }
  579. BLE_value = "";
  580.  
  581. }
  582. }
  583. }
  584.  
Advertisement
Add Comment
Please, Sign In to add comment