// Anemometer test #include #define SENSOR_PIN 2 LiquidCrystal_I2C lcd(0x27,16,2); int pulse = 0; void setup() { lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("COSMOLIGHT"); lcd.setCursor(0, 1); lcd.print("Project Arduino"); pinMode(SENSOR_PIN, INPUT); attachInterrupt(1, pulseCount, RISING); delay(3000); } void pulseCount(void) { pulse = pulse + 1; } void loop() { int countData = pulse; pulse = 0; // data ---> LCD lcd.clear(); lcd.setCursor(0, 0); lcd.print("Pulse count:"); lcd.setCursor(0, 1); lcd.print(countData); delay(1000); }