<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mats12345</author_name>
  <author_url>https://blog.hatena.ne.jp/mats12345/</author_url>
  <blog_title>mats12345’s blog</blog_title>
  <blog_url>https://mats12345.hatenablog.com/</blog_url>
  <categories>
    <anon>Arduino</anon>
    <anon>C言語</anon>
  </categories>
  <description>概要 Arduinoのソフトウェアシリアル入力で受け取った値をシリアルモニタで表示しようとするとFがめっちゃ出るやつの解決法。 起こったこと BLEレシーバからソフトウェアシリアルで受けたBLEタグIDの一部'0x88'を出力しようと char data = BLE.read(); Serial.print(data, HEX); のように記述するとシリアルモニタに FFFFFF88 と表示され、視認性やその後の計算等に支障が出た。 原因 C言語でchar変数をintにキャストするとき、最上位ビットが '1' であると2の補数表現を維持しようと符号拡張を行う。 参考 marycore.jp 解…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmats12345.hatenablog.com%2Fentry%2F2019%2F02%2F20%2F143221&quot; title=&quot;バイナリデータの符号拡張と解決(Arduino,C言語) - mats12345’s blog&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>2019-02-20 14:32:21</published>
  <title>バイナリデータの符号拡張と解決(Arduino,C言語)</title>
  <type>rich</type>
  <url>https://mats12345.hatenablog.com/entry/2019/02/20/143221</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
