<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hukkuramamemoti</author_name>
  <author_url>https://blog.hatena.ne.jp/hukkuramamemoti/</author_url>
  <blog_title>俺言語。</blog_title>
  <blog_url>https://oregengo.hatenablog.com/</blog_url>
  <categories>
    <anon>C</anon>
    <anon>Arduino</anon>
  </categories>
  <description>例えば65535(0xFFFF)のような2byteのデータをシリアル通信で送信する場合、1) 文字列のまま送る→ 0x54 0x53 0x53 0x51 0x53 で5byte必要 2) バイナリデータで送信 → 0xFF 0xFF で2byteとバイナリデータで送信する方が効率がよい．2byteデータをバイナリデータで送信する場合は上位byteと下位byteに分けて送信する必要があるため，ビットシフトなどを使って uint8_t b[2]; b[0] = 65535 &gt;&gt; 8 b[1] = 65535 - (b[0]&lt;&lt;8) // そのまま65535を代入しても上位8bit分は自動的に削られ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Foregengo.hatenablog.com%2Fentry%2F2022%2F05%2F05%2F160726&quot; title=&quot;【C】2byte以上のデータを1byteずつ送信する方法 - 俺言語。&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-05-05 16:07:26</published>
  <title>【C】2byte以上のデータを1byteずつ送信する方法</title>
  <type>rich</type>
  <url>https://oregengo.hatenablog.com/entry/2022/05/05/160726</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
