a.binder 5 tahun lalu
induk
melakukan
f16001d75a

+ 8 - 4
SE/stuff/p5_neuron/Simulated_potential_show_lcd.h

@@ -6,7 +6,7 @@
 
 
 void show_p0_neuron_title( ) {
-    for(int i=0; i<10;i++) {
+    for(int i=0; i<19;i++) {
         if(NEURON_A[i].if_used == 1 ) {
             lcd.setCursor(i,0);
              lcd.print(NEURON_A[i].Label);
@@ -24,13 +24,12 @@ void Simulated_potential_show_lcd( ) {
 
  if(Simulated_potential_show_lcd_t < millis()) {
         Simulated_potential_show_lcd_t = millis() + Simulated_potential_show_lcd_latency ;
-       show_p0_neuron_title();
        
                
-            for(int i=0; i<10;i++) {
+            for(int i=0; i<19;i++) {
                 if(NEURON_A[i].if_used == 1  ) {
                     lcd.setCursor(i,2);
-                    byte level = (( NEURON_A[i].Simulated_potential - NEURON_A[i].Minimum_voltage ) / ( NEURON_A[i].Firing_threshold -  NEURON_A[i].Minimum_voltage )) * 10 ;
+                    byte level = (( NEURON_A[i].Simulated_potential - NEURON_A[i].Reset_potential ) / ( NEURON_A[i].Firing_threshold -  NEURON_A[i].Reset_potential )) * 10 ;
                     lcd.print(level) ;
                    /* if(NEURON_A[i].Simulated_potential < -80)  lcd.print("0");
                     else if(NEURON_A[i].Simulated_potential < -75)  lcd.print("1");
@@ -54,6 +53,11 @@ void Simulated_potential_show_lcd( ) {
          lcd.print(round(analogRead(AnalogSensorLC_PIN)/10 * AnalogSensorLC_calibrate_ratio)); lcd.print(F(" "));
          lcd.print(round(analogRead(AnalogSensorRC_PIN)/10 * AnalogSensorRC_calibrate_ratio)); lcd.print(F(" "));
          lcd.print(round(analogRead(AnalogSensorRR_PIN)/10 * AnalogSensorRR_calibrate_ratio)); lcd.print(F("    "));
+         
+         show_p0_neuron_title();
+
+         
+         
     }
 
 

+ 10 - 8
SE/stuff/p5_neuron/neuron-conf.h

@@ -6,7 +6,7 @@ bool set_conf() {
     NEURON_A[0].Label = "A" ;
     NEURON_A[0].if_used = 1 ; 
     NEURON_A[0].if_modified = 1 ; 
-    NEURON_A[0].Coordinate_X = DISPLAY_PHYS_A[0].X / 7 * 1 ;
+    NEURON_A[0].Coordinate_X = DISPLAY_PHYS_A[0].X / 7 * 1 + 15 ;
     NEURON_A[0].Coordinate_Y = 10 ;
     NEURON_A[0].Coordinate_Z = 0 ;
     
@@ -52,7 +52,7 @@ bool set_conf() {
     NEURON_A[6].Label = "S" ;
     NEURON_A[6].if_used = 1 ;
     NEURON_A[6].if_modified = 1 ;
-    NEURON_A[6].Coordinate_X = DISPLAY_PHYS_A[0].X / 7 * 0 ;
+    NEURON_A[6].Coordinate_X = DISPLAY_PHYS_A[0].X / 7 * 0 + 15 ;
     NEURON_A[6].Coordinate_Y = 30 ;
     NEURON_A[6].Coordinate_Z = 0 ;
     
@@ -73,14 +73,14 @@ int Current_synapse_A_INDEX_NEXT = 1 ;
 int Coordinate_Y_current_max = 30 ;
 
 
-const int action_button_input_Maximum_current = 7 ;
+const int action_button_input_Maximum_current = 3 ;
 const int action_button_input_Time_constant = 2 ;
 
 const int neuron_Resting_Potenial_latency = 10 ; 
 const int neuron_Resting_Potenial_latency_test_print = 5000 ;
 
 const int neuron_Refactory_period_ratio = 100 ; //to millis 
-const int Current_synapse_A_Delay_ratio = 100 ; //to millis
+//const int Current_synapse_A_Delay_ratio = 100 ; //to millis
 
 
 const int Simulated_potential_show_lcd_latency = 1000 ;
@@ -92,7 +92,9 @@ const int neuron_Resting_Potenial__printed__level = 1 ; //below will not refresh
 
 
 
-#define NEURON_A_LIMIT 20 
-#define Input_A_LIMIT 20 
-#define Current_synapse_A_LIMIT 20 
-#define Simulation_attract__x3A__calculate_A_LIMIT 10
+//#define NEURON_A_LIMIT 20 
+//#define Input_A_LIMIT 20 
+//#define Current_synapse_A_LIMIT 20 
+//#define Simulation_attract__x3A__calculate_A_LIMIT 10
+//#define Slave_Ports_Status_A_LIMIT 8 
+

+ 14 - 0
SE/stuff/p5_neuron/neuron_PCF8574.h

@@ -0,0 +1,14 @@
+
+
+
+void neuron_PCF8574_port_set() {
+    for(int i=0; i<Slave_Ports_Status_A_LIMIT; i++) {
+        if(Slave_Ports_Status_A[i].if_used == 1 and Slave_Ports_Status_A[i].if_modified == 1 ) {
+                
+                #include "_Slave_Ports_I2C_func_PCF8574.h"
+                
+                Slave_Ports_Status_A[i].if_modified = 0 ;
+        }
+    }
+
+}

+ 3 - 1
SE/stuff/p5_neuron/p5_neuron.ino

@@ -142,6 +142,8 @@ void action_button_input( ) {
 }
 
 
+#include "neuron_PCF8574.h"
+
 
 
 void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
@@ -228,7 +230,7 @@ void setup() {  //REMEMBER NOT INITIALIZE ANY VARIABLES OR ARRAYS
          if(IOKey == 0) {
             IOKey_last = IOKey ;
          } else if(IOKey_last == IOKey and IOKey != 0) {
-             Serial.print(F("K")); 
+            // Serial.print(F("K")); 
          } else { 
             IOKey_last = IOKey ;
             Serial.println(IOKey);