Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-06-24 05:30:41 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-06-24 05:30:41 (GMT)
commit19b8d828c7ff0f125d4354fd4d0c84ca1b741ce2 (patch)
tree940c2a87fef90e711bca3053fb8809d0ee0f4394
parent436cc9370ab6a0e496140f813f0256de0f792836 (diff)
order in arduino - typo on taarduino
-rw-r--r--plugins/arduino/arduino.py34
-rw-r--r--plugins/arduino/taarduino.py2
2 files changed, 17 insertions, 19 deletions
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