{Java Mbed Library} Bug in pwmOut.read()

28 Oct 2010

Hi

At first I have to excuse for my sloppy english, but i hope you understand me anyway.

The funktion pwmout.read() seems not to work; when you use it you will always get an "NumberFormatException".

In my opinion this is the case because the integer.parseint() function used to transform the String with the pulsewith-value got from the RPC-function does not work in this case. The parseint-function only parses values which fit in an integer, and the float you get from the Mbed does not.

It would be much better to return a float, maybee like this:

		public float read(){
			String response = the_mbed.RPC(name, "read", null);
			//Need to convert response to and int and return <-an "and" to much i think ;)
			float f = Float.valueOf(response);			
                   return(f);
		}

29 Oct 2010

Hi

Thanks for pointing this out.

I've updated the library to return a float.

Michael

03 May 2011

hi

actually i am using java and rpc to send commands to the mbed.

however, i got some problems whith reading integer or double values coming from digital in or analog in and using the read function. is there any explanation for those?

archlord.