Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

switch文では文字列や小数点の値は使えない

あまりに初歩的なポカミスで詰まったのでメモ……
switch構文での比較は整数あるいは文字が対象です。
文字列や小数点は使えません!!

実際のところ

var: a variable whose value to compare with various cases. Allowed data types: int, char.
label1, label2: constants. Allowed data types: int, char.

参考もと

Arduino Reference