|
|
@@ -94,8 +94,8 @@ void setup() {
|
|
|
#if defined(HAS_TFT_ILI9163C)
|
|
|
DISPLAY_DEV.begin();
|
|
|
DISPLAY_DEV.setCursor(5, 3);
|
|
|
- DISPLAY_DEV.setTextSize(1);
|
|
|
- DISPLAY_DEV.print(F("p5 merc pump ctrl test"));
|
|
|
+ DISPLAY_DEV.setTextSize(0);
|
|
|
+ DISPLAY_DEV.print(F("p5 pump ctrl test"));
|
|
|
|
|
|
#endif
|
|
|
|
|
|
@@ -112,20 +112,59 @@ void setup() {
|
|
|
|
|
|
#endif
|
|
|
|
|
|
+ #if defined(LM393_InPin)
|
|
|
+ pinMode(LM393_InPin , INPUT); // output of lc circuit as input to arduino
|
|
|
+ pinMode(LM393_OutPin , OUTPUT); // output of arduino to input of lc circuit
|
|
|
+
|
|
|
+ #endif
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+double pulse;
|
|
|
+double frequency;
|
|
|
+double capacitance;
|
|
|
+double uH;
|
|
|
+
|
|
|
|
|
|
// the loop function runs over and over again forever
|
|
|
void loop() {
|
|
|
- //digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
|
|
|
Serial.println(F("L1"));
|
|
|
- delay(1000); // wait for a second
|
|
|
+ delay(1000); // wait for a second
|
|
|
+
|
|
|
+ DISPLAY_DEV.fillRect(80, 20, 80, 60, MAGENTA); //DISPLAY_DEV.width()
|
|
|
+
|
|
|
+
|
|
|
+ digitalWrite(LM393_OutPin, HIGH);
|
|
|
+ delay(5); //time to charge inductor.
|
|
|
+ digitalWrite(LM393_OutPin,LOW);
|
|
|
+ delayMicroseconds(150); //100 //make sure resination is measured
|
|
|
+ // capturing of pulse from lc external ckt
|
|
|
+ pulse = pulseIn(LM393_InPin,HIGH,5000); //checking the High pulse upto 5 msec to measure & returns 0 if timeout
|
|
|
+
|
|
|
+ if(pulse > 0) { //.0001
|
|
|
+ capacitance = 1.E-6;// according schematics definition
|
|
|
+ frequency = 1.E6/(2*pulse);
|
|
|
+ uH = 1000*1./(capacitance*frequency*frequency*4.*3.14159*3.14159);
|
|
|
+ //mH = uH * 1000;
|
|
|
+ DISPLAY_DEV.setCursor(85, 30); //DISPLAY_DEV.print(analogRead(A0));
|
|
|
+ DISPLAY_DEV.print(uH);
|
|
|
+ //display.setCursor(90,10);
|
|
|
+ DISPLAY_DEV.print(" uH");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
DISPLAY_DEV.setTextSize(1);
|
|
|
- DISPLAY_DEV.fillRect(5, 20, 80, 100, MAGENTA); //DISPLAY_DEV.width()
|
|
|
- DISPLAY_DEV.setCursor(10, 30);
|
|
|
-
|
|
|
- DISPLAY_DEV.print(analogRead(A0));
|
|
|
- DISPLAY_DEV.setCursor(10, 50);
|
|
|
- DISPLAY_DEV.print(analogRead(A1));
|
|
|
+ DISPLAY_DEV.setCursor(8, 30);
|
|
|
+ DISPLAY_DEV.print(F("Przepust.%: "));
|
|
|
+ //
|
|
|
+ DISPLAY_DEV.setCursor(8, 50);
|
|
|
+ DISPLAY_DEV.print(F("Ust pompy.%: "));
|
|
|
+ DISPLAY_DEV.setCursor(85, 50); DISPLAY_DEV.print(analogRead(A1));
|
|
|
}
|