summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register
diff options
context:
space:
mode:
authoryash11122017-06-19 05:40:46 +0530
committeryash11122017-06-19 05:40:46 +0530
commit3121a1f5a8203bfd14d46f71930ac5cd22afdf7d (patch)
tree42fc74d21d1506f2e69359f4083e2d17b4328394 /2.3-1/src/c/scilab-arduino/cmd_i2c_write_register
parent02a004ea1500c403ac1a18a52aaf79aaeb7280ed (diff)
downloadScilab2C-3121a1f5a8203bfd14d46f71930ac5cd22afdf7d.tar.gz
Scilab2C-3121a1f5a8203bfd14d46f71930ac5cd22afdf7d.tar.bz2
Scilab2C-3121a1f5a8203bfd14d46f71930ac5cd22afdf7d.zip
1.3 new scilab-arduino functions added2. all functions have been tested on hardware 3. 5 i2c library functions added 4. Now generates code for 27 Boards(arduino and lilypad). 5. New GUI
Diffstat (limited to '2.3-1/src/c/scilab-arduino/cmd_i2c_write_register')
-rw-r--r--2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp
new file mode 100644
index 00000000..63cc7c7a
--- /dev/null
+++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp
@@ -0,0 +1,16 @@
+#include "cmd_i2c_write_register.h"
+#include "Arduino.h"
+#include "Wire.h"
+
+void u8cmd_i2c_write_registers(uint8 address, uint8 reg_adrs, uint8 data)
+{
+
+
+ Wire.beginTransmission(address); //Begins transmission to the device connected to given address
+ Wire.write(reg_adrs); //sets register pointer to reg_adrs position
+ Wire.write(data); //writes given data on reg_adrs position
+ Wire.endTransmission(); //Transmission ends
+
+
+}
+