Sunday, March 15, 2009

Turtle Oscilloscope


For the experimental Turtle Art Portfolio V18 for the XO hardware, this program uses the programmable brick and sensor input . (As at V19 Turtle Art Portfolio, the 2 imports below are no longer required.) (As at V44 of Turtle Art, the programmable block is supported but sensor input still is not.)


# Oscilloscope
# Tony Forster, March 2009
#

from taturtle import *
from math import *
def myblock(lc,x): # x is volts input
ox=lc.tw.turtle.xcor #old x coordinate
oy=lc.tw.turtle.ycor #old y coordinate
nx=ox + 1 #new x coordinate
ny= x #new y coordinate
setxy(lc.tw.turtle, nx, ny) #jump to new coord.
draw_line(lc.tw.turtle,ox,oy,nx,ny)
return

A better oscilloscope

Labels: , , , ,

1 Comments:

Anonymous Anonymous said...

This comment has been removed by a blog administrator.

Tuesday, March 24, 2009 7:39:00 PM  

Post a Comment

<< Home