From 19b8d828c7ff0f125d4354fd4d0c84ca1b741ce2 Mon Sep 17 00:00:00 2001 From: Rafael Ortiz Date: Fri, 24 Jun 2011 05:30:41 +0000 Subject: order in arduino - typo on taarduino --- diff --git a/plugins/arduino/arduino.py b/plugins/arduino/arduino.py index 5297262..08d2f1c 100644 --- a/plugins/arduino/arduino.py +++ b/plugins/arduino/arduino.py @@ -28,7 +28,6 @@ from TurtleArt.talogo import media_blocks_dictionary, primitive_dictionary from TurtleArt.tautils import get_path, debug_output import logging - _logger = logging.getLogger('TurtleArt-activity plugin Arduino') @@ -36,32 +35,31 @@ from gettext import gettext as _ from taarduino import TAArduino # Arduino setup -class Arduino(Plugin): # plugin class +class Arduino(Plugin): + # plugin class def __init__(self, parent): self._parent = parent self._status = False - def setup(self): - # set up Arduino-specific blocks + def setup(self): # set up Arduino-specific blocks palette = make_palette('Arduino', # the name of your palette - colors=["#00FF00", "#00A000"], - help_string=_('Arduino Commands')) + colors=["#00FF00", "#00A000"], + help_string=_('Arduino Commands')) - primitive_dictionary['blink'] = self._blink + primitive_dictionary['blink'] = self._blink_boton palette.add_block('blink', # the name of your block - style='basic-style', # the block style - label=_('blink'), # the label for the block - prim_name='blink', # code reference (see below) - help_string=_('blinks the onboard arduino led')) - # Next, you need to define what your block will do: - # def_prim takes 3 arguments: the primitive name, the number of - # of arguments, 0 in this case, and the function to call, in this - # case, the canvas function to set the heading. + style='basic-style-1arg', # the block style + label=_('blink'), # the label for the block + prim_name='blink', # code reference (see below) + help_string=_('blinks the onboard arduino led')) + # Next, you need to define what your block will do: + # def_prim takes 3 arguments: the primitive name, the number of + # of arguments, 0 in this case, and the function to call, in this + # case, the canvas function to set the heading. - self.tw.lc.def_prim('blink', 0, lambda self, blink: primitive_dictionary['blink'](valor)) #aca debe ir las funciones para hacer blink con arduino + self._parent.lc.def_prim('blink', 1, lambda self, blink: primitive_dictionary['blink'](blink)) #aca debe ir las funciones para hacer blink con arduino - def _blink(self, blink): + def _blink_boton(self, blink): print "El valor del boton ", blink - diff --git a/plugins/arduino/taarduino.py b/plugins/arduino/taarduino.py index 00d7abf..c66cf61 100644 --- a/plugins/arduino/taarduino.py +++ b/plugins/arduino/taarduino.py @@ -19,7 +19,7 @@ import firmata class TAArduino(object): - def __init__(self, fdev='/dev/ttyUSB0', baud=115200): + def __init__(self, dev='/dev/ttyUSB0', baud=115200): object.__init__(self) self._dev = dev self._baud = baud -- cgit v0.9.1