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
Labels: olpc, programming, Python, Sugar, XO_input
1 Comments:
This comment has been removed by a blog administrator.
Post a Comment
<< Home