Opened 14 years ago

Closed 11 years ago

#1949 closed enhancement (wontfix)

Turtle Art to read/write USB

Reported by: tonyforster Owned by: walter
Priority: Low Milestone: Unspecified
Component: Turtleart Version: Unspecified
Severity: Unspecified Keywords: easy-hack
Cc: Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Another one for the wish list. It would be really cool if TA could interface via USB to devices like accelerometers and weather stations. Possibly best implemented as sample python code for the programmable block.

Attachments (4)

Pippy Activity serial.py (337 bytes) - added by tonyforster 13 years ago.
python block code, serial
Turtle Art Activity serial.ta (366 bytes) - added by tonyforster 13 years ago.
ta code for serial io
Screenshot of "Turtle Art Activity serial".png (100.9 KB) - added by tonyforster 13 years ago.
screenshot
incomingbyte.pde (579 bytes) - added by tonyforster 13 years ago.
arduino serial echo project file

Download all attachments as: .zip

Change History (13)

comment:1 Changed 14 years ago by walter

The Arduino fork is a good example of this. But yes, in general, I think it is a matter of putting some sample code into tamyblock.py. We could accumulate a library of examples for popular devices.

comment:2 Changed 14 years ago by tonyforster

See volumesmanager.py and HAL for possible ideas? (that's where USB gets mounted in journal?)

Changed 13 years ago by tonyforster

python block code, serial

Changed 13 years ago by tonyforster

ta code for serial io

Changed 13 years ago by tonyforster

screenshot

comment:3 Changed 13 years ago by tonyforster

Three files attached, the python code reads and writes to a serial device on the USB
Tested with an Arduino running an echo program.
Need to copy the serial directory to turtleart.activity
Standard install of Pyserial fails because Sugar's Python does not have the developer tools
python setup.py install
unable to open /usr/lib/python2.6/config/Makefile (No such file or directory)
I copied the serial directory from TortugArdu http://www.box.net/shared/bsf8tmj6al

should work wherever there is a FTDI FT232R USB to serial converter IC

more ideas at
http://littlebirdelectronics.com/products/breakout-board-for-ft232rl-usb-to-serial
http://www.chinwah-engineering.com/

Changed 13 years ago by tonyforster

arduino serial echo project file

comment:4 Changed 13 years ago by RafaelOrtiz

One suggestion is to have or abstract the usb related code in TB's core, in order to make able for the plugins to use that, but not necessarily to have it in the plugin.


comment:5 Changed 12 years ago by walter

Sorry to have taken so long with this. Will be part of v117 release.

http://git.sugarlabs.org/turtleart/mainline/commit/0996701c39695e24fbb4992471ba5298f52a4fe6

comment:6 Changed 12 years ago by walter

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in v117

comment:7 Changed 12 years ago by tonyforster

  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks

Tested OK with the serial adaptor and the Arduino

It would be good if we could include in the comments, simple instructions on how to install the serial library. That's a bit beyond my skills.

Or as Rafael suggests, include the library code in TA

Still, its low priority.

comment:8 Changed 12 years ago by walter

  • Keywords easy-hack added

comment:9 Changed 11 years ago by walter

  • Resolution set to wontfix
  • Status changed from reopened to closed

I think the serial package is installed by default these days.

Note: See TracTickets for help on using tickets.