Jump to content

[Version 1] Serial Mode Or Keyboard+sd Mode?


BITS1
 Share

Recommended Posts

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 by BITS1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...