0
votes

I have an problem with declaring a string.

Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

readBinaryCode:3: error: 'string' does not name a type

string code = "10101010010010100101000101010101111100"

C:\Users\Jerel\Desktop\All\Sketchs\readBinaryCode\readBinaryCode.ino: In function 'void loop()':

readBinaryCode:12: error: 'code' was not declared in this scope

for(int i = 0; i < code.length(); i++) {...

exit status 1

'string' does not name a type

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

1
Try std::string. I've done the Zuul joke already once today. And make sure <string> is included.user4581301

1 Answers

0
votes

Its telling you the truth.

 'string' does not name a type

Instead of

 `string code` use  `String code`



 void setup() {
      // put your setup code here, to run once:
    String code = "10101010010010100101000101010101111100";

    }

Update we dont need any to include anything for this