Guten Tag liebe Community,
ich habe vor mir aus einem Arduino Nano und ein SSD1306 I2C Display einen "Drehzahlmesser" zu bauen. Die Drehzahl möchte ich mit der Frequenz der Stromimpulse messen. (die Frequenz, also 1000-10000 Impulse pro Minute = soll in Umdrehungen pro Minute ausgegeben werden). Die Grundzüge des Programms habe ich mit Visuino erstellt nur leider habe ich jetzt 2 Probleme:
-
Auf dem Display zeigt es mir die Drehzahl in der Frequenz also Impulse pro Sekunde an...kann mir da jemand helfen wie ich dies auf Impulse pro Minute umrechnen kann? Mit multiply Value hab ich es versucht aber da hat es mir dann nichts mehr angezeigt?
-
Das Display zeigt mir die Drehzahl zweizeilig an..also oben die alten und unten wird dann immer die neue zeit, also die Aktualisierung angezeigt. Ich hätte gern aber nur eine Zeile die sich immer aktualisiert. Wie bekomme ich das hin?
Folgend der Code meines bisherigen Programmes:
#define VISUINO_ARDUINO_NANO
#define _MITOV_DISPLAY_SSD1306_I2C
#include <OpenWire.h>
#include <Mitov.h>
#include <Mitov_FormattedSerial.h>
#include <Wire.h>
#include <Mitov_Basic_I2C.h>
#include <Mitov_Display_SSD1306_I2C.h>
#include <GraphicsFont5x7.h>
#include <Mitov_FrequencyMeter.h>
// Arduino Board Declarations
namespace BoardDeclarations
{
Mitov::ArduinoDigitalOutputChannel ArduinoDigitalChannel_11( 11, false );
} // BoardDeclarations
// Declarations
namespace Declarations
{
Mitov::DisplaySSD1306I2C DisplaySSD13061 = Mitov::DisplaySSD1306I2C( 128, 64, Mitov::GraphicsFont5x7 );
Mitov::ArduinoSerialInput<Mitov::DisplaySSD1306I2C, &DisplaySSD13061, float> DisplaySSD13061_InputFloat_1;
Mitov::FrequencyMeter FrequencyMeter1;
} // Declarations
// Type Converters
namespace TypeConverters
{
Mitov::Convert_BinaryToClock Converter0;
} // TypeConverters
//The setup function is called once at startup of the sketch
void setup()
{
Wire.begin();
BoardDeclarations::ArduinoDigitalChannel_11.OutputPin.Connect( TypeConverters::Converter0 );
TypeConverters::Converter0.OutputPin.Connect( Declarations::FrequencyMeter1.InputPin );
analogReference( INTERNAL );
Declarations::DisplaySSD13061.Contrast = 0.91748046875;
Declarations::DisplaySSD13061.Text.Size = 4;
Declarations::DisplaySSD13061.Text.BackgroundColor = Mitov::tmcBlack;
Declarations::FrequencyMeter1.OutputPin.Connect( Declarations::DisplaySSD13061_InputFloat_1.InputPin );
OpenWire::Component::_SystemInit();
}
// The loop function is called in an endless loop
void loop()
{
OpenWire::Component::_SystemLoop();
}
Danke im Voraus!
MFG Robin