masaaki makabe / Mbed 2 deprecated KS7

Dependencies:   BLE_API nRF51822 mbed

Fork of KS7 by masaaki makabe

Branch:
KS3
Revision:
29:09406be35ef4
Parent:
28:d8c652994988
Child:
30:f67850cc3cfe
diff -r d8c652994988 -r 09406be35ef4 main.cpp
--- a/main.cpp	Tue Apr 05 12:56:59 2016 +0000
+++ b/main.cpp	Mon May 23 05:11:57 2016 +0000
@@ -223,6 +223,9 @@
     DFUService dfu(ble);
 }
 
+//DigitalOut _reg_ps(P0_1, 1); // 1=normal, 0=power_save
+//DigitalOut _adc_rate(P0_6, 1); // 0=10Hz, 1=80Hz (HX711's RATE pin)
+
 int main()
 {
     float weight_s;
@@ -230,18 +233,13 @@
     int sample = 0;
 #ifdef UART_DEBUG
     pc.baud(UART_BAUD_RATE);
-    /*
-        pc.printf("SPI->PSELSCK  = %x\r\n", NRF_SPI0->PSELSCK);  // will be 15 (P0_15)
-        pc.printf("SPI->PSELMISO = %x\r\n", NRF_SPI0->PSELMISO); // will be 13 (P0_13)
-        pc.printf("SPI->PSELMOSI = %x\r\n", NRF_SPI0->PSELMOSI); // will be 14 (P0_14): dummy
-        pc.printf("SPI->PSELSCK  = %x\r\n", NRF_SPI1->PSELSCK);  // will be 15 (P0_15)
-        pc.printf("SPI->PSELMISO = %x\r\n", NRF_SPI1->PSELMISO); // will be 13 (P0_13)
-        pc.printf("SPI->PSELMOSI = %x\r\n", NRF_SPI1->PSELMOSI); // will be 14 (P0_14): dummy
-        io.analog_pow(1);
-        while(1){
-            pc.printf("%x\r\n", io._get_adc_raw(0));
-        }
-    */
+    // for checking SPI configuration (SPI1 is used_)
+//    pc.printf("SPI->PSELSCK  = %x\r\n", NRF_SPI0->PSELSCK);  // will be 15 (P0_15)
+//    pc.printf("SPI->PSELMISO = %x\r\n", NRF_SPI0->PSELMISO); // will be 13 (P0_13)
+//    pc.printf("SPI->PSELMOSI = %x\r\n", NRF_SPI0->PSELMOSI); // will be 14 (P0_14): dummy
+//    pc.printf("SPI->PSELSCK  = %x\r\n", NRF_SPI1->PSELSCK);  // will be 15 (P0_15)
+//    pc.printf("SPI->PSELMISO = %x\r\n", NRF_SPI1->PSELMISO); // will be 13 (P0_13)
+//    pc.printf("SPI->PSELMOSI = %x\r\n", NRF_SPI1->PSELMOSI); // will be 14 (P0_14): dummy
 #endif
 #ifdef PCB_VER3
     // set XTAL=32MHz for TaiyoYuden's module
@@ -293,7 +291,7 @@
                 break;
             case MODE_ON:
 #ifdef UART_DEBUG
-//                pc.printf("%d %d %.2f\r\n", io.get_switch(), io.get_weight_raw(), io.get_weight());
+                pc.printf("%d %d %.2f\r\n", io.get_switch(), io.get_weight_raw(), io.get_weight());
 #endif
                 io.analog_pow(1);
 #ifdef DISPLAY_DEMO