proxy 2 pravi

Dependencies:   mbed proxy2 proxy2123

Revision:
5:f266d5aa7338
Parent:
4:6a931904c92a
--- a/main_classic.cpp	Tue Sep 20 11:16:04 2016 +0000
+++ b/main_classic.cpp	Thu Jul 01 20:17:41 2021 +0000
@@ -25,7 +25,14 @@
     bool error;
     uint16_t data[3];
     
-    error = rpr0521_read_data(&data[0]);
+    error = rpr0521_read_data(&data[0],0);
+    if (!error) {
+        pc.printf("PS[%4u], Als0[%4u], Als1[%4u]\n\r", data[0], data[1], data[2]);
+        }
+    else {
+        pc.printf("\n\r");
+        }
+    error = rpr0521_read_data(&data[0],1);
     if (!error) {
         pc.printf("PS[%4u], Als0[%4u], Als1[%4u]\n\r", data[0], data[1], data[2]);
         }
@@ -38,11 +45,15 @@
     pc.printf("\nRPR0521 library test program.\n\r");
     I2CCommonBegin();
 
-    rpr0521_wait_until_found();
+   rpr0521_wait_until_found(0);
     pc.printf("\nSensor found.\n\r");
-    rpr0521_initial_setup();
+    rpr0521_initial_setup(0);
     wait(1);
     
+    rpr0521_wait_until_found(1);
+    pc.printf("\nSensor found.\n\r");
+    rpr0521_initial_setup(1);
+    wait(1);    
     while(1) {
         rpr0521_print_one_value();
         wait(0.1);