Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduino.h>
- #include <Timer.h>
- const int blueled = 13;
- Timer t;
- int8_t everyAlt;
- int8_t everyLaunch;
- void readAltimeter();
- void detectLaunch();
- void setup() {
- everyAlt = t.every(100, readAltimeter);
- everyLaunch = t.every(500, detectLaunch);
- t.oscillate(blueled, 500, HIGH);
- }
- void loop() { }
- void readAltimeter() {
- /*alts[altPlace] = bmp.readAltitude() - zeroAlt;
- altPlace++;
- */
- }
- void detectLaunch() {
- /* tempSpeed = 0;
- int x = 0;
- while (x < 5) {
- tempSpeed += abs((alts[x] - alts[x + 1]) * 10);
- }
- if (tempSpeed / 5 > 5) {
- t.stop(everyLaunch);
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement