Ticket #1949 (reopened enhancement)

Opened 3 years ago

Last modified 17 months ago

Turtle Art to read/write USB

Reported by: tonyforster Owned by: walter
Priority: Low Milestone: Unspecified by Release Team
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

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

Change History

Changed 3 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.

Changed 3 years ago by tonyforster

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

Changed 2 years ago by tonyforster

python block code, serial

Changed 2 years ago by tonyforster

ta code for serial io

Changed 2 years ago by tonyforster

screenshot

Changed 2 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 2 years ago by tonyforster

arduino serial echo project file

Changed 2 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.


Changed 21 months 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

Changed 21 months ago by walter

  • status changed from new to closed
  • resolution set to fixed

Fixed in v117

Changed 21 months ago by tonyforster

  • status changed from closed to reopened
  • resolution fixed deleted

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.

Changed 17 months ago by walter

  • keywords easy-hack added
Note: See TracTickets for help on using tickets.