Reading the value from Arduino

Hi,
Your points are strong but unfortunately I am yet not getting the output.
Note= I have rectified your code by declaring int count=0 since in the loop the name of the integer is count(E,g=count++,etc)

CODE:

#include SoftwareSerial.h>
SoftwareSerial mySerial(9,10); //Do not use 0,1 they are used for the hardware UART
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
mySerial.setTimeout(200);
Serial.println(“in setup”); // a debug message

}

int count = 0;
String for_bolt = “A message for bolt , msg num =”;

void loop(){
if (mySerial.available()>0){
Serial.print(“Data from bolt is”);
Serial.println( mySerial.readStringUntil(’\n’));
count ++;
mySerial.println(for_bolt + String(count));
}
}

OUTPUT

INFERENCE :
I think there seems to have some interfacing problem with library or BOLT even now also because in the output , void loop has not been executed even @ once.

what interface have you used between bolt and arduino can you tell me pin to pin connections?

Pin 9 of arduino to Tx of BOLT
Pin 10 of arduino to Rx of BOLT

Gnd of Bolt to gnd of arduino?
If that is checked, can you tell me the command you are sending to bolt.

Yes , I also did ground to ground connection of bolt and arduino .

I am using the following commands in the address bar of Google chrome to get the result -
192.168.43.70/serialBegin?baud=2
192.168.43.70/serialWR?data =say hi to arduino
192.168.43.70/serialWR?data=’\n’

Note: but whenever I type serialRead, it shows receiver buffer is empty !!

HI,

The second command from bolt should be

192.168.43.70/serialWR?data=say hi to arduino%10

where %10 is the ascii code for \n

Hello,

Thanks a lot Datta.naik:relaxed: for letting me understand !! Finally I got the output.

Eureka!!
While learning this serial communication , I discovered one thing last night when I was coding !!
I can make BOLT as a switch to turn ON the serial monitor of Arduino to display data.
Isn’t it cool ? Yes is it !!:sunglasses::blush:

It means until and unless I do not give command , no stranger can see the Serial monitor output !!

I am in love with BOLT !!

But I have one doubt : Whatever data I am getting on the serial monitor , can I get the same data simultaneously on the BOLT without any delay?? To be more clear , Is is possible to have such parallel communication between the processor , serial monitor and BOLT at the same time ?

Since Bolt communicates back and forth to your over HTTP using a local router or our cloud there will always be an inherent delay in the communications.

Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference().

For more knowledge and skills in ardino go for AngularJS Course