1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Arduino UNO R3でint(16ビット)を上位、下位に分割して遊ぶ。

Posted at

参考

o_coq779.jpg

o_coq780.jpg

o_coq781.jpg

プログラム



//highByte_lowByte_UNO3_1

#include <Arduino.h>

void setup() {

  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:

  int a = 0x8765;
  unsigned char c[2];

  c[0] = highByte(a);
  c[1] = lowByte(a);

  Serial.print(c[0],HEX);
  Serial.print(',');
  Serial.println(c[1],HEX);

  delay(1000);

}



1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?