Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.30 KB | None | 0 0
  1. ////////////////////////////////////////////////////////
  2. //Define libraries
  3. ////////////////////////////////////////////////////////
  4. //The libary section of the code does not need to be altered
  5.  
  6. // The Intel Curie libraries are required for reading sensor values and
  7. // communicating with Bluetooth
  8. #include <CurieBLE.h>
  9. #include <CurieIMU.h>
  10.  
  11. // Servo library is required for sending frequency PWM
  12. // signals to the ESCs.
  13. #include <Servo.h>
  14. #include <math.h>
  15. // BLE library is required to send data to the USB BLE dongle
  16. #include <BLESerial.h>
  17.  
  18. ////////////////////////////////////////////////////////
  19. //Define variables
  20. ////////////////////////////////////////////////////////
  21.  
  22.  
  23. //Variables for interrupt functions
  24. long timerStartThrottle;
  25. long timerStartPitch;
  26. long timerStartRoll;
  27. long timerStartYaw;
  28. long timerStartMotorsOff;
  29.  
  30. volatile long timeThrottle;
  31. volatile long timePitch;
  32. volatile long timeRoll;
  33. volatile long timeYaw;
  34. volatile long timeMotorsOff;
  35.  
  36. //System variables
  37. int serialPrintCounter = 0;
  38. int bluetoothPrintCounter = 0;
  39. long sampleTime;
  40. long sampleTimeOld;
  41. float sampleTimeMillis;
  42.  
  43. //IMU sensor variables
  44. float sensorPitch;
  45. float sensorRoll;
  46. float sensorYaw;
  47. float sensorPitchAngle;
  48. float sensorRollAnge;
  49. float sensorAZ;
  50.  
  51. float gx;
  52. float gy;
  53. float gz;
  54. float ax;
  55. float ay;
  56. float az;
  57.  
  58. int aix, aiy, aiz;
  59. int gix, giy, giz;
  60.  
  61. //Transmitter variables
  62. int addressThrottle = 2;
  63. long transmitterThrottleRaw = 0;
  64. long transmitterThrottleMapped = 0;
  65.  
  66. int addressMotorsOff = 4;
  67. long transmitterMotorsOffRaw = 0;
  68. long transmitterMotorsOffMapped = 0;
  69.  
  70. int addressPitch = 10;
  71. long transmitterPitchRaw = 0;
  72. long transmitterPitchMapped = 0;
  73.  
  74. int addressRoll = 7;
  75. long transmitterRollRaw = 0;
  76. long transmitterRollMapped = 0;
  77.  
  78. int addressYaw = 8;
  79. long transmitterYawRaw = 0;
  80. long transmitterYawMapped = 0;
  81.  
  82. int trigPin = 11;
  83. long UltraTrigger = 0;
  84. int echoPin = 12;
  85. long UltraEcho = 0;
  86.  
  87. //PID variables
  88. float errorPitch;
  89. float errorRoll;
  90. float errorYaw;
  91. float errorAPitch;
  92. float errorARoll;
  93. float errorAYaw;
  94.  
  95. float errorPitchOld = 0;
  96. float errorRollOld = 0;
  97. float errorYawOld = 0;
  98. float errorAPitchOld = 0;
  99. float errorARollOld = 0;
  100. float errorAYawOld = 0;
  101.  
  102. float KpPitch = 0.6;
  103. float KiPitch = 0.000000045;
  104. float KdPitch = 15;
  105.  
  106. float KpRoll = 0.6;
  107. float KiRoll = 0.000000045;
  108. float KdRoll = 15;
  109.  
  110. float KpYaw = 0.3;
  111. float KiYaw = 0;
  112. float KdYaw = 15;
  113.  
  114. float KpPitchAngle = 0;
  115. float KiPitchAngle = 0;
  116. float KdPitchAngle = 0;
  117.  
  118. float KpRollAngle = 0;
  119. float KiRollAngle = 0;
  120. float KdRollAngle = 0;
  121.  
  122. float KpYawAngle = 0;
  123. float KiYawAngle = 0;
  124. float KdYawAngle = 0;
  125.  
  126. float integralPitch = 0;
  127. float integralRoll = 0;
  128. float integralYaw = 0;
  129.  
  130. float derivativePitch;
  131. float derivativeRoll;
  132. float derivativeYaw;
  133.  
  134. float derivativePitchMean = 0;
  135. float derivativeRollMean = 0;
  136. float derivativeYawMean = 0;
  137.  
  138. float filterFactorDPart = 50;
  139.  
  140. float PpartPitch;
  141. float PpartRoll;
  142. float PpartYaw;
  143. float IpartPitch;
  144. float IpartRoll;
  145. float IpartYaw;
  146. float DpartPitch;
  147. float DpartRoll;
  148. float DpartYaw;
  149. float PpartPitchAngle;
  150. float PpartRollAngle;
  151. float PpartYawAngle;
  152. float IpartPitchAngle;
  153. float IpartRollAngle;
  154. float IpartYawAngle;
  155. float DpartPitchAngle;
  156. float DpartRollAngle;
  157. float DpartYawAngle;
  158.  
  159. float AccelerationF;
  160. float AccelerationN;
  161. float AccelerationS;
  162.  
  163. float RootofAS_AN;
  164. float AS_AN;
  165.  
  166.  
  167. float PIDPitch;
  168. float PIDRoll;
  169. float PIDYaw;
  170. float PIDPitchAngle;
  171. float PIDRollAngle;
  172. float PIDYawAngle;
  173.  
  174. float duration;
  175. float distance;
  176.  
  177. //Motor control variables
  178. int controlSignalRightFront;
  179. int controlSignalLeftFront;
  180. int controlSignalRightBack;
  181. int controlSignalLeftBack;
  182.  
  183. int motorsoff = 1000;
  184.  
  185. Servo ESCRightFront;
  186. Servo ESCLeftFront;
  187. Servo ESCRightBack;
  188. Servo ESCLeftBack;
  189.  
  190. ////////////////////////////////////////////////////////
  191. //Functions for handling interrupts
  192. ////////////////////////////////////////////////////////
  193.  
  194. //Interrupts for the receiver channels are triggered by change of
  195. //input value. On change these functions are executed:
  196.  
  197. void interruptThrottle() {
  198. //Scan input to start or stop timer
  199. if (digitalRead(addressThrottle) == HIGH) {
  200. //Start timer (save current time)
  201. timerStartThrottle = micros();
  202. }
  203. else {
  204. //Stop timer (compare current time to saved time)
  205. timeThrottle = micros() - timerStartThrottle;
  206.  
  207.  
  208. }
  209. }
  210.  
  211. void interruptPitch() {
  212. if (digitalRead(addressPitch) == HIGH) {
  213. timerStartPitch = micros();
  214. }
  215. else {
  216. timePitch = micros() - timerStartPitch;
  217. }
  218. }
  219.  
  220. void interruptRoll() {
  221. if (digitalRead(addressRoll) == HIGH) {
  222. timerStartRoll = micros();
  223. }
  224. else {
  225. timeRoll = micros() - timerStartRoll;
  226. }
  227. }
  228.  
  229. void interruptYaw() {
  230. if (digitalRead(addressYaw) == HIGH) {
  231. timerStartYaw = micros();
  232. }
  233. else {
  234. timeYaw = micros() - timerStartYaw;
  235. }
  236. }
  237. void interruptMotorsOff() {
  238. if (digitalRead(addressMotorsOff) == HIGH) {
  239. timerStartMotorsOff = micros();
  240. }
  241. else {
  242. timeMotorsOff = micros() - timerStartMotorsOff;
  243. }
  244. }
  245.  
  246. void setup()
  247. {
  248.  
  249. //Code in setup() function will only execute once, when power is supplied to
  250. //the CPU, when restarted or when new firmware is loaded
  251.  
  252. ////////////////////////////////////////////////////////
  253. //System setup
  254. ////////////////////////////////////////////////////////
  255.  
  256. Serial.begin(57600); // Start serial communication (with computer) at 57600 bps
  257.  
  258. sampleTimeOld = micros();
  259.  
  260. /* BLESerial.setName("Bluno101");
  261. BLESerial.begin();
  262.  
  263. while(!BLESerial); */
  264.  
  265. ////////////////////////////////////////////////////////
  266. //Initiate interrupts for receiver
  267. ////////////////////////////////////////////////////////
  268. attachInterrupt(addressThrottle, interruptThrottle, CHANGE);
  269. attachInterrupt(addressPitch, interruptPitch, CHANGE);
  270. attachInterrupt(addressRoll, interruptRoll, CHANGE);
  271. attachInterrupt(addressYaw, interruptYaw, CHANGE);
  272. attachInterrupt(addressMotorsOff, interruptMotorsOff, CHANGE);
  273.  
  274. ////////////////////////////////////////////////////////
  275. //Initiate the IMU sensor
  276. ////////////////////////////////////////////////////////
  277.  
  278. // start the IMU and filter
  279. CurieIMU.begin();
  280. // Set the gyro range in degrees/second
  281. CurieIMU.setGyroRange(250);
  282. // Set the accelerometer range in G
  283. CurieIMU.setAccelerometerRange(2);
  284.  
  285. ////////////////////////////////////////////////////////
  286. //Initiate the ESCs
  287. ////////////////////////////////////////////////////////
  288.  
  289. //Declare the address (pin) of the ESCs
  290. ESCRightFront.attach(3);
  291. ESCRightBack.attach(5);
  292. ESCLeftFront.attach(9);
  293. ESCLeftBack.attach(6);
  294.  
  295. //Start with zero speed command to the ESCs
  296.  
  297. ESCRightFront.writeMicroseconds(1000);
  298. ESCRightBack.writeMicroseconds(1000);
  299. ESCLeftFront.writeMicroseconds(1000);
  300. ESCLeftBack.writeMicroseconds(1000);
  301.  
  302. //setup pins for ultrasonic sensor
  303. pinMode(trigPin, OUTPUT);
  304. pinMode(echoPin, INPUT);
  305.  
  306.  
  307. }
  308.  
  309. void loop()
  310. {
  311. //Code in loop() function will execute repeatedly for as long as the CPU has power
  312.  
  313. ////////////////////////////////////////////////////////
  314. //System update
  315. ////////////////////////////////////////////////////////
  316.  
  317. serialPrintCounter++;
  318. //bluetoothPrintCounter++;
  319.  
  320. sampleTime = micros() - sampleTimeOld;
  321. sampleTimeMillis = (float) sampleTime / 1000;
  322. sampleTimeOld = micros();
  323.  
  324. /* if (BLESerial.operator bool() == true) {
  325. digitalWrite(13, HIGH);
  326. } */
  327.  
  328. ////////////////////////////////////////////////////////
  329. //Read the sensor values
  330. ////////////////////////////////////////////////////////
  331. CurieIMU.readGyroScaled(gx, gy, gz);
  332. CurieIMU.readAccelerometerScaled(ax, ay, az);
  333. ////////////////////////////////////////////////////////
  334. //Interpret and calibrate sensor values
  335. ////////////////////////////////////////////////////////
  336.  
  337. AccelerationF = pow(ax, 2);
  338. AccelerationS = pow(ay, 2);
  339. AccelerationN = pow(az, 2);
  340. AS_AN = (AccelerationS - AccelerationN);
  341.  
  342.  
  343. RootofAS_AN = sqrt(AS_AN);
  344.  
  345. sensorPitch = 0.24 + gy;
  346. sensorRoll = 0.52 + gx;
  347. sensorYaw = 0.36 - gz;
  348. sensorPitchAngle = atan2 (AccelerationF, RootofAS_AN);
  349. // sensorRollAngle = ;
  350. sensorAZ = az;
  351.  
  352. ////////////////////////////////////////////////////////
  353. //Read transmitter values
  354. ////////////////////////////////////////////////////////
  355.  
  356. noInterrupts();
  357. transmitterThrottleRaw = timeThrottle;
  358. transmitterPitchRaw = timePitch;
  359. transmitterRollRaw = timeRoll;
  360. transmitterYawRaw = timeYaw;
  361. transmitterMotorsOffRaw = timeMotorsOff;
  362. interrupts();
  363.  
  364.  
  365. //Ultrasonic sensor range
  366. /*
  367. digitalWrite(trigPin, LOW);
  368.  
  369. digitalWrite(trigPin, HIGH);
  370.  
  371. digitalWrite(trigPin, LOW);
  372.  
  373. duration = pulseIn(echoPin, HIGH);
  374. distance = (duration / 2) * 0.0344 - 1;
  375. */
  376. ////////////////////////////////////////////////////////
  377. //Transmitter value mapping
  378. ////////////////////////////////////////////////////////
  379.  
  380. transmitterThrottleMapped = map(transmitterThrottleRaw, 980, 1640, 1000, 1600);
  381. transmitterPitchMapped = map(transmitterPitchRaw, 1230, 1670, -30 , 30);
  382. transmitterRollMapped = map(transmitterRollRaw, 1310, 1733 ,-30 , 30);
  383. transmitterYawMapped = map(transmitterYawRaw, 1330, 1736, -90 , 90);
  384. transmitterMotorsOffMapped = map(transmitterMotorsOffRaw, 981, 1960, 0 , 1);
  385. ////////////////////////////////////////////////////////
  386. //PID regulators
  387. ////////////////////////////////////////////////////////
  388.  
  389. //Regulator errors
  390. errorPitch = transmitterPitchMapped - sensorPitch; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  391. errorYaw = transmitterYawMapped - sensorYaw; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  392. errorRoll = transmitterRollMapped - sensorRoll; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  393. /*
  394. * errorPitchAngle = transmitterPitchMapped - sensorPitchAngle;
  395. * errorRollAngle = transmitterRollMapped - sensorRollAngle;
  396. errorPitch = sensorPitch - transmitterPitchMapped; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  397. errorYaw = sensorYaw - transmitterYawMapped; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  398. errorRoll = sensorRoll - transmitterRollMapped; // r(Referenssignal - y(Mätsignal)= e(Reglerfel)
  399. */
  400. /////////////////////////////
  401. //P part
  402. /////////////////////////////
  403.  
  404. PpartPitch = KpPitch * errorPitch;
  405. PpartYaw = KpYaw * errorYaw;
  406. PpartRoll = KpRoll * errorRoll;
  407. /////////////////////////////
  408. //I part
  409. /////////////////////////////
  410.  
  411. //Update integrals
  412. integralPitch = integralPitch + (errorPitch * sampleTimeMillis);
  413. integralRoll = integralRoll + (errorRoll * sampleTimeMillis);
  414. integralYaw = integralYaw + (errorYaw * sampleTimeMillis);
  415.  
  416. IpartPitch = KiPitch * integralPitch;
  417. IpartRoll = KiRoll * integralRoll;
  418. IpartYaw = KiYaw * integralYaw;
  419. //Reset integrals
  420.  
  421. if (transmitterThrottleMapped < 1100) {
  422. integralPitch = 0;
  423. integralRoll = 0;
  424. integralYaw = 0;
  425. }
  426.  
  427. /////////////////////////////
  428. //D part
  429. /////////////////////////////
  430.  
  431. derivativePitch = (errorPitch - errorPitchOld) / sampleTimeMillis;
  432. derivativeRoll = (errorRoll - errorRollOld) / sampleTimeMillis;
  433. derivativeYaw = (errorYaw - errorYawOld) / sampleTimeMillis;
  434.  
  435. //Filter D-part
  436.  
  437. derivativePitchMean = ((derivativePitchMean * (filterFactorDPart - 1) + derivativePitch) / filterFactorDPart);
  438. derivativeRollMean = ((derivativeRollMean * (filterFactorDPart - 1) + derivativeRoll) / filterFactorDPart);
  439. derivativeYawMean = ((derivativeYawMean * (filterFactorDPart - 1) + derivativeYaw) / filterFactorDPart);
  440.  
  441. DpartPitch = KdPitch * derivativePitchMean;
  442. DpartRoll = KdRoll * derivativeRollMean;
  443. DpartYaw = KdPitch * derivativeYawMean;
  444.  
  445.  
  446. //Save error for next iteration
  447.  
  448. errorPitchOld = errorPitch;
  449. errorRollOld = errorRoll;
  450. errorYawOld = errorYaw;
  451. /////////////////////////////
  452. //Update regulators
  453. /////////////////////////////
  454.  
  455. PIDPitch = PpartPitch + IpartPitch + DpartPitch;
  456. PIDRoll = PpartRoll + IpartRoll + DpartRoll;
  457. PIDYaw = PpartYaw + IpartYaw + DpartYaw;
  458.  
  459. ////////////////////////////////////////////////////////
  460. //Control signals
  461. ////////////////////////////////////////////////////////
  462. /*
  463. controlSignalRightFront = transmitterThrottleMapped + PIDPitch + PIDRoll - PIDYaw; // front right
  464. controlSignalLeftFront = transmitterThrottleMapped + PIDPitch - PIDRoll + PIDYaw; // front left
  465. controlSignalLeftBack = transmitterThrottleMapped - PIDPitch - PIDRoll - PIDYaw; // back left
  466. controlSignalRightBack = transmitterThrottleMapped - PIDPitch + PIDRoll + PIDYaw; // back right
  467. */
  468.  
  469. controlSignalLeftBack = transmitterThrottleMapped + PIDPitch + PIDRoll + PIDYaw; // Left back
  470. controlSignalRightBack = transmitterThrottleMapped + PIDPitch - PIDRoll - PIDYaw; // Right back
  471. controlSignalRightFront = transmitterThrottleMapped - PIDPitch - PIDRoll + PIDYaw; // Right front
  472. controlSignalLeftFront = transmitterThrottleMapped - PIDPitch + PIDRoll - PIDYaw; // Left front
  473.  
  474. /*
  475. controlSignalLeftFront = transmitterThrottleMapped + PIDPitch + PIDRoll - PIDYaw; // Left back
  476. controlSignalRightFront = transmitterThrottleMapped + PIDPitch - PIDRoll + PIDYaw; // Right back
  477. controlSignalRightBack = transmitterThrottleMapped - PIDPitch - PIDRoll - PIDYaw; // Right front
  478. controlSignalLeftBack = transmitterThrottleMapped - PIDPitch + PIDRoll + PIDYaw; // Left front
  479. */
  480.  
  481. ////////////////////////////////////////////////////////
  482. //Control signal saturation check
  483. ////////////////////////////////////////////////////////
  484.  
  485. // if (controlSignalRightFront > 1000) {
  486.  
  487. // }
  488. //else if
  489.  
  490. ////////////////////////////////////////////////////////
  491. //Throttle safety function
  492. ////////////////////////////////////////////////////////
  493.  
  494. //Specify a safety limit where all motors are stopped
  495. if (transmitterMotorsOffMapped == 1) {
  496.  
  497. ////////////////////////////////////////////////////////
  498. //ESC control signal write
  499. ////////////////////////////////////////////////////////
  500.  
  501. ESCRightFront.writeMicroseconds(controlSignalRightFront);
  502. ESCLeftFront.writeMicroseconds(controlSignalLeftFront);
  503. ESCLeftBack.writeMicroseconds(controlSignalLeftBack);
  504. ESCRightBack.writeMicroseconds(controlSignalRightBack);
  505. }
  506. else {
  507. ESCRightFront.writeMicroseconds(1000);
  508. ESCLeftFront.writeMicroseconds(1000);
  509. ESCLeftBack.writeMicroseconds(1000);
  510. ESCRightBack.writeMicroseconds(1000);
  511.  
  512. }
  513. ////////////////////////////////////////////////////////
  514. //Print signal values
  515. ////////////////////////////////////////////////////////
  516. /* if (distance >= 400 || distance <= 0){
  517. Serial.print("Distance = ");
  518. Serial.println("Out of range");
  519. }
  520. else {
  521. Serial.print("Distance = ");
  522. Serial.print(distance);
  523. Serial.println(" cm");
  524. }
  525.  
  526. */
  527.  
  528. if (serialPrintCounter == 999) {
  529. /*
  530. Serial.print("G: ");
  531. Serial.print(gx);
  532. Serial.print(", ");
  533. Serial.print(gy);
  534. Serial.print(", ");
  535. Serial.println(gz);
  536. Serial.print("A: ");
  537. Serial.print(ax);
  538. Serial.print(", ");
  539. Serial.print(ay);
  540. Serial.print(", ");
  541. Serial.println(az);
  542. Serial.print("Orientation: ");
  543. Serial.print(heading);
  544. Serial.print(" ");
  545. Serial.print(pitch);
  546. Serial.print(" ");
  547. Serial.println(roll);
  548. Serial.print("IMU Pitch: ");
  549. Serial.println(sensorPitch);
  550. Serial.print("IMU Roll: ");
  551. Serial.println(sensorRoll);
  552. Serial.print("IMU Yaw: ");
  553. Serial.println(sensorYaw);
  554. Serial.print("Transmitter Throttle: ");
  555. Serial.print(transmitterThrottleRaw);
  556. Serial.println(", ");
  557. Serial.println(transmitterThrottleMapped);
  558. Serial.print("Transmitter Pitch: ");
  559. Serial.print(transmitterPitchRaw);
  560. Serial.print(", ");
  561. Serial.println(transmitterPitchMapped);
  562. Serial.print("Transmitter Roll: ");
  563. Serial.print(transmitterRollRaw);
  564. Serial.print(", ");
  565. Serial.println(transmitterRollMapped);
  566. Serial.print("Transmitter Yaw: ");
  567. Serial.print(transmitterYawRaw);
  568. Serial.print(", ");
  569. Serial.println(transmitterYawMapped);
  570. Serial.print("PID Pitch: ");
  571. Serial.print(errorPitch);
  572. Serial.print(", ");
  573. Serial.print(PpartPitch);
  574. Serial.print(", ");
  575. Serial.print(IpartPitch);
  576. Serial.print(", ");
  577. Serial.print(DpartPitch);
  578. Serial.print(", ");
  579. Serial.println(PIDPitch);
  580. Serial.print("PID Roll: ");
  581. Serial.print(errorRoll);
  582. Serial.print(", ");
  583. Serial.print(PpartRoll);
  584. Serial.print(", ");
  585. Serial.print(IpartRoll);
  586. Serial.print(", ");
  587. Serial.print(DpartRoll);
  588. Serial.print(", ");
  589. Serial.println(PIDRoll);
  590. Serial.print("PID Yaw: ");
  591. Serial.print(errorYaw);
  592. Serial.print(", ");
  593. Serial.print(PpartYaw);
  594. Serial.print(", ");
  595. Serial.print(IpartYaw);
  596. Serial.print(", ");
  597. Serial.print(DpartYaw);
  598. Serial.print(", ");
  599. Serial.println(PIDYaw);
  600. Serial.print("Control Signals: ");
  601. Serial.print(controlSignalRightFront);
  602. Serial.print(", ");
  603. Serial.print(controlSignalLeftFront);
  604. Serial.print(", ");
  605. Serial.print(controlSignalRightBack);
  606. Serial.print(", ");
  607. Serial.println(controlSignalLeftBack);
  608. Serial.print("Sample Time: ");
  609. Serial.println(sampleTimeMillis);
  610. Serial.println(transmitterMotorsOffMapped);
  611. Serial.print("");
  612. Serial.print("a:\t");
  613. Serial.print(ax);
  614. Serial.print("\t");
  615. Serial.print(ay);
  616. Serial.print("\t");
  617. Serial.print(az);
  618. Serial.println();
  619. */ Serial.print(sensorPitchAngle);
  620. Serial.println(""); /*
  621. */
  622. serialPrintCounter = 0;
  623. }
  624.  
  625. ////////////////////////////////////////////////////////
  626. //Collect bluetooth data for PID parameter analyzing
  627. ////////////////////////////////////////////////////////
  628.  
  629. /* if (bluetoothPrintCounter == 200 && BLESerial.operator bool() == true) {
  630.  
  631. BLESerial.print(transmitterPitchMapped);
  632. BLESerial.print(" ");
  633. BLESerial.print(sensorPitch);
  634. BLESerial.print(" ");
  635. BLESerial.print(errorPitch);
  636. BLESerial.print(" ");
  637. BLESerial.print(PpartPitch);
  638. BLESerial.print(" ");
  639. BLESerial.print(IpartPitch);
  640. BLESerial.print(" ");
  641. BLESerial.print(DpartPitch);
  642. BLESerial.print(" ");
  643. BLESerial.print(PIDPitch);
  644. BLESerial.print(" ");
  645. BLESerial.print(transmitterRollMapped);
  646. BLESerial.print(" ");
  647. BLESerial.print(sensorRoll);
  648. BLESerial.print(" ");
  649. BLESerial.print(errorRoll);
  650. BLESerial.print(" ");
  651. BLESerial.print(PpartRoll);
  652. BLESerial.print(" ");
  653. BLESerial.print(IpartRoll);
  654. BLESerial.print(" ");
  655. BLESerial.print(DpartRoll);
  656. BLESerial.print(" ");
  657. BLESerial.print(PIDRoll);
  658. BLESerial.print(" ");
  659. BLESerial.print(transmitterYawMapped);
  660. BLESerial.print(" ");
  661. BLESerial.print(sensorYaw);
  662. BLESerial.print(" ");
  663. BLESerial.print(errorYaw);
  664. BLESerial.print(" ");
  665. BLESerial.print(PpartYaw);
  666. BLESerial.print(" ");
  667. BLESerial.print(IpartYaw);
  668. BLESerial.print(" ");
  669. BLESerial.print(DpartYaw);
  670. BLESerial.print(" ");
  671. BLESerial.print(PIDYaw);
  672.  
  673. BLESerial.println();
  674.  
  675. bluetoothPrintCounter = 0;
  676.  
  677. }
  678. */
  679.  
  680. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement