Advertisement
Guest User

Untitled

a guest
May 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <EYW.h>
  2.  
  3. EYW:: Altimeter buzz;//name sensor
  4.  
  5.  
  6. float current_height=0;
  7. int buttonpin=2;
  8. int ledpin=4;
  9. int speakerpin=5;
  10.  
  11. int t=3;//number of tones
  12. int f=880;//frequency
  13. int d=1000;//duration
  14.  
  15. void setup() {
  16. // put your setup code here, to run once:
  17. Serial.begin(9600);
  18. buzz.begin(buttonpin,ledpin,speakerpin);
  19. buzz.calibrate(100);
  20. buzz.alarm();
  21. }
  22.  
  23. void loop() {
  24. // put your main code here, to run repeatedly:
  25. current_height = buzz.getHeightAvg(20);
  26. Serial.print("Current_height");
  27. Serial.println(current_height);
  28. if (current_height)
  29. {
  30. buzz.alarm(6,2000,500);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement