a.binder 4 anni fa
parent
commit
8899890923

+ 4 - 4
SE/stuff/P5_Automation_can-dev-res-working-1930/P5_Automation_can-dev-res-working-1930.ino

@@ -269,7 +269,7 @@ const int DISPLAY_MENU_A__PROGMEM_CONSOLE_PRINT = 3 ;
 
 
 #if defined(HAS__PCINT_setup)
-    #include "_PCINT/_PCINT_struct.h"  //pins MYPIN1 MYPIN2 MYPIN3
+    #include "_PCINT_struct.h"  //pins MYPIN1 MYPIN2 MYPIN3
 #endif
 
 
@@ -425,7 +425,7 @@ const int DISPLAY_MENU_A__PROGMEM_CONSOLE_PRINT = 3 ;
 #endif
 
 #if defined(HAS__PCINT_setup)
-     #include "_PCINT/_PCINT_init.h"
+     #include "_PCINT_init.h"
 #endif
 
 #include "config_Slave_Ports_LOCAL_init.h"
@@ -471,7 +471,7 @@ ARDUINO_SETUP_DEF_T HAS_ROTTARY_SW_A = false;
 
 
 #if defined(HAS__PCINT_setup)
-    #include "_PCINT/_PCINT_setup.h" //empty
+    #include "_PCINT_setup.h" //empty
 #endif
 
 
@@ -587,5 +587,5 @@ void loop() {
 
 
 
-#include "_PCINT/_PCINT_func_loop.h" //todo empty implement display etc
+#include "_PCINT_func_loop.h" //todo empty implement display etc
 #include "_Slave_Ports_func_loop.h" //todo implement

+ 2 - 1
SE/stuff/P5_Automation_can-dev-res-working-1930/___CONFIG/config_Active_ControllerID.h

@@ -9,7 +9,8 @@ EEPROM.get( EEPROM_Active_ControllerID_addr, EEPROM_Active_ControllerID_read );
 */
 //#define Active_ControllerID 0x13
 //#define Active_ControllerID 0x11
-#define Active_ControllerID 0x35
+//#define Active_ControllerID 0x35
+#define Active_ControllerID 0x45   //sterownik ploter male mega
 
 
 //if(EEPROM_Active_ControllerID_read > 0 ) //{

+ 49 - 10
SE/stuff/P5_Automation_can-dev-res-working-1930/___SUBMODULES___/merc_pump_ctrl/merc_pump_ctrl.ino

@@ -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));
 }