Shop OBEX P1 Docs P2 Docs Learn Events
Reading data from thumb drive — Parallax Forums

Reading data from thumb drive

JonathanJonathan Posts: 1,023
edited 2008-03-20 15:53 in Propeller 1
Hi All,

I'm getting frustrated trying to read data from a USB thumb drive, using the Parallax memstick adapter. I can open, delete·and write, but I can't read. I've tried the "usbdrive" object and imitating the Basic Stamp demo.

With the usbdrive object, is this the proper usage for read?

byte usbData[noparse][[/noparse]14]
thumb.read($01,@usbData)
 

This always returns 0

I have also tried:
temp := read_byte 
 
PUB read_byte: fileData | temp
  thumb.rxflush
  thumb.str(string("RDF "))
  thumb.tx($00)
  thumb.tx($00)
  thumb.tx($00)
  thumb.tx($01)
  thumb.tx(CR)
  fileData := thumb.rx
  repeat until temp == CR
    temp := thumb.rx
RETURN

My forehead has "QWERTY" stamped on it. What am I doing wrong?

Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Sign In or Register to comment.