conversion from 'int' to 'String' is ambiguous

  • Arduino C++

You may see

error: conversion from 'int' to 'String' is ambiguous
warning: multi-character character constant

Why it happens

  • Words are in single quotes.

How to fix it

  1. Use double quotes for words: String s = "abc";.
  2. Keep single quotes for one letter, as in if (data == '1').

It worked if: Verify passes.

Seen in a real run (some lines are close variants of it). Produced with Arduino CLI 1.5.1 and Arduino AVR core 1.8.8 (the same compiler the Arduino IDE uses).

Didn't help? Search another error or ask us.