testprogramm für i2c-servo-board

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
aeschsim
Date:
Sun Apr 16 13:09:35 2017 +0000
Parent:
10:9cd34316bf7d
Child:
12:74b58a9b67fe
Commit message:
add nostop param for getPWM and getPRESCALE - Function

Changed in this revision

board.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/board.cpp	Sun Apr 16 06:30:49 2017 +0000
+++ b/board.cpp	Sun Apr 16 13:09:35 2017 +0000
@@ -102,8 +102,8 @@
     char read = 255;
     char data;
     data = (char)(LED0_OFF_L+(4*servo));
-    i2c.write((ADRESS<<1), &data,1);
-    i2c.read((ADRESS<<1), &read,1);
+    i2c.write((ADRESS<<1), &data, 1, 1);
+    i2c.read((ADRESS<<1), &read, 1, 0);
     printf(">>%x<< read from servo %d\r\n",read,servo);
     return (int)read;
 }
@@ -113,8 +113,8 @@
     char read = 255;
     char data;
     data = (char)(PRESCALE);
-    i2c.write((ADRESS<<1), &data,1);
-    i2c.read((ADRESS<<1), &read,1);
+    i2c.write((ADRESS<<1), &data, 1, 1);
+    i2c.read((ADRESS<<1), &read, 1, 0);
     printf("read Prescale value: >>%x<<\r\n",read);
     return (int)read;
 }
\ No newline at end of file