element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum HC-06 data into separate textboxes?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 5 replies
  • Answers 1 answer
  • Subscribers 391 subscribers
  • Views 655 views
  • Users 0 members are here
  • frontpage
Related

HC-06 data into separate textboxes?

Former Member
Former Member over 9 years ago

Hi i am wanting to simply split the data that is coming in from my hc-06 module into seperate textboxes. I have my arduino code and at the moment it is putting both the temperature results and the reaction results all in one textbox. Is there any tips on how to sperate these into different textboxes?

 

Many Thanks

Rhys

  • Sign in to reply
  • Cancel
Parents
  • neilk
    0 neilk over 9 years ago

    Hi rhyshagen448

     

    I assume your hc-06 is transmitting to an Android device ?? if so then:

     

    If you look here : https://www.element14.com/community/thread/44533/l/reading-arduino-csv-data-in-app-inventor

     

    You will see a similar question from alacosta involving 5 data items, sent out as .csv, which was answered.

     

    If you look at my blog, here: https://www.element14.com/community/people/neilk/blog/2015/02/02/mit-app-inventor-and-arduino-part-4--send-more-than-1-data-item-from-arduino-to-android-and-display

     

    You will see several other potential solutions to your question.

     

    Hope this helps image

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • neilk
    0 neilk over 9 years ago

    Hi rhyshagen448

     

    I assume your hc-06 is transmitting to an Android device ?? if so then:

     

    If you look here : https://www.element14.com/community/thread/44533/l/reading-arduino-csv-data-in-app-inventor

     

    You will see a similar question from alacosta involving 5 data items, sent out as .csv, which was answered.

     

    If you look at my blog, here: https://www.element14.com/community/people/neilk/blog/2015/02/02/mit-app-inventor-and-arduino-part-4--send-more-than-1-data-item-from-arduino-to-android-and-display

     

    You will see several other potential solutions to your question.

     

    Hope this helps image

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 9 years ago in reply to neilk

    Hi neil, thanks for the response, Im quite new to app inventor so im not sure if what i am doing is right. This block code sends the temp and reaction both to the same label?

     

     

     

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • neilk
    0 neilk over 9 years ago in reply to Former Member

    Hi Rhys - as far as your Arduino code is concerned, it's almost impossible to decipher from the screen shots you have included.

     

    When posting code, it's much better to click "Use Advanced Editor" in the top right of the message window. This then allows you to click the >> symbol and then select Syntax Highlighting followed by c++. This gives the following sub-window:

     

    You can then type or paste your code like this:

     

    // Simulate 2 labelled data items and output to serial for Android demonstration  
      
    const int pot = A0;  
      
    void setup() {  
      pinMode(pot, INPUT);  
      Serial.begin(9600);  
    }  
      
    void loop() {  
      int potVal1 = analogRead(pot);  
      int potVal2 = potVal1/2;          // just to give a different value  
      Serial.print("LED State = " );  
      Serial.println(potVal1);  
      delay(600);         
      Serial.print("LDR Value = " );  
      Serial.println(potVal2);   
      delay(600);               
    } 

    As you will see from the above code, the effective output will be something like:

     

                  LED = 135                    each line of data is followed by CR/LF

                  LDR = 245

                  LED = 178

                  LDR = 465

     

    And there will be a 600mS delay between each line of data. Your App Inventor code needs to read from the hc-06 more frequently than every 600mS, to avoid the input buffer of the Android device containing 2 lines of data.

     

    The solution given in the second link I provided is, I think, superior to the above, because it doesn't rely on timing. If you study it, you will see that it assumes that the Arduino sends data in the form:

     

    LED = 135,LDR = 245

     

    and uses an App Inventor block which splits the incoming text into a list, using the , separator. Each item in the list is then independently accessible.

     

    As a general rule, I would always start with a known, simple example and get that working first!! Then you can slowly convert it to your own requirements, retesting it at every stage and including lots of comments and Output to the serial monitor so you can understand what's happening when it stops working!

     

    I hope this helps.

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube