BITS1 Posted July 13, 2010 Posted July 13, 2010 (edited) Hi guys I have a question, how do you create an autostart file to run on a mac? Like, I want to have the autostart file run the bash file when I plug Teensy into a computer. Then, once the bash file finishes, I can have Teensy, in Serial Mode, to read the result file that the bash file created...I don't know how to get Teensy, in serial mode, to execute a bash file so I thought maybe an autostart file would work? Please help me. I'm not sure how to go about doing this. I'm a beginner at this so any help is greatly appreciated. Bits1 I have some of SdFatRead code in my teensy project to check for the existance of a file: https://dl-web.dropbox.com/get/Public/mypro....zip?w=c052698a Edited July 13, 2010 by BITS1 Quote
Netshroud Posted July 14, 2010 Posted July 14, 2010 Command+Space "Terminal.app" Enter /Volumes/VOLLABEL/somescript.sh && killall terminal (Mac OS X doesn't have autorun from what I can see) Replace VOLLABEL with the drive's volume label, and make sure somescript.sh has +x permissions. Quote
BITS1 Posted July 14, 2010 Author Posted July 14, 2010 Command+Space "Terminal.app" Enter /Volumes/VOLLABEL/somescript.sh && killall terminal (Mac OS X doesn't have autorun from what I can see) Replace VOLLABEL with the drive's volume label, and make sure somescript.sh has +x permissions. Thank you Psychosis, it works pretty well. I was wondering, can Teensy switch from SD+Keyboard to Serial mode? In the beginning, I had teensy use keystrokes to run the script from the SD card but then I needed Teensy to switch to serial mode to read the resulting file in the sd card and blink continuously to indicate the file is in the SD card. It seems like if Teensy is in Serial mode, you cannot execute the script, only read and write...is this true? Thank you for answering my post. Bits1 Quote
BITS1 Posted July 14, 2010 Author Posted July 14, 2010 I got it to work! So I found out that I could read the sd card while I'm in the Keyboard and SD card mode. Previously I assumed that you MUST be in Serial mode in order to read the SD card but now it works anyway. :D Bits1 Quote
BITS1 Posted July 21, 2010 Author Posted July 21, 2010 I got it to work! So I found out that I could read the sd card while I'm in the Keyboard and SD card mode. Previously I assumed that you MUST be in Serial mode in order to read the SD card but now it works anyway. :D Bits1 Well, I found out that to read the files in SD card, I have to unmount the SD to allow the Serial to read the file. Well, does anyone know how a script could have some way to communicate with the Teensy's serial port? For example, if the Teensy executes a script on the computer, it writes something back to the sd card, Teensy unmounts the sd card and then reads the file. Does the Teensy have any type of flag that the computer could set when its finished running the script so that the teensy would know that the process is done? Thanks in advance. Bits1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.