Advertisement
Guest User

Untitled

a guest
Feb 8th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <Arduino.h>
  2. #include <Timer.h>
  3.  
  4. const int blueled = 13;
  5.  
  6. Timer t;
  7. int8_t everyAlt;
  8. int8_t everyLaunch;
  9.  
  10. void readAltimeter();
  11. void detectLaunch();
  12. void setup() {
  13.     everyAlt = t.every(100, readAltimeter);
  14.     everyLaunch = t.every(500, detectLaunch);
  15.     t.oscillate(blueled, 500, HIGH);
  16. }
  17.  
  18. void loop() { }
  19.  
  20. void readAltimeter() {
  21.     /*alts[altPlace] = bmp.readAltitude() - zeroAlt;
  22.     altPlace++;
  23.     */
  24. }
  25.  
  26. void detectLaunch() {
  27. /*  tempSpeed = 0;
  28.     int x = 0;
  29.     while (x < 5) {
  30.         tempSpeed += abs((alts[x] - alts[x + 1]) * 10);
  31.     }
  32.     if (tempSpeed / 5 > 5) {
  33.         t.stop(everyLaunch);
  34.     }*/
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement