Shop OBEX P1 Docs P2 Docs Learn Events
Format object help required (SOLVED) — Parallax Forums

Format object help required (SOLVED)

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2007-12-14 08:17 in Propeller 1
Attached are my Format object and Format test program.
I load the test program into a spin stamp and output strings
via the propclip.

The mainloop is
· repeat
'··· fmt.sprintf(buffer,string("%c"),"Z")
··· fmt.sprintf(buffer,string("%s"),string("ABCD"))
'··· fmt.sprintf(buffer,string("%d"),16)
'··· fmt.sprintf(buffer,string("%i"),16)
'··· fmt.sprintf(buffer,string("%b"),16)
'··· fmt.sprintf(buffer,string("%o"),16)
'··· fmt.sprintf(buffer,string("%u"),16)
'··· fmt.sprintf(buffer,string("%x"),16)
··· debugHex2(buffer)
··· waitcnt(clkfreq / 1000 * 100 + cnt)

The idea is to enable just one of the sprintf statements.
For %c I get 5A (hexvalue of "Z") in a rapid tempo.
For %s I get 41424344, but there is quite a delay between successive outputs.
All the other output nothing. It looks Format.bprintf never returns.
Strange, as this is the exact code I use on the Javelin and there it works.

Can anybody spot any (obvious) error? As this is my first propeller project it is quite
possible I did something wrong with the pointers.

regards peter



Post Edited (Peter Verkaik) : 12/14/2007 10:00:46 AM GMT

Comments

Sign In or Register to comment.