Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <EYW.h>
- EYW:: Altimeter buzz;//name sensor
- float current_height=0;
- int buttonpin=2;
- int ledpin=4;
- int speakerpin=5;
- int t=3;//number of tones
- int f=880;//frequency
- int d=1000;//duration
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(9600);
- buzz.begin(buttonpin,ledpin,speakerpin);
- buzz.calibrate(100);
- buzz.alarm();
- }
- void loop() {
- // put your main code here, to run repeatedly:
- current_height = buzz.getHeightAvg(20);
- Serial.print("Current_height");
- Serial.println(current_height);
- if (current_height)
- {
- buzz.alarm(6,2000,500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement