Thanks for the hint. Helium is not the problem. I’m already planning to switch the weather station to TTS. My problem is that I’m looking for a sketch and a decoder to operate an anemometer. It is currently running on an Arduino UNO for testing and should then run on a CubeCell.
Who can help me? I’m not a programmer.
Many Thanks
Code:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
const int RecordTime = 3; //Define Measuring Time (Seconds)
const int SensorPin = 3; //Define Interrupt Pin (2 or 3 @ Arduino Uno)
int InterruptCounter;
float WindSpeed;
void setup()
{
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop()
{
meassure();
Serial.print(“Wind Speed: “);
Serial.print(WindSpeed); //Speed in km/h
Serial.print(” km/h - “);
Serial.print(WindSpeed / 3.6); //Speed in m/s
Serial.println(” m/s”);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 10);
display.println(“Wind Speed: “);
display.setCursor(0, 20);
display.println(WindSpeed);
display.setCursor(50, 20);
display.println(” km/h “);
display.setCursor(0, 40);
display.println(WindSpeed / 3.6);
display.setCursor(50, 40);
display.println(” m/s”);
display.display();
}
void meassure() {
InterruptCounter = 0;
attachInterrupt(digitalPinToInterrupt(SensorPin), countup, RISING);
delay(1000 * RecordTime);
detachInterrupt(digitalPinToInterrupt(SensorPin));
WindSpeed = (float)InterruptCounter / (float)RecordTime * 2.4;
}
void countup() {
InterruptCounter++;
}