a.binder 5 gadi atpakaļ
vecāks
revīzija
3d1622e3fa

+ 1 - 1
SE/schema/WPS_Functions/automation_driven/build_automation_driven.xml

@@ -177,7 +177,7 @@
             in="${automation_driven.INSTALL.install_example}"
             out="${automation_driven.temp}/INSTALL.install_example.xsl-test.xml"
             style="${automation_driven.xsl}">
-         <factory name="net.sf.saxon.TransformerFactoryImpl">
+         <factory name="net.sf.saxon.TransformerFactoryImFiring_thresholdpl">
             <attribute name="http://saxon.sf.net/feature/xinclude-aware" value="true"/>
             <attribute name="http://saxon.sf.net/feature/initialMode"
                        value="{http://biuro.biall-net.pl/xmlschema_procesy5/WPS_Functions/automation_driven/automation_driven.xsd}INSTALL.install_example.xsl-test.xml"/>

+ 24 - 4
SE/stuff/p5_neuron/neuron-conf.h

@@ -50,6 +50,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT = 0 ;
     Coordinate_Y_current_max = 30 ; //0
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] =  'A'  ; NEURON_A[NEURON_A_INDEX_NEXT].Label[1] =  '\0'  ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ; 
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ; 
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ; 
@@ -60,6 +62,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT++ ;
     //1 life
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'B' ; NEURON_A[NEURON_A_INDEX_NEXT].Label[1] =  '\0'  ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ;
@@ -70,6 +74,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT ++ ;
     //2
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'C' ; NEURON_A[NEURON_A_INDEX_NEXT].Label[1] =  '\0'  ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ;
@@ -80,6 +86,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT ++ ;
     //3
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'D' ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ;
@@ -90,6 +98,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT++ ;
     //4
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'E' ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ;
@@ -99,6 +109,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT++ ;
     //5
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'F' ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Resistance = 50 ;
@@ -108,6 +120,8 @@ bool NEURON_A_reset() {
     NEURON_A_INDEX_NEXT ++ ;
     //6
     NEURON_A[NEURON_A_INDEX_NEXT].Label[0] = 'S' ;    NEURON_A[NEURON_A_INDEX_NEXT].Label[1] = '\0' ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag = 1 ;
+    NEURON_A[NEURON_A_INDEX_NEXT].Refactory_period__x3A__flag__x3A__until = millis() + 10000 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_used = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].if_modified = 1 ;
     NEURON_A[NEURON_A_INDEX_NEXT].Coordinate_X = DISPLAY_PHYS_A[0].X / 7 * 0 + 15 ;
@@ -116,12 +130,13 @@ bool NEURON_A_reset() {
     NEURON_A[NEURON_A_INDEX_NEXT].if_is_output = 1 ;
 
     NEURON_A_INDEX_NEXT ++ ;
-    //NEURON_A_reset_LOCAL();
+    NEURON_A_reset_LOCAL();
    
     
-  //    NEURON_A_reset_LOCAL();
 }
 
