Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:07:28+00:00 2026-06-18T21:07:28+00:00

Link successfully established and able to send data. Android is sending SeekBar data when

  • 0

Link successfully established and able to send data.

Android is sending SeekBar data when ever we change it.

public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    if(seekBar.getId() == R.id.seekBar)
    {
        speed.setText(String.valueOf(progress));
        String outputData = String.valueOf(progress);
        streams.write(outputData.getBytes());
    }
}

streams.write() writes data to the OutputStream of the Socket.

Problem is with the format of data.If I Send ’25’ arduino is receiving ‘2’,’5′ when I do Serial.read().

What is the format of data, when outputData is converted into bytes? Is everything terminated by \0?

I need to retrieve the whole number instead of single digits.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:07:30+00:00Added an answer on June 18, 2026 at 9:07 pm

    the arduinoboard seems to read the RX-Stream byte by byte. If you send “25” it transmits the ascii byte for the character’2′ (which is 0x32 / decimal 50) and then the ascii representation for the character ‘5’ (which is 0x35 / decimal 53).
    The arduino interprets these numbers as characters. So if the number you want to transmit is lower than 256 you can do:
    On Android:

    if(seekBar.getId() == R.id.seekBar)
        {
            speed.setText(String.valueOf(progress));
            if(progress<256)
                streams.write((byte)progress);
        }
    

    To make sure the Arduino interprets it right, use the received character as a short and not as a character.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i successfully added a contextmenu to my webbrowser with this javascript code: public void
I've been able to successfully link two spinners to a database using a SimpleCursorAdapter.
I successfully compiled the android ICS source code and able to run on emulator.
I do tutorial in following link: Java RMI Tutorial After I compile successfully three
Link with data-rel=back causes two (double) back transitions instead of a single. The issue
This link shows how to inject JavaScript code to WebView object in Android. However
When a user clicks a link, I would like to send an AJAX request
I can successfully link against libawesomium-1.6.5.so : -L-L. -L-lawesomium-1.6.5 -L-ldl libawesomium-1.6.5.so is in the
I successfully download Gitolite file based on link instruction.. When I try to run
I'm trying to implement a simple link list. The initial value is inserted successfully,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.