Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18153

Re: Serial communication not working in arduino

$
0
0

Like u said the serialEvent() was actually never called.....

i even wrote like blinking led in serialEvent() but did not worked actually

and i also tried Serial1.begin() its showed error for Serial1.begin(9600)....like earlier...

but  i got the output i just took that was in serialEvent and attached that to main loop...like this and it worked ...

    while(b)

          { 

            if(Serial.available()){

                    ch=Serial.read();

                    //str+=ch;

                        if(ch=='*')          // '*' this indicates end of transmission

                              {

                                b=false;

                                break;

                              }

                          if(ch==' ')          // '  ' spaces between bytes of data...

                              {

                                 continue;

                              }

                    dataBuff[count]=ch;

                    ++count;

            }   

           

        }

and was able to receive all bytes which i had sent....

Thank u sir ....you helped lot in making me think in different way......Thanks a lot


Viewing all articles
Browse latest Browse all 18153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>