rainbow

Dependencies:   mbed FastPWM

Files at this revision

API Documentation at this revision

Comitter:
Lightvalve
Date:
Fri Jun 25 12:21:04 2021 +0000
Parent:
235:c831718303c9
Child:
237:c2cfe349f5c1
Commit message:
210625

Changed in this revision

function_utilities/function_utilities.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/function_utilities/function_utilities.cpp	Mon Jun 14 10:36:29 2021 +0000
+++ b/function_utilities/function_utilities.cpp	Fri Jun 25 12:21:04 2021 +0000
@@ -398,7 +398,6 @@
 void ROM_CALL_DATA(void)
 {
     BNO = spi_eeprom_read(RID_BNO);
-//    BNO = 11;
     OPERATING_MODE = spi_eeprom_read(RID_OPERATING_MODE);
     SENSING_MODE = spi_eeprom_read(RID_SENSING_MODE);
     CURRENT_CONTROL_MODE = spi_eeprom_read(RID_CURRENT_CONTROL_MODE);
@@ -439,9 +438,7 @@
     ENC_PULSE_PER_POSITION = (float) (spi_eeprom_read(RID_ENC_PULSE_PER_POSITION));
     TORQUE_SENSOR_PULSE_PER_TORQUE = (float) (spi_eeprom_read(RID_TORQUE_SENSOR_PULSE_PER_TORQUE)) * 0.01f;
     PRES_SENSOR_A_PULSE_PER_BAR = (float) (spi_eeprom_read(RID_PRES_SENSOR_A_PULSE_PER_BAR)) * 0.01f;
-//    PRES_SENSOR_A_PULSE_PER_BAR = 4096.0f * 946.0f / 3.3f / 300.0f / 210.0f;
     PRES_SENSOR_B_PULSE_PER_BAR = (float) (spi_eeprom_read(RID_PRES_SENSOR_B_PULSE_PER_BAR)) * 0.01f;
-//    PRES_SENSOR_B_PULSE_PER_BAR = 4096.0f * 946.0f / 3.3f / 300.0f / 210.0f;
     FRICTION = (float) (spi_eeprom_read(RID_FRICTION)) * 0.1f;
     HOMEPOS_OFFSET = spi_eeprom_read(RID_HOMEPOS_OFFSET);
     HOMEPOS_VALVE_OPENING = spi_eeprom_read(RID_HOMEPOS_VALVE_OPENING);
--- a/main.cpp	Mon Jun 14 10:36:29 2021 +0000
+++ b/main.cpp	Fri Jun 25 12:21:04 2021 +0000
@@ -215,11 +215,11 @@
     pc.baud(9600);
 
     // i2c init
-//    i2c.frequency(400 * 1000);          // 0.4 mHz
-//    wait_ms(2);                         // Power Up wait
-//    look_for_hardware_i2c();            // Hardware present
-//    init_as5510(i2c_slave_addr1);
-//    make_delay();
+    i2c.frequency(400 * 1000);          // 0.4 mHz
+    wait_ms(2);                         // Power Up wait
+    look_for_hardware_i2c();            // Hardware present
+    init_as5510(i2c_slave_addr1);
+    make_delay();
 
     // spi init
     eeprom_cs = 1;
@@ -310,10 +310,10 @@
 //        timer_while ++;
 
         //i2c for SW valve
-        //if(OPERATING_MODE == 5) {
-//            read_field(i2c_slave_addr1);
-//            if(DIR_VALVE_ENC < 0) value = 1023 - value;
-//        }
+        if(OPERATING_MODE == 5) {
+            read_field(i2c_slave_addr1);
+            if(DIR_VALVE_ENC < 0) value = 1023 - value;
+        }
     }
 }