Changeset 87 for sans/utils


Ignore:
Timestamp:
Apr 16, 2007 7:41:45 PM (15 years ago)
Author:
ajj
Message:

First version of tilt controller interface. Simple command entry.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/utils/bt5/tilt/tilt

    r86 r87  
    11#!/usr/bin/expectk 
    22 
     3################################## 
     4## Talk to tilt controller on bt5 
     5## 
     6## Andrew Jackson, April 2007 
     7################################## 
    38 
    4 #Start up ICP 
    5 #log user 0 
    6 eval spawn -noecho "/usr/local/icp/bin/icp" 
    7 set icpid $spawn_id 
     9proc exec_cmd {cmd_text} { 
     10 
     11        .mf.output insert end "$cmd_text\n" 
     12        exp_send "$cmd_text\r" 
     13 
     14} 
    815 
    916 
     17set port /dev/ttyS0 
     18set serialid [spawn -noecho -open [open $port w+]] 
     19set baud 19200 
     20#stty ispeed $baud ospeed $baud -raw cs8 -parenb -cstopb < $port 
     21stty -F $port ispeed $baud ospeed $baud raw icrnl 
     22 
     23 
     24frame .mf 
     25text .mf.output 
     26entry .mf.cmdentry 
     27button .mf.ver_but -text "Execute Command" -command { exec_cmd [.mf.cmdentry get] } 
     28button .mf.init -text "Init" -command {exp_send "\r"} 
     29pack .mf.output -fill both -anchor nw -expand true 
     30pack .mf.cmdentry -side left 
     31pack .mf.ver_but .mf.init -side left 
     32pack .mf 
     33 
     34#expect ">" 
     35#exp_send "VER\r" 
     36#expect ">" {.mf.output insert end $expect_out(buffer)} 
     37 
     38expect_background { 
     39        -re ">" { 
     40                .mf.output insert end $expect_out(buffer) 
     41        } 
     42        -re "\\?" { 
     43                .mf.output insert end $expect_out(buffer) 
     44        } 
     45}                
     46 
     47exp_send "\r" 
Note: See TracChangeset for help on using the changeset viewer.