Interfacing of arduino with BOLT

Hello folks,

I used the following code in Arduino IDE which is also posted in instructabels.

void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Begin Serial at 9600
Serial.setTimeout(50); //Timeout serial if readString is unavailable
}

void loop() {
// put your main code here, to run repeatedly:
String inString = “”;
if (Serial.available() > 0) {
// get incoming String
inString = Serial.readString(); //Read input string from bolt
Serial.print(inString); //Send same string back to bolt
}
}

Unfortunately , I am getting error as - br and inString command not declared in this scope. !!

I am new to arduino , please help me to learn !

The code compiles for me.
try to shift the inString declaration outside the loop function like this.


void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Begin Serial at 9600
Serial.setTimeout(50); //Timeout serial if readString is unavailable
}

String inString="";

void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) {
// get incoming String
inString = Serial.readString(); //Read input string from bolt
Serial.print(inString); //Send same string back to bolt
}
}

Hey Its wonderful!!
Started working . I am very happy!

Thank you

1 Like

How did you create the new product in BOLT cloud to interface with arduino? Did you use UART and CSV?

Hi @sayakbhar
To create a new product, Go to developer console -> Click on Add product (+ Icon) -> Choose Default Image and default page -> Click on Yes for hardware configuration -> Select UART and the number of Common Separated Value and choose the time interval -> Click on Deploy Configuration

Let me know in case you need further assistance.

Thank you. What code we have to upload in the bolt cloud?

@sayakbhar
Linking the below topic since the topic is continued there.