I stumbled upon this great executable that turns an arduino board into an Osciliscope. Which is excellent because I don't have to hook up my project to the real Osciliscope for small things and It's obviously loads cheaper and more accessible that the alternative.
The code is hosted here: http://code.google.com/p/xoscillo/
Here is a screenshot of a test reading of 2 digital channels of a electronic caliper (see my other post for details).
Note that the original code posted does note work with the current version of the Arduino IDE/firmware (1.0.1). But this has been fixed in this post here http://code.google.com/p/xoscillo/issues/detail?id=11
Code reposted - I must admit I dont understand any of this.
--- a/firmware/ArduinoOscillo/arduinooscillo.pde
+++ b/firmware/ArduinoOscillo/arduinooscillo.pde
@@ -100,14 +100,14 @@
{
if ( in == CMD_PING )
{
- Serial.print( 79, BYTE ) ;
- Serial.print( 67, BYTE ) ;
- Serial.print( triggerVoltage, BYTE ) ;
- Serial.print( DataRemaining>>8, BYTE ) ;
- Serial.print( DataRemaining&0xff, BYTE ) ;
+ Serial.write( 79 ) ;
+ Serial.write( 67 ) ;
+ Serial.write( triggerVoltage) ;
+ Serial.write( DataRemaining>>8 ) ;
+ Serial.write( DataRemaining&0xff ) ;
for (int i=0;i<2 br="br" i="i"> {
- Serial.print( triggerVoltage, BYTE ) ;
+ Serial.write( triggerVoltage ) ;
}
}
else if ( in == CMD_RESET ) 2>
No comments:
Post a Comment