Shop OBEX P1 Docs P2 Docs Learn Events
oscilloscope with javelin stamp using stampdock software. — Parallax Forums

oscilloscope with javelin stamp using stampdock software.

APSpijkermanAPSpijkerman Posts: 32
edited 2010-07-22 13:25 in General Discussion
Hi,

I have written stampdock software that can be used for instance as a graphics screen
and GUI for javelin stamps.
To demostrate this i have made an oscilloscope demo for the javelin stamp
you can download and build.

[noparse][[/noparse]http://apsdev.com/stampscope/home.html] http://apsdev.com/stampscope/home.html

As this is a port of the basic stamp version i first used the same
circuit with opamps and transistors.
But as the rcTime command has a much lower resolution
as on the basic stamp, the resolution of the scope was also less.

So i added an option to use an LTC1298 chip so it can measure
small voltages with a high resolution.

Also i have a question about javelin stamp programming.
To communicate with the PC i use a StringBuffer which i fill and then
send to the PC with system.out.print
Say i have an integer with a value between 0 and 255, how do i put that into the buffer ?
As with buf.append((char) value ) seems to expect a signed value, so it seems
to act up with values greater as 127.

A little example:

static StringBuffer buf = new StringBuffer(128);


static void Plot(int x, int y)
{

buf.clear();
if (x >= 0 && x <= 255 && y >= 0 && y <= 255){
buf.append("!pb"); // fast binary method .. so values <= 255
buf.append((char) 2 ); // write 2 bytes
buf.append((char) x );
buf.append((char) y );
buf.append(";" );
}else{
buf.append("!p"); // slow ascii method .. so values > 255
buf.append( x );
buf.append("," );
buf.append( y );
buf.append(";" );
}
System.out.print(buf.toString());

}

Comments

Sign In or Register to comment.