+bool Simulation_attract__x3A__calculate_A_reset() {
+}
 
 bool Current_synapse_A_reset() {
     Current_synapse_A_INDEX_NEXT = 0 ;
@@ -129,11 +144,16 @@ bool Current_synapse_A_reset() {
      Current_synapse_A_reset_LOCAL();
 }
 
-bool set_conf() {
+bool PORT_to_NEURON_A_reset() {
     PORT_to_NEURON_A_INDEX_NEXT = 0 ;
-    
+    PORT_to_NEURON_A_reset_LOCAL() ;
+}
+
+bool set_conf() {
+    NEURON_TO_PORT_A_INDEX_NEXT = 0 ;
     NEURON_A_reset() ;
     Current_synapse_A_reset() ;
+    PORT_to_NEURON_A_reset();
     //   #include "automation_driven.submodule.struct.write_neuron.scenario.h"
 
     

+ 77 - 10
SE/stuff/p5_neuron/p5_neuron.ino

@@ -2,6 +2,8 @@
 #include <Servo.h>
 Servo myservo; 
 
+
+
             
         #define Port7 7 //for TFT_ILI9163C_CSpin 7 
         #define Port8 8 //for TFT_ILI9163C_DCpin 8  
@@ -37,7 +39,6 @@ Servo myservo;
 #include "automation_driven.submodule.struct.write_neuron.h"
 
 
-
     #if defined(HAS_LCD1602_I2C)
         #include <LiquidCrystal_I2C.h>
         LiquidCrystal_I2C lcd(0x27,LCD1602_DISPLAY_PHYSICAL_X_CHARS_A,LCD1602_DISPLAY_PHYSICAL_Y_CHARS_A);
@@ -69,6 +70,36 @@ Servo myservo;
 
 
 
+#if defined(HAS_BH1750)
+    #include <Wire.h> //BH1750 IIC Mode 
+    #include <math.h> 
+    int BH1750address = 0x23; //setting i2c address
+    byte BH1750_buff[2];
+    bool if_BH1750_Init = 0 ;
+    void BH1750_Init(int address) 
+        {
+          Wire.beginTransmission(address);
+          Wire.write(0x10);//1lx reolution 120ms
+          Wire.endTransmission();
+        }
+        
+    int BH1750_Read(int address) //
+        {
+          int i=0;
+          Wire.beginTransmission(address);
+          Wire.requestFrom(address, 2);
+          while(Wire.available()) //
+          {
+            BH1750_buff[i] = Wire.read();  // receive one byte
+            i++;
+          }
+          Wire.endTransmission();  
+          return i;
+        }
+    
+#endif
+
+
 
 
 
@@ -112,9 +143,16 @@ Servo myservo;
 //#include "config_Slave_Ports_LOCAL_init.h"
 #include "automation_driven.submodule.struct.write_neuron_override.h"
 
+
+
+
 #include "neuron-conf.h"
+
+
 #include "config_Slave_Ports_LOCAL_neuron_config.h"  
 
+
+
 #include "neuron_Input_func.h"
 #include "neuron_Stress_func.h"
 #include "neuron_Attract_func.h"
@@ -145,18 +183,27 @@ bool neuron_print_ROTTARY_Coordinate_Y_SHIFT_flag = 0 ;
  #endif
 // bool if_show_p0_neuron_title = 0 ;
 #include "TASK_TYPE_T_Get_Ports_Status_INPUT_A___.h"
+
+
+
 #include "_Slave_Ports_Status_func_add_lite.h"
 
+
 #if Active_ControllerID == 0x14 
     #include "0x14/config_Slave_Ports_LOCAL_0x14_init.h"
+#elif Active_ControllerID == 0x35
+     #include "0x35/config_Slave_Ports_neuron_LOCAL_0x35_init.h"
+
 #elif Active_ControllerID == 0x38
      #include "0x38/config_Slave_Ports_LOCAL_0x38_init.h"
+
 #else
     #error not set  correct Active_ControllerID    
 #endif
 
 
 
+
 #if defined(HAS_W5IOKeypad)
     W5IOKeypad Keypad( W5IOKeypad_PIN_GND, W5IOKeypad_PIN_IO1, W5IOKeypad_PIN_IO2, W5IOKeypad_PIN_IO3, W5IOKeypad_PIN_IO4, W5IOKeypad_PIN_IO5 );
     int IOKey = 0;
@@ -224,10 +271,10 @@ void action_button_input( ) {
 
 
 
-
-
 void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
     Serial.begin(115200);
+    
+    
      lcd.init();                      // Print a message to the LCD.
      lcd.backlight();
      lcd.setCursor(0,0);
@@ -278,18 +325,36 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
     #if defined(HAS_ADKeyboard)
      //   pinMode(ADKeyboard_PIN, INPUT_PULLUP) ; 
     #endif
+    
+    #if defined(HAS_BH1750)
+         Wire.begin();
+    #endif
+    
+  //  pinMode(11, OUTPUT);
+  //  pinMode(13, OUTPUT);
+  //  pinMode(3, OUTPUT);
+  //  pinMode(5, OUTPUT);
+  //  pinMode(A7, OUTPUT);
+  //  pinMode(13, OUTPUT);
+  //  digitalWrite(13,LOW);
+  // pinMode(A6, INPUT) ; 
  }
  
  
- 
- 
+  
  void loop() {
-
-      //  Serial.println(F("L"));
+ 
+    if(NEURON_TO_PORT_A_INDEX_NEXT > NEURON_TO_PORT_A_LIMIT) { SPFTFT2(limit,error,-321); SPFTFT2(value,error, NEURON_TO_PORT_A_INDEX_NEXT - NEURON_TO_PORT_A_LIMIT ) ;}
+    if(PORT_to_NEURON_A_INDEX_NEXT > PORT_to_NEURON_A_LIMIT) { SPFTFT2(limit,error,-322); SPFTFT2(value,error, PORT_to_NEURON_A_INDEX_NEXT - PORT_to_NEURON_A_LIMIT ) ; }
+     // digitalWrite(31,HIGH);
+     // digitalWrite(33,HIGH);
+      //SPFTFT2(level,debug,analogRead(A6));
+                                               
 
                                             
                                              if(triggerCount != triggerCountOld) {
                                                
+                                            
                                                 SPFTFT2(rottary,trigger,triggerCount);
                                                    
                                                 if(triggerCountOld_t < millis()) {
@@ -314,22 +379,25 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
                                         
   //  if(if_show_p0_neuron_title == 0) show_p0_neuron_title() ;
   //  Serial.print(F("R"));
-  
    #if defined(HAS_HCSR04)
     HCSR04_input();
    #endif
   
     neuron_PORT_to_NEURON();
+    
+    
     neuron_Resting_Potenial_input();
     neuron_Resting_Potenial();
+    
+    
   //  Serial.print(F("C"));
     Simulated_potential_show_lcd();
+    
   //  Serial.print(F("P"));
    #if defined(HAS_TFT_HX8357) || defined(HAS_TFT_ILI9163C)
     neuron_print();
    #endif
     TASK_TYPE_T_Get_Ports_Status_INPUT_A___LOOP();
-
     #if defined(HAS_W5IOKeypad)
      //   Serial.print(F("K"));
        IOKey=Keypad.ReadButtons();
@@ -366,5 +434,4 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
                  }
               }
     #endif
-   // delay(100);
  }