123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|560|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> mbed troubles already

Thu, 04 Nov 2010, 11:23
waroffice
I havnt really done much in terms of c/c++ coding before and struggling if im honest.

I want to output the value of an analog in pin to an LCD screen i have.

I can send string data no problems.

this is my code.



Im struggling to convert from an integer to a string and the mbed docs are not clear.
Thu, 04 Nov 2010, 11:39
Spare
why are you trying to use strcat on an AnalogIn object?
Thu, 04 Nov 2010, 11:52
CodersRule
Edit: Never mind, I see what you're attempting to do now.
I'm not sure as to how to convert an int into a string, can't help you there.
Thu, 04 Nov 2010, 11:54
Jayenkai
He just wants to dump the value.
C Strings are a bitch!

Not sure if this command's in your lang, but..
sprintf(out,"temp = %f",temp); (%d for an int!)

see here

-=-=-
''Load, Next List!''
Thu, 04 Nov 2010, 12:58
waroffice
I sorted this and used sprintf().

I had trouble with the format but figured it out eventually.

the lcd.putc(12); line resets the cursor to the start point.

Heres the code.


Fri, 12 Nov 2010, 09:33
waroffice
i think i should read my C++ for dummies book.

I'm struggling with getting serial data to act as I imagine.

I have a fully working program written in Visual Basic 2008 that communicates with an Arduino, it sends a character then a number to determine what to do. This is proving tricky with the mbed as the serial functions dont support reading an int or float, you have to code it your self.

I finally get it working using PuTTY to communicate with it, but VB seems to sending the data differently and its confusing the crap out of me.

oh well wouldnt be as fun if it was easy