Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

serial data receiving in java

Status
Not open for further replies.

visva

Member level 3
Joined
Jul 26, 2012
Messages
55
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,633
In my project i am reading data what i sent from micro controller.But i am sending Hexadecimal value from micro controller.In java receiving those data's.
but that is something unknown character's are displaying. please any one help me how to convert those hexadecimal value to ASCII in java.

Note:
The following coding i have using in my project. Any one tell me what i need to change in this receiving coding.




Code:
        			case SerialPortEvent.DATA_AVAILABLE:
            				byte[] readBuffer = new byte[20];
			
				
           	 			try 
				{
                				while (inputStream.available() > 0) 
					{
                    					int numBytes = inputStream.read(readBuffer);
						
					
	              				}
					
                				System.out.print(new String(readBuffer));
            				} 
				catch (IOException e) {System.out.println(e);}
            			break;
			default:
				System.out.println("There is no data");















<a href=http://www.soundfrost.org/ >youtube to mp3</a>























<a href=http://www.soundfrost.org/ >youtube to mp3</a>
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top