2017_hongo_Bteam

Dependents:   DataPool

Revision:
0:31116bc8d4a7
Child:
1:a2572a29fe59
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BetaTransporter.cpp	Fri Aug 18 07:35:50 2017 +0000
@@ -0,0 +1,41 @@
+#include "BetaTransporter.h"
+
+BetaTransporter::BetaTransporter()
+:   pool(),
+    i2c(SDA,SCL)
+{
+    
+}
+
+bool BetaTransporter::set()
+{
+    bool no_error = true;
+    
+    i2c.transport_begin(JUSHINKUN_ADDR, pool.ctrl.all_data, 9);
+    no_error = no_error & i2c.read();
+    i2c.transport_end();
+    
+    /*i2c.transport_begin(APPER_BODY_ADDR, pool.a.all_data, 4);
+    no_error = no_error & i2c.write();
+    i2c.transport_end();
+    
+    i2c.transport_begin(APPER_BODY_ADDR, pool.ar.all_data, 1);
+    no_error = no_error & i2c.read();
+    i2c.transport_end();
+    */
+    
+    pool.up_load();
+    
+    return no_error;
+}
+
+int BetaTransporter::read(int index_num)
+{
+    return pool.data_index[index_num];
+}
+
+void BetaTransporter::reset()
+{
+    pool.reset();
+}
+    
\ No newline at end of file