<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reading and writing to 2 bytes register</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90771/reading-and-writing-to-2-bytes-register</link><description>Hey Nordic&amp;#39;s technical team, 
 I&amp;#39;m trying to write and read via I2C to a component with two bytes registers. I tried the following method: 
 
 Then switched to this one: 
 
 But without success so far. Do you have any idea what is the right way to do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Aug 2022 10:44:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90771/reading-and-writing-to-2-bytes-register" /><item><title>RE: Reading and writing to 2 bytes register</title><link>https://devzone.nordicsemi.com/thread/380807?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 10:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4614d900-d2b0-4812-83b3-a561b3b0e077</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The array variable is a pointer to the first variable in an array.&lt;/p&gt;
&lt;p&gt;Instead of &amp;amp;buf you are supposed to write just buf.&lt;/p&gt;
&lt;p&gt;buf is the same as &amp;amp;buf[0].&lt;/p&gt;
&lt;p&gt;Other than that your code should work (assuming that you have the second register address byte in buf[0] and actual data to write in buf[1]).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Michal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>