grepmail-5.3111/000755 000765 000024 00000000000 13321551743 014051 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/000755 000765 000024 00000000000 13321551743 014622 5ustar00coppitstaff000000 000000 grepmail-5.3111/grepmail.old000644 000765 000024 00000221220 13316312675 016353 0ustar00coppitstaff000000 000000 #!/usr/bin/perl -w # grepmail # Do a pod2text on this file to get full documentation, or pod2man to get # man pages. # Written by David Coppit (david@coppit.org, http://coppit.org/) with lots of # debugging and patching by others -- see the CHANGES file for a complete # list. use 5.005; use vars qw( %opts $commandLine $VERSION %message_ids_seen $USE_CACHING $USE_GREP ); use Getopt::Std; use strict; use Mail::Mbox::MessageParser; use FileHandle; use Carp; $VERSION = sprintf "%d.%02d%02d", q/5.31.5/ =~ /(\d+)/g; # Set to 1 to enable caching capability $USE_CACHING = 1; # Set to 0 to disable use of external grep utility $USE_GREP = 1; # Internal function return values. my $PRINT = 0; my $DONE = 1; my $SKIP = 2; my $CONTINUE = 3; my $NONE = 4; my $BEFORE = 5; my $AFTER = 6; my $NODATE = 8; my $BETWEEN = 9; my $LESS_THAN = 10; my $LESS_THAN_OR_EQUAL = 11; my $GREATER_THAN = 12; my $GREATER_THAN_OR_EQUAL = 13; my $EQUAL = 14; my $NO_PATTERN = '\127\235NO PATTERN\725\125'; my %HEADER_PATTERNS = ( '^TO:' => '(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):)', '^FROM_DAEMON:' => '(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)?))', '^FROM_MAILER:' => '(^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From)([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t][^<)]*(\(.*\).*)?)?$([^>]|$))', ); #------------------------------------------------------------------------------- # Outputs debug messages with the -D flag. Be sure to return 1 so code like # 'dprint "blah\n" and exit' works. sub dprint { return 1 unless $opts{'D'}; my $message = join '',@_; foreach my $line (split /\n/, $message) { warn "DEBUG: $line\n"; } return 1; } #------------------------------------------------------------------------------- # Print a nice error message before exiting sub Report_And_Exit { my $message = shift; $message .= "\n" unless $message =~ /\n$/; warn "grepmail: $message"; exit 1; } #------------------------------------------------------------------------------- # Filter signals to print error messages when CTRL-C is caught, a pipe is # empty, a pipe is killed, etc. my %signals_and_messages = ( 'PIPE' => 'Broken Pipe', 'HUP' => 'Hangup', 'INT' => 'Canceled', 'QUIT' => 'Quit', 'SEGV' => 'Segmentation violation', 'TERM' => 'Terminated', ); # We'll store a copy of the original signal handlers and call them when we're # done. This helps when running under the debugger. my %old_SIG = %SIG; sub Signal_Handler { my $signal = $_[0]; $old_SIG{$signal}->(@_) if $old_SIG{$signal}; Report_And_Exit($signals_and_messages{$signal}); } # Delete the HUP signal for Windows, where it doesn't exist delete $signals_and_messages{HUP} if $^O eq 'MSWin32'; # We have to localize %SIG to prevent odd bugs from cropping up (see # changelog). Using an array slice on %SIG, I assign an array consisting of as # many copies of \&Signal_Handler as there are keys in %signals_and_messages. local @SIG{keys %signals_and_messages} = (\&Signal_Handler) x keys %signals_and_messages; ################################ MAIN PROGRAM ################################# binmode STDOUT; binmode STDERR; my ($dateRestriction, $date1, $date2); my ($sizeRestriction, $size1, $size2); { # PROCESS ARGUMENTS my (@remaining_arguments,$pattern); { my ($opts_ref,$remaining_arguments_ref); ($opts_ref,$remaining_arguments_ref,$pattern) = Get_Options(@ARGV); %opts = %$opts_ref; @remaining_arguments = @$remaining_arguments_ref; } # Initialize seen messages data structure to empty. %message_ids_seen = (); # Save the command line for later when we try to decompress standard input { # Need to quote arguments with spaces my @args = @ARGV; grep { index($_, ' ') == -1 ? $_ : "'$_'" } @args; $commandLine = "$0 @args"; } Print_Debug_Information($commandLine); sub Process_Date; sub Process_Size; sub Get_Files; sub Validate_Files_Are_Not_Output; # Make the pattern insensitive if we need to $pattern = "(?i)$pattern" if ($opts{'i'}) && $pattern ne $NO_PATTERN; # Make the pattern match word boundaries if we need to $pattern = "\\b$pattern\\b" if ($opts{'w'}) && $pattern ne $NO_PATTERN; if (defined $opts{'d'}) { ($dateRestriction,$date1,$date2) = Process_Date($opts{'d'}); } else { $dateRestriction = $NONE; } if (defined $opts{'s'}) { ($sizeRestriction,$size1,$size2) = Process_Size($opts{'s'}); } else { $sizeRestriction = $NONE; } dprint "PATTERN: $pattern\n" unless $pattern eq $NO_PATTERN; dprint "PATTERN: \n" if $pattern eq $NO_PATTERN; dprint "FILES: @remaining_arguments\n"; dprint "DATE RESTRICTION: $dateRestriction\n"; dprint "FIRST DATE: $date1\n" unless $dateRestriction == $NONE; dprint "SECOND DATE: $date2\n" unless $dateRestriction == $NONE; dprint "SIZE RESTRICTION: $sizeRestriction\n"; dprint "FIRST SIZE: $size1\n" unless $sizeRestriction == $NONE; dprint "SECOND SIZE: $size2\n" unless $sizeRestriction == $NONE; Validate_Pattern($pattern); my @files = Get_Files(@remaining_arguments); # If the user provided input files... if (@files) { Validate_Files_Are_Not_Output(@files); Handle_Input_Files(@files,$pattern); } # Using STDIN elsif (!@remaining_arguments) { Handle_Standard_Input($pattern); } exit 0; } #------------------------------------------------------------------------------- sub Get_Options { local @ARGV = @_; my @argv = @ARGV; # Print usage error if no arguments given Report_And_Exit("No arguments given.\n\n" . usage()) unless @ARGV; # Check for --help, the standard usage command, or --version. print usage() and exit(0) if grep { /^--help$/ } @ARGV; print "$VERSION\n" and exit(0) if grep { /^--version$/ } @ARGV; my @valid_options = qw( a b B C d D e E f F i j h H l L M m n q r R s S t T u v V w X Y Z ); my %opts; my $pattern; # Initialize all options to zero. map { $opts{$_} = 0; } @valid_options; # And some to non-zero. $opts{'d'} = $opts{'V'} = undef; $opts{'X'} = '^-- $'; $opts{'C'} = undef; # Ensure valid options. ALSO UPDATE 2ND GETOPT CALL BELOW getopt("CdeEfjsXY",\%opts); # Here we have to deal with the possibility that the user specified the # search pattern without the -e flag. # getopts stops as soon as it sees a non-flag, so $ARGV[0] may contain the # pattern with more flags after it. unless ($opts{'e'} || $opts{'E'} || $opts{'f'}) { my $missing_flags = ''; foreach my $flag (keys %opts) { $missing_flags .= $flag unless $opts{$flag}; } $missing_flags = "[$missing_flags]"; # If it looks like more flags are following, then grab the pattern and # process them. unless (defined $argv[-($#ARGV+2)] && $argv[-($#ARGV+2)] eq '--') { if ( $#ARGV > 0 && $ARGV[1] =~ /^-$missing_flags$/) { $pattern = shift @ARGV; getopt("CdfjsXY",\%opts); } # If we've seen a -d, -j, -s, or -u flag, and it doesn't look like there # are flags following $ARGV[0], then look at the value in $ARGV[0] elsif ( ( defined $opts{'d'} || $opts{'j'} || $opts{'s'} || $opts{'u'} ) && ( $#ARGV <= 0 || ( $#ARGV > 0 && $ARGV[1] !~ /^-$missing_flags$/ ) ) ) { # If $ARGV[0] looks like a file we assume there was no pattern and # set a default pattern of "." to match everything. if ($#ARGV != -1 && -f Search_Mailbox_Directories($ARGV[0])) { $pattern = '.'; } # Otherwise we take the pattern and move on else { $pattern = shift @ARGV; } } # If we still don't have a pattern or any -d, -j, -s, or -u flag, we # assume that $ARGV[0] is the pattern elsif (!defined $opts{'d'} && !$opts{'j'} && !$opts{'s'} && !$opts{'u'}) { $pattern = shift @ARGV; } } } if ($opts{'e'} || $opts{'E'} || $opts{'f'}) { Report_And_Exit("You specified two search patterns, or a pattern and a pattern file.\n") if defined $pattern; if ($opts{'e'}) { $pattern = $opts{'e'}; } elsif ($opts{'E'}) { $pattern = $opts{'E'}; } else { open my $pattern_file, $opts{'f'} or Report_And_Exit("Can't open pattern file $opts{'f'}"); $pattern = '('; my $first = 1; while (my $line = <$pattern_file>) { if ($first) { $first = 0; } else { $pattern .= '|'; } chomp $line; $pattern .= $line; } close $pattern_file; $pattern .= ')'; } } elsif (defined $opts{'V'}) { # Print version and exit if we need to print "$VERSION\n"; exit (0); } elsif (!defined $pattern) { # The only times you don't have to specify the pattern is when -d, -j, -s, or -u # is being used. This should catch people who do "grepmail -h" thinking # it's help. Report_And_Exit("Invalid arguments.\n\n" . usage()) unless defined $opts{'d'} || $opts{'j'} || $opts{'s'} || $opts{'u'}; $pattern = '.'; } if (defined $opts{'d'}) { if (eval {require Date::Parse}) { import Date::Parse; } else { Report_And_Exit('You specified -d, but do not have Date::Parse. ' . "Get it from CPAN.\n"); } if (eval {require Time::Local}) { import Time::Local; } else { Report_And_Exit('You specified -d, but do not have Time::Local. ' . "Get it from CPAN.\n"); } if (eval {require Date::Manip}) { my ($version_number) = $Date::Manip::VERSION =~ /^(\d+\.\d+)/; Date::Manip::Date_Init("TodayIsMidnight=1") if ($version_number >= 5.43 && $version_number < 6); } } $opts{'h'} = 1 if $opts{'Y'}; # Make sure no unknown flags were given foreach my $option (keys %opts) { unless (grep {/^$option$/} @valid_options) { Report_And_Exit("Invalid option \"$option\".\n\n" . usage()); } } # Check for -E flag incompatibilities. if ($opts{'E'}) { # Have to do -Y before -h because the former implies the latter my @options = qw(e f M S Y); for my $option (@options) { if ($opts{$option}) { Report_And_Exit "-$option can not be used with -E"; } } if ($opts{'i'}) { Report_And_Exit "-i can not be used with -E. Use -E '\$email =~ /pattern/i' instead"; } if ($opts{'b'}) { Report_And_Exit "-b can not be used with -E. Use -E '\$email_body =~ /pattern/' instead"; } if ($opts{'h'}) { Report_And_Exit "-h can not be used with -E. Use -E '\$email_header =~ /pattern/' instead"; } } # Check for -f flag incompatibilities. if ($opts{'f'}) { # Have to do -Y before -h because the former implies the latter my @options = qw(E e); for my $option (@options) { if ($opts{$option}) { Report_And_Exit "-$option can not be used with -E"; } } } unless (defined $opts{'C'}) { if(defined $ENV{'HOME'}) { $opts{'C'} = "$ENV{'HOME'}/.grepmail-cache"; } elsif ($USE_CACHING) { # No cache file, so disable caching $USE_CACHING = 0; warn "grepmail: No cache file specified, and \$HOME not set. " . "Disabling cache.\n" unless $opts{'q'}; } } $opts{'R'} = 1 if $opts{'L'}; $pattern = $NO_PATTERN if $pattern eq '()'; return (\%opts, \@ARGV, $pattern); } #------------------------------------------------------------------------------- sub Print_Debug_Information { my $commandLine = shift; return unless $opts{'D'}; dprint "Version: $VERSION"; dprint "Command line was (special characters not escaped):"; dprint " $commandLine"; if (defined $Date::Parse::VERSION) { dprint "Date::Parse VERSION: $Date::Parse::VERSION"; } dprint "Options are:"; foreach my $i (sort keys %opts) { if (defined $opts{$i}) { dprint " $i: $opts{$i}"; } else { dprint " $i: undef"; } } dprint "INC is:"; foreach my $i (@INC) { dprint " $i"; } } #------------------------------------------------------------------------------- # Dies if the given pattern's syntax is invalid sub Validate_Pattern { my $pattern = shift; local $@; if ($opts{'E'}) { eval {if ($pattern) {}}; Report_And_Exit "The match condition \"$pattern\" is invalid.\n" if $@; } elsif ($pattern ne $NO_PATTERN) { eval {'string' =~ /$pattern/}; Report_And_Exit "The pattern \"$pattern\" is invalid.\n" if $@; } } #------------------------------------------------------------------------------- # Get a list of files, taking recursion into account if necessary. sub Get_Files { my @files_and_directories = @_; # We just return what we were given unless we need to recurse subdirectories. return @files_and_directories unless $opts{'R'}; my @files; foreach my $arg (@files_and_directories) { if (-f $arg) { push @files, $arg; } elsif( -d $arg || -l $arg && $opts{'L'} ) { dprint "Recursing directory $arg looking for files..." if -d $arg; dprint "Following symbolic link $arg looking for files..." if -l $arg; unless (eval {require File::Find}) { Report_And_Exit("You specified -R or -L, but do not have File::Find. " . "Get it from CPAN.\n"); } import File::Find; # Gets all plain files in directory and descendents. Puts them in @files $File::Find::name = ''; my $wanted = sub { push @files,$File::Find::name if -f $_ }; if ($opts{'L'}) { find({ wanted => $wanted, follow => 1, follow_skip => 2 }, $arg); } else { find({ wanted => $wanted }, $arg); } } else { # Ignore unknown file types } } return @files; } #------------------------------------------------------------------------------- sub Same_Inode { my $fh1 = shift; my $fh2 = shift; return 0 unless defined $fh1 && defined $fh2; my ($device1, $inode1) = (stat($fh1))[0,1]; my ($device2, $inode2) = (stat($fh2))[0,1]; return $device1 == $device2 && $inode1 == $inode2; } #------------------------------------------------------------------------------- sub Validate_Files_Are_Not_Output { my @files = @_; foreach my $file (@files) { my $fh = new FileHandle($file); if (Same_Inode($fh, *STDOUT)) { Report_And_Exit("Input file $file is also standard output"); } if (Same_Inode($fh, *STDERR)) { Report_And_Exit("Input file $file is also standard error"); } } } #------------------------------------------------------------------------------- sub Handle_Input_Files { my $pattern = pop @_; my @files = @_; # For each input file... foreach my $file (@files) { dprint '#'x70; dprint "Processing file $file"; # First of all, silently ignore empty files... next if -z $file; # ...and also ignore directories. if (-d $file) { warn "grepmail: Skipping directory: '$file'\n" unless $opts{'q'}; next; } $file = Search_Mailbox_Directories($file) unless -f $file; Process_Mail_File(undef,$file,$#files+1,$pattern); } } #------------------------------------------------------------------------------- sub Search_Mailbox_Directories { my $file = shift; my @maildirs; push @maildirs, $ENV{'MAILDIR'} if defined $ENV{'MAILDIR'} && -d $ENV{'MAILDIR'}; push @maildirs, "$ENV{HOME}/mail" if defined $ENV{'HOME'} && -d "$ENV{HOME}/mail"; push @maildirs, "$ENV{HOME}/Mail" if defined $ENV{'HOME'} && -d "$ENV{HOME}/Mail"; push @maildirs, "$ENV{HOME}/Mailbox" if defined $ENV{'HOME'} && -d "$ENV{HOME}/Mailbox"; foreach my $mail_folder (@maildirs) { my $path_and_file = "$mail_folder/$file"; return $path_and_file if -e $path_and_file; } return $file; } #------------------------------------------------------------------------------- sub Handle_Standard_Input { my $pattern = shift; dprint "Handling STDIN"; # We have to implement our own -B and -s, because STDIN gets eaten by them binmode STDIN; my $fileHandle = new FileHandle; $fileHandle->open('-'); Process_Mail_File($fileHandle,undef,1,$pattern); } #------------------------------------------------------------------------------- # This algorithm is complicated by code to short-circuit some # computations. For example, if the user specified -h but not -b, when # we can analyze the header for a match and avoid needing to search # the body, which may be much larger. sub Do_Simple_Pattern_Matching { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $fileName = shift; my $number_files = shift; my $numberOfMatches = shift; my $line = shift; my $endline = shift; my $pattern = shift; die unless ref $email_header && ref $email_body; return ($CONTINUE,$numberOfMatches) if $pattern eq $NO_PATTERN; dprint "Checking for early match or abort based on header information." if $opts{'D'}; my ($result,$matchesHeader) = Analyze_Header($email_header,$email_body,$fileHandle,$pattern,1,$endline); if ($result == $SKIP) { dprint "Doing an early abort based on header." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } if ($result == $PRINT) { dprint "Doing an early printout based on header." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- my $matchesBody = 0; my $signature_offset = undef; if ($opts{'S'}) { my $signature_pattern = $opts{'X'}; $signature_pattern =~ s#\$#$/#; if ($$email_body =~ m/($signature_pattern)/mg) { $signature_offset = pos($$email_body) - length($1); pos($$email_body) = 0; dprint "Signature offset: $signature_offset"; } } # Ignore the MIME attachments if -M was specified if ($opts{'M'} && ($$email_header =~ /^Content-Type:.*?boundary=(?:"([^"]*)"|([^\r\n]*))/ism)) { my $boundary; $boundary = $1 if defined $1; $boundary = $2 if defined $2; dprint "Found attachments with boundary:\n $boundary" if $opts{'D'}; my @attachment_positions; # Get each of the binary attachment beginnings and endings. while ($$email_body =~ m/\n((?:--)?\Q$boundary\E(?:--)?$endline(?:(.*?)$endline$endline)?)/sg) { my $header = $2; # The beginning of this attachment is the end of the previous. $attachment_positions[$#attachment_positions]{'end'} = pos($$email_body) - length($1) if @attachment_positions; $attachment_positions[$#attachment_positions+1]{'beginning'} = pos($$email_body); # If it's the beginning of a binary attachment, store the position if (defined $header && $header =~ /^Content-Type:\s+(?!text)/i) { $attachment_positions[-1]{'type'} = 'binary'; } else { $attachment_positions[-1]{'type'} = 'text'; } } # The last boundary terminates the attachments. pop @attachment_positions; @attachment_positions = grep { $_->{'type'} eq 'binary' } @attachment_positions; pos($$email_body) = 0; # Now search the body, ignoring any matches in binary # attachments. # Avoid perl 5.6 bug which causes spurious warning even though # $pattern is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; SEARCH: while ($$email_body =~ m/($pattern)/omg) { my $position = pos($$email_body) - length($1); last SEARCH if $opts{'S'} && defined $signature_offset && $position > $signature_offset; foreach my $attachment (@attachment_positions) { next SEARCH if ($position > $attachment->{'beginning'} && $position < $attachment->{'end'}); } $matchesBody = 1; last; } pos($$email_body) = 0; } else { # Avoid perl 5.6 bug which causes spurious warning even though # $pattern is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; pos($$email_body) = 0; if ($$email_body =~ m/($pattern)/omg) { my $position = pos($$email_body) - length($1); $matchesBody = 1 unless $opts{'S'} && defined $signature_offset && $position > $signature_offset; } pos($$email_body) = 0; } #---------------------------------------------------------------- my $matchesSize = Is_In_Size($email_header,$email_body,$sizeRestriction,$size1,$size2); #---------------------------------------------------------------- dprint "Checking for early match or abort based on header, body, " . "and size information." if $opts{'D'}; my $isMatch = 1; $isMatch = 0 if $opts{'s'} && !$matchesSize || $opts{'b'} && !$matchesBody || $opts{'h'} && !$matchesHeader || !$opts{'b'} && !$opts{'h'} && !($matchesBody || $matchesHeader); if (!$isMatch && !$opts{'v'}) { dprint "Doing an early abort based on header, body, and size." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } elsif (!$isMatch && $opts{'v'}) { dprint "Doing an early printout based on header, body, and size." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- dprint "Checking date constraint." if $opts{'D'}; $isMatch = 1; { my $matchesDate = Email_Matches_Date($email_header,$endline); $isMatch = 0 if defined $opts{'d'} && !$matchesDate; dprint "Email matches date constraint\n" if $opts{'D'} && defined $opts{'d'} && $matchesDate; dprint "Email doesn't match date constraint\n" if $opts{'D'} && defined $opts{'d'} && !$matchesDate; } $isMatch = !$isMatch if $opts{'v'}; # If the match occurred in the right place... if ($isMatch) { dprint "Email matches all patterns and constraints." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; } } else { dprint "Email did not match all patterns and constraints." if $opts{'D'}; } return ($CONTINUE,$numberOfMatches); } #------------------------------------------------------------------------------- # This algorithm is complicated by code to short-circuit some # computations. For example, if the user specified -h but not -b, when # we can analyze the header for a match and avoid needing to search # the body, which may be much larger. sub Do_Complex_Pattern_Matching { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $fileName = shift; my $number_files = shift; my $numberOfMatches = shift; my $line = shift; my $endline = shift; my $pattern = shift; die unless ref $email_header && ref $email_body; return ($CONTINUE,$numberOfMatches) if $pattern eq $NO_PATTERN; dprint "Checking for early match or abort based on header information." if $opts{'D'}; my ($result,$matchesHeader) = Analyze_Header($email_header,$email_body,$fileHandle,$pattern,0,$endline); if ($result == $SKIP) { dprint "Doing an early abort based on header." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } if ($result == $PRINT) { dprint "Doing an early printout based on header." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- my $modified_pattern = $pattern; $modified_pattern =~ s/\$email_header\b/\$\$email_header/g; $modified_pattern =~ s/\$email_body\b/\$\$email_body/g; $modified_pattern =~ s#(=~\s*)/(.*?(? $opts{'C'} } ) if $USE_CACHING; $USE_CACHING = 0 if $USE_CACHING && $setup_result ne 'ok'; my $folder_reader = new Mail::Mbox::MessageParser( { 'file_name' => $fileName, 'file_handle' => $fileHandle, 'enable_cache' => $USE_CACHING, 'enable_grep' => $USE_GREP, 'force_processing' => $opts{'F'}, 'debug' => $opts{'D'}, } ); unless (ref $folder_reader) { my $error = $folder_reader; # Catch fatal errors if ($error eq 'No data on filehandle') { Report_And_Exit('No data on standard input'); } elsif ($error eq 'Not a mailbox') { unless($opts{'q'}) { if (defined $fileName) { warn "grepmail: \"$fileName\" is not a mailbox, skipping\n" } else { warn "grepmail: Standard input is not a mailbox, skipping\n" } } return; } else { warn "grepmail: $error, skipping\n" unless $opts{'q'}; return; } } my $numberOfMatches = 0; my $endline = $folder_reader->endline(); local $/ = $endline; my $modified_pattern = $pattern; $modified_pattern =~ s#\$([^\w]|$)#$/$1#; # This is the main loop. It's executed once for each email while(!$folder_reader->end_of_file()) { dprint "Reading email" if $opts{'D'}; my $email = $folder_reader->read_next_email(); # Direct access for performance reasons #my $line = $folder_reader->line_number(); my $line = $folder_reader->{'email_line_number'}; my ($email_header,$email_body); { my $end_of_header; my $newlines_position = index($$email,"$endline$endline"); if ($newlines_position != -1) { $end_of_header = $newlines_position+length("$endline$endline"); } else { $end_of_header = length($$email); } $$email_header = substr($$email,0,$end_of_header); $email_body = $email; substr($$email_body,0,$end_of_header) = ''; } Print_Email_Statistics($email_header,$email_body,$endline) if $opts{'D'}; #---------------------------------------------------------------- if ($opts{'E'}) { my $result; ($result, $numberOfMatches) = Do_Complex_Pattern_Matching($email_header, $email_body, $fileHandle, $fileName, $number_files, $numberOfMatches, $line, $endline, $modified_pattern); return if $result == $DONE; } else { my $result; ($result, $numberOfMatches) = Do_Simple_Pattern_Matching($email_header, $email_body, $fileHandle, $fileName, $number_files, $numberOfMatches, $line, $endline, $modified_pattern); return if $result == $DONE; } } print Get_Filename($fileName).": $numberOfMatches\n" if $opts{'r'}; } #------------------------------------------------------------------------------- # Checks that an email is not a duplicate of one already printed. This should # only be called when $opts{'u'} is true. Also, as a side-effect, it updates # the %message_ids_seen when it sees an email that hasn't been printed yet. { my $tried_to_load_digest_md5; sub Not_A_Duplicate { my $email_header = shift; die unless ref $email_header; my ($message_id) = $$email_header =~ /^Message-Id:\s*<([^>]+)>/mi; if (defined $message_id) { dprint "Checking uniqueness of message id: $message_id"; } else { dprint "Email does not have a message id"; # Try to load Digest::MD5 if we haven't already unless (defined $tried_to_load_digest_md5) { $tried_to_load_digest_md5 = 1; if (eval {require Digest::MD5}) { dprint "Digest::MD5 VERSION: $Digest::MD5::VERSION"; # To prevent warning about variable being used only once my $dummy = $Digest::MD5::VERSION; } else { dprint "Digest::MD5 could not be loaded"; } } # Now create a message id if (defined $Digest::MD5::VERSION) { $message_id = Digest::MD5::md5_hex($$email_header); dprint "Generated message id $message_id with Digest::MD5"; } else { $message_id = $$email_header; dprint "Using email header as message id."; } } my $result; if (exists $message_ids_seen{$message_id}) { $result = 0; dprint "Found duplicate message"; } else { $result = 1; dprint "Found non-duplicate message"; $message_ids_seen{$message_id} = 1; } return $result; } } #------------------------------------------------------------------------------- # - Returns header lines in the email header which match the given name. # - Example names: 'From:', 'Received:' or 'From ' # - If the calling context wants a list, a list of the matching header lines # are returned. Otherwise, the first (and perhaps only) match is returned. # - Wrapped lines are handled. Look for multiple \n's in the return value(s) # - 'From ' also looks for Gnus 'X-From-Line:' or 'X-Draft-From:' sub Get_Header_Field { my $email_header = shift; my $header_name = shift; my $endline = shift; die unless ref $email_header; # Avoid perl 5.6 bug which causes spurious warning even though $email_header # is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; if ($header_name =~ /^From$/i && $$email_header =~ /^((?:From\s|X-From-Line:|X-Draft-From:).*$endline(\s.*$endline)*)/im) { return wantarray ? ($1) : $1; } my @matches = $$email_header =~ /^($header_name\s.*$endline(?:\s.*$endline)*)/igm; if (@matches) { return wantarray ? @matches : shift @matches; } if (lc $header_name eq 'from ' && $$email_header =~ /^(From\s.*$endline(\s.*$endline)*)/im) { return wantarray ? ($1) : $1; } return undef; ## no critic (ProhibitExplicitReturnUndef) } #------------------------------------------------------------------------------- # Print the email author and subject, given a reference to an email header. sub Print_Email_Statistics { my $email_header = shift; my $email_body = shift; my $endline = shift; die unless ref $email_header && ref $email_body; dprint '-'x70; dprint "Processing email:"; my $message_id = Get_Header_Field($email_header,'Message-Id:',$endline); if (defined $message_id) { dprint " $message_id"; } else { dprint " [No message id line found]"; } my $author = Get_Header_Field($email_header,'From:',$endline); $author = Get_Header_Field($email_header,'From ',$endline) unless defined $author; if (defined $author) { dprint " $author"; } else { dprint " [No from line found]"; } my $subject = Get_Header_Field($email_header,'Subject:',$endline); if (defined $subject) { dprint " $subject"; } else { dprint " [No subject line found]"; } my $date = Get_Header_Field($email_header,'Date:',$endline); if (defined $date) { dprint " $date"; } else { dprint " [No subject line found]"; } dprint " Size: " . (length($$email_header) + length($$email_body)); } #------------------------------------------------------------------------------- # Returns: # A result: # - $PRINT if the email is a match and we need to print it # - $SKIP if we should skip the current email and go on to the next one # - $CONTINUE if we need to keep processing the email. # A boolean for whether the header matches the pattern. # A boolean for whether the header has the correct date. # It turns out that -h, -b, -d, -s , -j, and -v have some nasty feature # interaction. The easy cases are when a constraint is not met--either we skip # if -v is not specified, or we print if -v is specified. # # If a constraint *is* met, we can still do an early abort of there are no other # constraints, or if we know the values of previously checked constraints. # # Finally, -b must be taken into account when analyzing -h matching. Also, we # don't analyze the date here because it is too darn slow. sub Analyze_Header { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $pattern = shift; my $doHeaderMatch = shift; my $endline = shift; die unless ref $email_header && ref $email_body; # See if the email fails the status flag restriction my $matchesStatus = 1; if ($opts{'j'}) { foreach my $flag (split //,$opts{'j'}) { $matchesStatus = 0 unless $$email_header =~ /^Status: .*(?i:$flag)/m; } # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesStatus; return ($PRINT,1) if $opts{'v'} && !$matchesStatus; # If we know there are no other constraints return ($PRINT,1) if !$opts{'v'} && $matchesStatus && !$opts{'s'} && !defined $opts{'d'} && $pattern eq '.'; return ($SKIP,0) if $opts{'v'} && $matchesStatus && !$opts{'s'} && !defined $opts{'d'} && $pattern eq '.'; } # See if the email header fails the size restriction. my $matchesSize = 1; if ($opts{'s'}) { $matchesSize = 0 if !Is_In_Size($email_header,$email_body,$sizeRestriction,$size1,$size2); # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesSize; return ($PRINT,1) if $opts{'v'} && !$matchesSize; # If we know there are no other constraints, or we know their values return ($PRINT,1) if !$opts{'v'} && $matchesSize && $matchesStatus && !defined $opts{'d'} && $pattern eq '.'; return ($SKIP,0) if $opts{'v'} && $matchesSize && $matchesStatus && !defined $opts{'d'} && $pattern eq '.'; } if ($doHeaderMatch) { # See if the header matches the pattern # Avoid perl 5.6 bug which causes spurious warning even though $pattern is # defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; my $matchesHeader = Header_Matches_Pattern($email_header,$pattern,$endline); if ($opts{'h'}) { # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesHeader; return ($PRINT,1) if $opts{'v'} && !$matchesHeader; } # If we know there are no other constraints, or we know their values return ($PRINT,1) if !$opts{'v'} && $matchesHeader && $matchesSize && $matchesStatus && !defined $opts{'d'} && !$opts{'b'}; return ($SKIP,0) if $opts{'v'} && $matchesHeader && $matchesSize && $matchesStatus && !defined $opts{'d'} && !$opts{'b'}; return ($CONTINUE,$matchesHeader); } else { return ($CONTINUE,1); } } #------------------------------------------------------------------------------- my $header_pattern = undef; sub Header_Matches_Pattern { my $email_header = ${shift @_}; my $pattern = shift; my $endline = shift; return ($email_header =~ /$pattern/om) || 0 unless $opts{'Y'}; dprint "Searching individual headers."; $email_header =~ s/\n(\s+)/$1/g; unless (defined $header_pattern) { $header_pattern = $opts{'Y'}; for my $special_header_pattern (keys %HEADER_PATTERNS) { $header_pattern =~ s/\Q$special_header_pattern\E/$HEADER_PATTERNS{$special_header_pattern}/g; } # Make the pattern insensitive if we need to $header_pattern = "(?i)$header_pattern" if ($opts{'i'}); } for my $header (split(/$endline/, $email_header)) { if ($header =~ /$header_pattern/) { dprint "Header matched header pattern:\n $header\n"; return 1 if $header =~ /$pattern/om; } } return 0; } #------------------------------------------------------------------------------- sub Convert_Email_To_Mbox_And_Print_It { my $fileName = shift; my $email_header = shift; my $email_body = shift; my $number_files = shift; my $line_number = shift; my $endline = shift; ($email_header,$email_body) = Convert_Email_To_Mbox($email_header,$email_body); Print_Email($fileName,$email_header,$email_body,$number_files,$line_number, $endline); } #------------------------------------------------------------------------------- sub Convert_Email_To_Mbox { my $email_header = shift; my $email_body = shift; dprint "Making email mbox format."; # Check for a Gnus email $$email_header =~ s/^(X-From-Line|X-Draft-From):\s+/From /; return ($email_header,$email_body); } #------------------------------------------------------------------------------- sub Get_Filename { my $fileName = shift; if (defined $fileName) { return "$fileName"; } else { return "(standard input)"; } } #------------------------------------------------------------------------------- sub Print_Email { my $fileName = shift; my $email_header = shift; my $email_body = shift; my $number_files = shift; my $line_number = shift; my $endline = shift; dprint "Printing email."; if ($opts{'n'}) { # Print header-by-header my @headers = $$email_header =~ /^(.*$endline(?:\s.*$endline)*)/gm; foreach my $header (@headers) { # Add the mailfolder to the headers if -m was given. Careful # about line numbers! if ($opts{'m'} && $header eq $endline) { print Get_Filename($fileName).":" if $number_files > 1; print " " x length $line_number, ":X-Mailfolder: ", Get_Filename($fileName), $endline; } # Print only 3-line header if -B if ($opts{'B'} && $header !~ /^(From\s|X-From-Line:|X-Draft-From:|From:|Date:|Subject:|$endline)/i) { $line_number += ($header =~ tr/\n//); } else { my $prefix = ''; $prefix = Get_Filename($fileName).":" if $number_files > 1; $header =~ s/^/$line_number++;$prefix . ($line_number-1) . ':'/mge; print $header; } } # Don't print the body if -H is specified if($opts{'H'}) { $line_number += ($$email_body =~ tr/\n//); return; } while ($$email_body =~ /([^\r\n]*$endline)/g) { my $line = $1; print Get_Filename($fileName).":" if $number_files > 1; print "$line_number:$line"; $line_number++; } } else { # print short headers if -B is specified if ($opts{'B'}) { print Get_Header_Field($email_header,'From ',$endline); my $date_header = Get_Header_Field($email_header,'Date:',$endline); print $date_header if defined $date_header; my $from_header = Get_Header_Field($email_header,'From:',$endline); print $from_header if defined $from_header; my $subject_header = Get_Header_Field($email_header,'Subject:',$endline); print $subject_header if defined $subject_header; print "X-Mailfolder: ".Get_Filename($fileName)."$endline$endline" if $opts{'m'}; } else { chomp $$email_header; print $$email_header; print "X-Mailfolder: ".Get_Filename($fileName).$endline if $opts{'m'}; print $endline; $$email_header .= $endline; } # Don't print the body if -H is specified return if $opts{'H'}; # Print whatever body we've read already. print $$email_body; } } #------------------------------------------------------------------------------- # Checks to see if the date in the header matches the date specification. The # date specification can be $NODATE, meaning that the email doesn't have # a Date: line. sub Email_Matches_Date { my $email_header = shift @_; my $endline = shift; die unless ref $email_header; return 1 unless defined $opts{'d'}; return 0 if $dateRestriction == $NODATE; my $received_header = Get_Header_Field($email_header, 'Received:',$endline); my $date_header = Get_Header_Field($email_header, 'Date:',$endline); my $subject_header = Get_Header_Field($email_header, 'Subject:',$endline); my $from_header = Get_Header_Field($email_header, 'From ',$endline); # Collect different date header values. We'll try each one until # we find a value that parses. my @dateValues = (); push(@dateValues, $1) if $opts{'a'} && defined $received_header && $received_header =~ /.*\;\s*(.*?)$/s; push(@dateValues, $1) if defined $date_header && $date_header =~ /^[^:]*:\s*(.*)$/s; push(@dateValues, $1) if defined $from_header && $from_header =~ /^[^ ]*\s*\S+\s+(.*)$/s; unless (scalar(@dateValues) > 0) { warn "grepmail: Couldn't find a date. Assuming email doesn't match the " . "date constraint:\n"; warn " $from_header\n" if defined $from_header; warn " $subject_header\n" if defined $subject_header; return 0; } foreach my $date (@dateValues) { $date =~ s/$endline//g; } my $emailDate = undef; foreach my $date (@dateValues) { dprint("Trying to parse date: $date"); $emailDate = str2time($date); last if defined($emailDate); } return Is_In_Date($emailDate,$dateRestriction,$date1,$date2) if defined $emailDate; warn "grepmail: Couldn't parse email date(s) [" . join("|", @dateValues) . "]. " . "Assuming message doesn't match the date constraint\n"; warn " $from_header\n" if defined $from_header; warn " $subject_header\n" if defined $subject_header; return 0; } #------------------------------------------------------------------------------- # This function tries to parse a date first with Date::Parse. If Date::Parse # can't parse the date, then the function tries to use Date::Manip to parse # it. Returns the parsed date in unix time format, or undef if it can't be # parsed. sub Parse_Date { my $date = shift; # First try to parse the date with Date::Parse; { my $parsedDate = str2time($date); return $parsedDate if defined $parsedDate; } # Then try Date::Manip, if it is installed if (defined $Date::Manip::VERSION) { my $parsedDate = Date::Manip::UnixDate(Date::Manip::ParseDate($date),'%s'); return $parsedDate if defined $parsedDate; } return undef; ## no critic (ProhibitExplicitReturnUndef) } #------------------------------------------------------------------------------- # Figure out what kind of date restriction they want, and what the dates in # question are. An empty date string results in the type of date restriction # being $NODATE. sub Process_Date { my $datestring = shift; return ($NODATE,'','') if $datestring eq ''; if ($datestring =~ /^before (.*)/i) { $dateRestriction = $BEFORE; $date1 = Parse_Date($1); $date2 = ''; Report_And_Exit "\"$1\" is not a valid date" unless defined $date1; } elsif ($datestring =~ /^(after|since)\s(.*)/i) { $dateRestriction = $AFTER; $date1 = Parse_Date($2); Report_And_Exit "\"$2\" is not a valid date" unless defined $date1; $date2 = ''; } elsif ($datestring =~ /^between (.+) and (.+)/i) { $dateRestriction = $BETWEEN; $date1 = Parse_Date($1); $date2 = Parse_Date($2); Report_And_Exit "\"$1\" is not a valid date" unless defined $date1; Report_And_Exit "\"$2\" is not a valid date" unless defined $date2; # Swap the dates if the user gave them backwards. if ($date1 > $date2) { my $temp; $temp = $date1; $date1 = $date2; $date2 = $temp; } } else { $dateRestriction = $BETWEEN; ($date1,$date2) = Parse_Date_Span($datestring); Report_And_Exit "\"$datestring\" is an invalid date specification. Use \"$0 --help\" for help" unless defined $date1; } return ($dateRestriction,$date1,$date2); } #------------------------------------------------------------------------------- sub Parse_Date_Span { my $datestring = shift; # @parsed_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @parsed_time = Date_Parse_strptime($datestring); @parsed_time = Date_Manip_strptime($datestring) if !@parsed_time && defined $Date::Manip::VERSION; # For "jan 2004" if (defined $parsed_time[3] && $parsed_time[3] > 31 && !defined $parsed_time[5]) { $parsed_time[5] = $parsed_time[3] - 1900; $parsed_time[3] = undef; } return (undef,undef) unless grep { defined } @parsed_time; # @current_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @current_time = ((localtime(time))[0..5],$parsed_time[-1]); # Starting from the largest time unit, set it to the current value as long # as it's undefined. for (my $i = -1; !defined($parsed_time[$i]); $i--) { $parsed_time[$i] = $current_time[$i]; } my @date1 = @parsed_time; my $increment_unit = 1; # Set the low date and the increment unit. Starting from the smallest time # unit, set it to the smallest value as long as it's undefined. unless (defined $date1[0]) { $date1[0] = 0; $increment_unit *= 60; unless (defined $date1[1]) { $date1[1] = 0; $increment_unit *= 60; unless (defined $date1[2]) { $date1[2] = 0; $increment_unit *= 24; unless (defined $date1[3]) { $date1[3] = 1; if (defined $date1[4]) { $increment_unit *= Number_Of_Days_In_Month($date1[4],$date1[5]); } else { $date1[4] = 0; $increment_unit *= Number_Of_Days_In_Year($date1[5]); } } } } } my $date1 = timelocal(@date1); my $date2 = timelocal(@date1)+$increment_unit; return ($date1,$date2); } #------------------------------------------------------------------------------- # http://groups.google.com/groups?selm=8FA9D001darkononenet%40206.112.192.118 # $month: 0..11; $year: CCYY sub Number_Of_Days_In_Month { my ($month, $year) = @_; ( qw(31 0 31 30 31 30 31 31 30 31 30 31) )[$month] || 28 + (($year % 100 && !($year % 4))|| !($year % 400)); } #------------------------------------------------------------------------------- sub Number_Of_Days_In_Year { my $year = @_; 365 + (($year % 100 && !($year % 4))|| !($year % 400)); } #------------------------------------------------------------------------------- sub Date_Parse_strptime { my $datestring = shift; my @parsed_time = strptime($datestring); return () unless @parsed_time; if (defined $parsed_time[3] && $parsed_time[3] > 31 && !defined $parsed_time[5]) { $parsed_time[5] = $parsed_time[3] - 1900; $parsed_time[3] = undef; } # @current_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @current_time = ((localtime(time))[0..5],$parsed_time[-1]); # Starting from the largest time unit, set it to the current value as long # as it's undefined. for (my $i = -1; !defined($parsed_time[$i]); $i--) { $parsed_time[$i] = $current_time[$i]; } foreach my $item (@parsed_time) { next unless defined $item; $item =~ s/^0+//; $item = 0 if $item eq ''; $item += 0 if $item =~ /^\d+$/; } return @parsed_time; } #------------------------------------------------------------------------------- sub Date_Manip_strptime { my $datestring = shift; my @parsed_time = Date::Manip::UnixDate(Date::Manip::ParseDate($datestring), '%S','%M','%H','%d','%m','%Y','%Z'); return () unless @parsed_time; { my $old_tz = $Date::Manip::Cnf{"TZ"}; my $parsed_time = Date::Manip::ParseDate($datestring); $Date::Manip::Cnf{"TZ"} = 'CST'; my $tz_test_1 = Date::Manip::ParseDate($datestring); $Date::Manip::Cnf{"TZ"} = 'EST'; my $tz_test_2 = Date::Manip::ParseDate($datestring); # Different lines so that CVS doesn't insert the date $Date::Manip::Cnf{"TZ"} = $old_tz; if ($parsed_time eq $tz_test_1 && $parsed_time eq $tz_test_2) { $parsed_time[-1] = undef; } } foreach my $item (@parsed_time) { next unless defined $item; $item =~ s/^0+//; $item = 0 if $item eq ''; $item += 0 if $item =~ /^\d+$/; } $parsed_time[4] -= 1 if defined $parsed_time[4]; $parsed_time[5] -= 1900 if defined $parsed_time[5]; # This is not quite correct, because we can't tell when Date::Manip sets the # time to 0 and when the user specifies it explicitely at 0:00:00. if ($parsed_time[0] == 0 && $parsed_time[1] == 0 && $parsed_time[2] == 0) { $parsed_time[0] = $parsed_time[1] = $parsed_time[2] = undef; } #Until 'Date::Manip::Date_Init("TodayIsMidnight=1");' is released if ($datestring eq 'today' || $datestring eq 'now' || $datestring eq 'yesterday') { $parsed_time[0] = $parsed_time[1] = $parsed_time[2] = undef; } return @parsed_time; } #------------------------------------------------------------------------------- # Figure out what kind of size restriction they want, and what the sizes in # question are. sub Process_Size { my $sizestring = shift; if ($sizestring =~ /^\s*(<|<=|>|>=)\s*(\d+)\s*$/i) { if ($1 eq '<') { $sizeRestriction = $LESS_THAN; } elsif ($1 eq '<=') { $sizeRestriction = $LESS_THAN_OR_EQUAL; } elsif ($1 eq '>') { $sizeRestriction = $GREATER_THAN; } elsif ($1 eq '>=') { $sizeRestriction = $GREATER_THAN_OR_EQUAL; } $size1 = $2; $size2 = ''; } elsif ($sizestring =~ /^\s*(\d+)\s*-\s*(\d+)\s*$/i) { $sizeRestriction = $BETWEEN; $size1 = $1; $size2 = $2; # Swap the sizes if the user gave them backwards. if ($size1 > $size2) { my $temp; $temp = $size1; $size1 = $size2; $size2 = $temp; } } elsif ($sizestring =~ /^\s*(\d+)\s*$/i) { $sizeRestriction = $EQUAL; $size1 = $1; $size2 = ''; } else { Report_And_Exit "\"$sizestring\" is an invalid size specification. Use \"$0 --help\" for help"; } return ($sizeRestriction,$size1,$size2); } #------------------------------------------------------------------------------- sub Is_In_Date { my $emailDate = shift @_; my $dateRestriction = shift @_; my $date1 = shift @_; my $date2 = shift @_; # Now we do the date checking. return 1 if $dateRestriction == $NONE; return $emailDate < $date1 if $dateRestriction == $BEFORE; return $emailDate > $date1 if $dateRestriction == $AFTER; return $emailDate > $date1 && $emailDate < $date2 if $dateRestriction == $BETWEEN; return 0; } #------------------------------------------------------------------------------- sub Is_In_Size { my $email_header = shift @_; my $email_body = shift @_; my $sizeRestriction = shift @_; my $size1 = shift @_; my $size2 = shift @_; die unless ref $email_header && ref $email_body; my $length = length($$email_header) + length($$email_body); # Now we do the size checking. return 1 if $sizeRestriction == $NONE; return $length < $size1 if $sizeRestriction == $LESS_THAN; return $length <= $size1 if $sizeRestriction == $LESS_THAN_OR_EQUAL; return $length > $size1 if $sizeRestriction == $GREATER_THAN; return $length >= $size1 if $sizeRestriction == $GREATER_THAN_OR_EQUAL; return $length == $size1 if $sizeRestriction == $EQUAL; return $length >= $size1 && $length <= $size2 if $sizeRestriction == $BETWEEN; return 0; } #------------------------------------------------------------------------------- sub usage { <] [-j ] [-s ] [-d ] [-X ] [-Y ] [-e] grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -E grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -f At least one of -s, -d, -u, -e, and -E must be specified, and can appear in any relative order following the other flags. The -e flag is optional if pattern appears immediately before -s or -d. Files can be plain ASCII or ASCII files compressed with gzip, bzip2, lzip, or xz. -E allows for complex pattern matches involving logical operators. If no file is provided, normal or compressed ASCII input is taken from STDIN. -a Use received date instead of sent date for -d matching -b Search must match body -B Print message bodies but with only limited headers -C Specify the location of the cache file -d Specify a required date range (see below) -D Debug mode -e Explicitly name pattern (when searching for strings beginning with "-") -E Specify a complex search expression -f Read patterns from a file -F Force processing of all data as mailboxes -h Search must match header -H Print headers but not bodies of matching emails -i Ignore case in the search expression -j Search must match status (A=answered, R=read, D=deleted, O=old, F=flagged) -l Output the names of files having an email matching the expression -L Follow symbolic links (implies -R) -M Do not search non-text mime attachments -m Append "X-Mailfolder: " to all headers to indicate in which folder the match occurred -n Print the line number info (and filename if necessary) for the emails -q Quiet mode -- don't output warnings -r Output the names of the files and the number of emails matching the expression -R Recurse directories -s Specify a size range in bytes (see below) -S Ignore signatures -u Ensure that no duplicate emails are output -v Output emails that don't match the expression -V Display the version number -w Match word boundaries -X Specify a regular expression for the signature separator -Y Specify a header to search (implies -h) --help Print a help message Date constraints require Date::Parse. Date specifications must be of the form of: - a date like "today", "1st thursday in June 1992" (requires Date::Manip), "05/18/93", "12:30 Dec 12th 1880", "8:00pm december tenth", - "before", "after", or "since", followed by a date as defined above, - "between and ", where is defined as above. Size constraints must be of the form of: - 12345: match size of exactly 12345 - <12345, <=12345, >12345, >=12345: match size less than, less than or equal, greater than, or greater than or equal to 12345 - 10000-12345: match size between 10000 and 12345 inclusive EOF } #------------------------------------------------------------------------------- =head1 NAME grepmail - search mailboxes for mail matching a regular expression =head1 SYNOPSIS grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] [[-e] |-E |-f ] =head1 DESCRIPTION =over 2 I looks for mail messages containing a pattern, and prints the resulting messages on standard out. By default I looks in both header and body for the specified pattern. When redirected to a file, the result is another mailbox, which can, in turn, be handled by standard User Agents, such as I, or even used as input for another instance of I. At least one of B<-E>, B<-e>, B<-d>, B<-s>, or B<-u> must be specified. The pattern is optional if B<-d>, B<-s>, and/or B<-u> is used. The B<-e> flag is optional if there is no file whose name is the pattern. The B<-E> option can be used to specify complex search expressions involving logical operators. (See below.) If a mailbox can not be found, grepmail first searches the directory specified by the MAILDIR environment variable (if one is defined), then searches the $HOME/mail, $HOME/Mail, and $HOME/Mailbox directories. =back =head1 OPTIONS AND ARGUMENTS Many of the options and arguments are analogous to those of grep. =over 2 =item B The pattern to search for in the mail message. May be any Perl regular expression, but should be quoted on the command line to protect against globbing (shell expansion). To search for more than one pattern, use the form "(pattern1|pattern2|...)". Note that complex pattern features such as "(?>...)" require that you use a version of perl which supports them. You can use the pattern "()" to indicate that you do not want to match anything. This is useful if you want to initialize the cache without printing any output. =item B Mailboxes must be traditional, UNIX C mailbox format. The mailboxes may be compressed by gzip, bzip2, lzip or xz, in which case the associated compression tool must be installed on the system, as well as a recent version of the Mail::Mbox::MessageParser Perl module that supports the format. If no mailbox is specified, takes input from stdin, which can be compressed or not. grepmail's behavior is undefined when ASCII and binary data is piped together as input. =item B<-a> Use arrival date instead of sent date. =item B<-b> Asserts that the pattern must match in the body of the email. =item B<-B> Print the body but with only minimal ('From ', 'From:', 'Subject:', 'Date:') headers. This flag can be used with -H, in which case it will print only short headers and no email bodies. =item B<-C> Specifies the location of the cache file. The default is $HOME/.grepmail-cache. =item B<-D> Enable debug mode, which prints diagnostic messages. =item B<-d> Date specifications must be of the form of: - a date like "today", "yesterday", "5/18/93", "5 days ago", "5 weeks ago", - OR "before", "after", or "since", followed by a date as defined above, - OR "between and ", where is defined as above. Simple date expressions will first be parsed by Date::Parse. If this fails, grepmail will attempt to parse the date with Date::Manip, if the module is installed on the system. Use an empty pattern (i.e. B<-d "">) to find emails without a "Date: ..." line in the header. Date specifications without times are interpreted as having a time of midnight of that day (which is the morning), except for "after" and "since" specifications, which are interpreted as midnight of the following day. For example, "between today and tomorrow" is the same as simply "today", and returns emails whose date has the current day. ("now" is interpreted as "today".) The date specification "after July 5th" will return emails whose date is midnight July 6th or later. =item B<-E> Specify a complex search expression using logical operators. The current syntax allows the user to specify search expressions using Perl syntax. Three values can be used: $email (the entire email message), $email_header (just the header), or $email_body (just the body). A search is specified in the form "$email =~ /pattern/", and multiple searches can be combined using "&&" and "||" for "and" and "or". For example, the expression $email_header =~ /^From: .*\@coppit.org/ && $email =~ /grepmail/i will find all emails which originate from coppit.org (you must escape the "@" sign with a backslash), and which contain the keyword "grepmail" anywhere in the message, in any capitalization. B<-E> is incompatible with B<-b>, B<-h>, and B<-e>. B<-i>, B<-M>, B<-S>, and B<-Y> have not yet been implemented. NOTE: The syntax of search expressions may change in the future. In particular, support for size, date, and other constraints may be added. The syntax may also be simplified in order to make expression formation easier to use (and perhaps at the expense of reduced functionality). =item B<-e> Explicitly specify the search pattern. This is useful for specifying patterns that begin with "-", which would otherwise be interpreted as a flag. =item B<-f> Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. =item B<-F> Force grepmail to process all files and streams as though they were mailboxes. (i.e. Skip checks for non-mailbox ASCII files or binary files that don't look like they are compressed using known schemes.) =item B<-h> Asserts that the pattern must match in the header of the email. =item B<-H> Print the header but not body of matching emails. =item B<-i> Make the search case-insensitive (by analogy to I). =item B<-j> Asserts that the email "Status:" header must contain the given flags. Order and case are not important, so use I<-j AR> or I<-j ra> to search for emails which have been read and answered. =item B<-l> Output the names of files having an email matching the expression, (by analogy to I). =item B<-L> Follow symbolic links. (Implies I<-R>) =item B<-M> Causes grepmail to ignore non-text MIME attachments. This removes false positives resulting from binaries encoded as ASCII attachments. =item B<-m> Append "X-Mailfolder: " to all email headers, indicating which folder contained the matched email. =item B<-n> Prefix each line with line number information. If multiple files are specified, the filename will precede the line number. NOTE: When used in conjunction with B<-m>, the X-Mailfolder header has the same line number as the next (blank) line. =item B<-q> Quiet mode. Suppress the output of warning messages about non-mailbox files, directories, etc. =item B<-r> Generate a report of the names of the files containing emails matching the expression, along with a count of the number of matching emails. =item B<-R> Causes grepmail to recurse any directories encountered. =item B<-s> Return emails which match the size (in bytes) specified with this flag. Note that this size includes the length of the header. Size constraints must be of the form of: - 12345: match size of exactly 12345 - <12345, <=12345, >12345, >=12345: match size less than, less than or equal, greater than, or greater than or equal to 12345 - 10000-12345: match size between 10000 and 12345 inclusive =item B<-S> Ignore signatures. The signature consists of everything after a line consisting of "-- ". =item B<-u> Output only unique emails, by analogy to I. Grepmail determines email uniqueness by the Message-ID header. =item B<-v> Invert the sense of the search, by analogy to I. This results in the set of emails printed being the complement of those that would be printed without the B<-v> switch. =item B<-V> Print the version and exit. =item B<-w> Search for only those lines which contain the pattern as part of a word group. That is, the start of the pattern must match the start of a word, and the end of the pattern must match the end of a word. (Note that the start and end need not be for the I word.) If you are familiar with Perl regular expressions, this flag simply puts a "\b" before and after the search pattern. =item B<-X> Specify a regular expression for the signature separator. By default this pattern is '^-- $'. =item B<-Y> Specify a pattern which indicates specific headers to be searched. The search will automatically treat headers which span multiple lines as one long line. This flag implies B<-h>. In the style of procmail, special strings in the pattern will be expanded as follows: =over 2 If the regular expression contains "^TO:" it will be substituted by ^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To): which should match all headers with destination addresses. If the regular expression contains "^FROM_DAEMON:" it will be substituted by (^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)? which should catch mails coming from most daemons. If the regular expression contains "^FROM_MAILER:" it will be substituted by (^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From)([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t][^<)]*(\(.*\).*)?)?$([^>]|$)) (a stripped down version of "^FROM_DAEMON:"), which should catch mails coming from most mailer-daemons. So, to search for all emails to or from "Andy": grepmail -Y '(^TO:|^From:)' Andy mailbox =back =item B<--help> Print a help message summarizing the usage. =item B<--> All arguments following I<--> are treated as mail folders. =back =head1 EXAMPLES Count the number of emails. ("." matches every email.) grepmail -r . sent-mail Get all email between 2000 and 3000 bytes about books grepmail books -s 2000-3000 sent-mail Get all email that you mailed yesterday grepmail -d yesterday sent-mail Get all email that you mailed before the first thursday in June 1998 that pertains to research (requires Date::Manip): grepmail research -d "before 1st thursday in June 1998" sent-mail Get all email that you mailed before the first of June 1998 that pertains to research: grepmail research -d "before 6/1/98" sent-mail Get all email you received since 8/20/98 that wasn't about research or your job, ignoring case: grepmail -iv "(research|job)" -d "since 8/20/98" saved-mail Get all email about mime but not about Netscape. Constrain the search to match the body, since most headers contain the text "mime": grepmail -b mime saved-mail | grepmail Netscape -v Print a list of all mailboxes containing a message from Rodney. Constrain the search to the headers, since quoted emails may match the pattern: grepmail -hl "^From.*Rodney" saved-mail* Find all emails with the text "Pilot" in both the header and the body: grepmail -hb "Pilot" saved-mail* Print a count of the number of messages about grepmail in all saved-mail mailboxes: grepmail -br grepmail saved-mail* Remove any duplicates from a mailbox: grepmail -u saved-mail Convert a Gnus mailbox to mbox format: grepmail . gnus-mailbox-dir/* > mbox Search for all emails to or from an address (taking into account wrapped headers and different header names): grepmail -Y '(^TO:|^From:)' my@email.address saved-mail Find all emails from postmasters: grepmail -Y '^FROM_MAILER:' . saved-mail =head1 FILES grepmail will I create temporary files while decompressing compressed archives. The last version to do this was 3.5. While the new design uses more memory, the code is much simpler, and there is less chance that email can be read by malicious third parties. Memory usage is determined by the size of the largest email message in the mailbox. =head1 ENVIRONMENT The MAILDIR environment variable can be used to specify the default mail directory. This directory will be searched if the specified mailbox can not be found directly. The HOME environment variable is also used to find mailboxes if they can not be found directly. It is also used to store grepmail state information such as its cache file. =head1 BUGS AND LIMITATIONS =over 2 =item Patterns containing "$" may cause problems Currently I look for "$" followed by a non-word character and replace it with the line ending for the current file (either "\n" or "\r\n"). This may cause problems with complex patterns specified with -E, but I'm not aware of any. =item Mails without bodies cause problems According to RFC 822, mail messages need not have message bodies. I've found and removed one bug related to this. I'm not sure if there are others. =item Complex single-point dates not parsed correctly If you specify a point date like "September 1, 2004", grepmail creates a date range that includes the entire day of September 1, 2004. If you specify a complex point date such as "today", "1st Monday in July", or "9/1/2004 at 0:00" grepmail may parse the time incorrectly. The reason for this problem is that Date::Manip, as of version 5.42, forces default values for parsed dates and times. This means that grepmail has a hard time determining whether the user supplied certain time/date fields. (e.g. Did Date::Manip provide a default time of 0:00, or did the user specify it?) grepmail tries to work around this problem, but the workaround is inherently incomplete in some rare cases. =item File names that look like flags cause problems. In some special circumstances, grepmail will be confused by files whose names look like flags. In such cases, use the B<-e> flag to specify the search pattern. =back =head1 LICENSE This code is distributed under the GNU General Public License (GPL) Version 2. See the file LICENSE in the distribution for details. =head1 AUTHOR David Coppit Edavid@coppit.orgE =head1 SEE ALSO elm(1), mail(1), grep(1), perl(1), printmail(1), Mail::Internet(3), procmailrc(5). Crocker, D. H., Standard for the Format of Arpa Internet Text Messages, RFC 822. =cut grepmail-5.3111/LICENSE000644 000765 000024 00000043502 13321551653 015062 0ustar00coppitstaff000000 000000 This software is Copyright (c) 2018 by David Coppit. This is free software, licensed under: The GNU General Public License, Version 2, June 1991 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. grepmail-5.3111/CHANGES000644 000765 000024 00000104136 13321551056 015046 0ustar00coppitstaff000000 000000 Version 5.3111: - Fix Makefile.PL warning - Fix deleting of inc during release process - Better fix for AutomatedTester warning Version 5.3110: - Fix test case for binary data - Updating META.yml Version 5.3109: - Switch to File::Slurper Version 5.3108: - Disable "check redirect to input file" feature on Windows, where apparently it doesn't work. Version 5.3107: - Trying once again to fix the compile test on windows Version 5.3106: - Check in standard tests, including one that skips the compile check on Windows - Attempt to be more compatible with CPAN testing, which apparently doesn't support symlinks Version 5.3105: - Add standard tests - Search headers of attachments, such as filename. Thanks Jim Diamond for the suggestion. - Detect when someone accidentally makes STDOUT or STDERR also an input file. Thanks to Ta SA for the feature suggestion. - Fix compatibility issue with newer versions of perl, which remove "." from @INC. Version 5.3104: Sat May 2 2015 - Prevent CPAN from indexing private-lib Version 5.3103: Apr 26 2015 - Clarify licensing terms - Don't install private Module::Install extension. Thanks to Paul Howarth for the bug report in another module. https://rt.cpan.org/Ticket/Display.html?id=103482 - Move verbose testing to a private module, and implement it in a way that doesn't require editing the Makefile after it is generated. - Require File::Slurp instead of including it, to avoid potential problems like this: http://www.cpantesters.org/cpan/report/86a0145a-e52b-11e4-a1d1-8536eb4f9f07 - Miscellaneous fixes for Windows compatibility. This includes weaking the invalid mailbox test so that it only looks for output from grepmail, and not any "broken pipe" message from the OS. Version 5.3102: Sun Apr 12 2015 - Force the user to upgrade their Time::Local, to work around bugs in the stock version that came with old OSes like RHEL 5. http://www.cpantesters.org/cpan/report/61043eda-dd0e-11e4-abc4-b553e14af301 - Enable verbose testing for CPAN-testers - Consolidate issue tracking at rt.cpan.org Version 5.3101: Sat Apr 4 2015 - Add explicit include for Module::AutoInstall. Thanks to Paul Howarth for the report. https://code.google.com/p/grepmail/issues/detail?id=1 - Improve the recursive.t test. https://code.google.com/p/grepmail/issues/detail?id=2 Thanks to Paul Howarth for the bug report. - Add explicit "provides" to META.yml so that CPAN will allow me to upload this distribution. Version 5.3100 was rejected. Thanks to David Golden for helping me to figure out the problem. Version 5.3100: Tue Mar 24 2015 - Move code to github - Fixed a bug where complex -E search patterns containing '\/' would fail to match emails properly. (Thanks to Cristian Ionescu-Idbohrn for the bug report via Debian's bug tracker.) - Add POD test - Update tests to use Config{perlpath} for better compatibility with automated testing. - Prevent MakeMaker from recursing into any "old" directory - Fix t/invalid_date.t to work even when Date::Manip is not installed. - Fix t/nonexistent_mailbox.t -- broken STDIN does not cause $SIG{PIPE} - Dropped tzip support - Added lzip support. http://sourceforge.net/p/grepmail/patches/8/ Thanks to the anonymous contributor. - Added xz support. - Fix incompatibility with newer versions of Date::Manip. https://rt.cpan.org/Ticket/Display.html?id=54621. Thanks to Paul Howarth for the report and patch. Version 5.3034: Sun Aug 16 2009 - Fixed man page year typo. Closes: Debian bug #428973 (Thanks to Joes Hess for the patch) - Updated to the latest version of Module::Install - Moved hosting to Google Code - Added my old TODO to the distribution, adding a number of feature requests from SourceForge - Fixed a bug where grepmail would abort if the links traversed with -L caused a directory to be encountered more than once. - Fixed a bug in the -R test that would cause the test to fail when it should not. - Fixed uninitialized variable warnings for emails missing the Date:, Subject:, or From: headers (Thanks to Steven W. Orr for the bug report.) Version 5.3033: Thu Mar 01 2007 - Improved the documentation for -Y. (Thanks to Justin Gombos for the suggestion.) - Dropped tzip support in Mail::Mbox::MessageParser - Added -L flag to follow symbolic links. (Thanks to Peter Teuben for prompting the idea.) - Fixed grepmail so that it works with Mail::Mbox::MessageParser 1.5000 (Thanks to Paul Howarth for the bug report, and Alexey Tourbin for the fix.) - Fixed testspeed.pl to properly call report() instead of get_report() on new versions of Benchmark::Timer Version 5.3032: Tue Aug 2 2005 - Fixed backwards diff in test cases - Updated Mail::Mbox::MessageParser dependency to latest version, and updated test cases as well. (Thanks to Christoph Thiel for the heads up.) Version 5.3031: Mon Jun 6 2005 - Fixed a bug that would cause the date_manip test to fail in some time zones. (Thanks to Kurt Roeckx for the Debian bug report, and Joey Hess for notifying me.) - Added a missing "use" statement in Test::Utils. - Improved date matching for mailboxes containing invalid dates. (Thanks to Steve Revilak for the patch.) Version 5.3030: Tue Dec 21 2004 - Improved test failure reporting - Fixed version numbers, which were incompatible with some modules. (Thanks to Tassilo von Parseval for the bug report) - Cleaned up code a bit Version 5.30.2: - Switched to Test::More for better test reporting Version 5.30.1: Thu Sep 16 2004 - Fixed Date::Manip parsing of single-point times such as "today". (Bug found by Marten van Wezel ) - Changed Makefile.PL to use Module::Install - Changed version numbering - Dropped Benchmark::Timer from the distribution, since the updated version has been released New in version 5.30: - Updated t/recursive.t to work better when there are version control directories in t/mailboxes/directory. (Thanks to Joey Hess for the feature suggestion and initial patch.) - Updated t/invalid_mailbox.t to be more robust. (Thanks to an anonymous bug report on SourceForge.) - Fixed a bug in t/invalid_mailbox.t for Solaris. (Thanks to Jost Krieger for the bug report.) - -F now works again (Thanks to Graham Gough for the bug report.) - Changed incorrect "-h" to "--help" in two error messages. (Thanks to David Sewell for catching this.) - Now correctly handles DOS-style line endings in mailboxes. (Thanks to Martin Hosken for the initial patch.) Requires Mail::Mbox::MessageParser 1.20 or better now. - Changed single dates so that they are treated as inferred spans, instead of a single day. For example "2004" now means "between Jan 1 2004 and Jan 1 2005" instead of "between Jan 1 2004 and Jan 2 2004". (Thanks to Dan Pritts for the feature suggestion.) New in version 5.23: - Updated test cases to run under Windows. - Fixed a bug in speed tests which would cause the grep implementation to fail. - Fixed incorrect output for emails without message bodies. (Thanks to Volker Kuhlmann for the bug report.) - Fixed filename output for -n, -m and other situations when input comes from standard input. (Thanks to an anonymous submittor on SourceForge for an initial patch.) - Added -w flag to match word boundaries. (Thanks to Ed Avis for the feature request.) - A warning is now issued and caching is disabled if -C is not specified and $HOME is not set (as might be the case when running grepmail in a cron job). (Thanks to Dr. Oliver Muth for the bug report.) New in version 5.22: - X-Mailfolder header no longer has a line number when -n is used. (bugfix by Kevin Pfeiffer ) - New -B flag prints abbreviated headers (initial patch by Kevin Pfeiffer ) - Headers spanning multiple lines are now printed correctly in warnings and such. - Fixed a spurious warning which would be printed if caching was not enabled. - grepmail will now disable caching if the caching version of Mail::Mbox::MessageParser can not be loaded, instead of exiting. New in version 5.21: - Fixed line ending bugs under MS-DOS/Windows. New in version 5.20: - Added speed testing to the distribution - Fixed Makefile.PL so that test modules would not be installed. - Changed testing to use PERLRUN instead of FULLPERLRUN, which is not available with older versions of MakeMaker that ship with older versions of Perl. (Thanks to Ed Avis for catching this.) - Fixed interactive installation problems. (Thanks to Joey Hess for catching this (again).) - Fixed broken searching of $HOME/mail, $HOME/Mail, and $HOME/Mailbox directories when a mail folder can not be found. Changed $MAIL to $MAILDIR since $MAIL usually points to the user's inbox. (Bug found and initial patch by Peter Cordes .) - Cache file permissions are now set to protect against prying eyes. (Patch by Joey Hess ) - The user can now specify the cache file location with the -C flag. - Fixed compatibility problems with perl 5.005_01 New in version 5.10: - Extracted mail parsing into the new Mail::Mbox::MessageParser module. - Fixed small performance loss bugs in short-circuit matching of headers which were introduced in the last version - Fixed some uses of uninitialized values (Originally reported by Ed Avis .) - Improved performance a bit. - The Makefile.PL now uses the default values when run non-interactively. - Caching is now enabled by default. (It's no longer experimental.) Users can disable it during installation. - Date specifications without times (e.g. "today") are interpreted as midnight of the given day instead of the current time of that day. grepmail now relies on Date::Manip to handle this--users must upgrade Date::Manip to get this support. (Thanks to Reuben Thomas for working with Sullivan Beck to get TodayIsMidnight added to Date::Manip. Original bug report by Philip Douglass ) - Restructured test cases New in version 5.00: - grepmail is now orders of magnitude faster for mailboxes which have very large (>30MB) emails in them - "grep" is now used to find the start of emails, if it is installed. For mailboxes with large emails in them, this can speed things up by about 5x. - Reduced memory consumption by about 3 times. - -- now marks the end of options and the beginning of folders (Thanks to Reuben Thomas for the idea.) - -f now reads patterns from a file like GNU grep does. (Feature suggestion by Darxus@chaosreigns.com) -j is now used for status - Added smail compatibility. (Thanks to Roy for the patch.) - The "**" prefix on warnings has been changed to "grepmail:" - Date specifications without times (e.g. "today") are interpreted as midnight of the given day instead of the current time of that day. (Bugfix and initial patch by Reuben Thomas .) - Fixed -i when used with -Y--it was always case sensitive. (Bugfix by Michael C. Toren ) - Updated t/functionality.t to avoid running gzip-related test cases when gzip is not installed on the system. - Improved some error messages so that they prepend "grepmail: " as they should - Cleaned up some warnings about ambiguous hash values (Thanks to Philip Douglass for pointing them out in a bug report.) - Added a warning about the version of perl required for new pattern features (Thanks to Philip Douglass for the bug report.) - -t flag is now -j - Fixed broken Gnus support - Improved test case for Gnus New in version 4.91: - Added missing dependency for Storable. - Storable now only necessary if you plan on using caching - Fixed a bug in test case 83 - Changed -s to support "<", ">", "<=", ">=" and "-". (Feature suggestion by Jens Schleusener ) New in version 4.90: - Made Mail::Folder::SlowReader object-oriented - Removed FastReader from distribution. (It's no longer faster! Also, I couldn't integrate it easily with the new object-oriented reader design.) - Fixed a bug where in some cases emails were not being converted to mbox format before being printed - Made searches involving header-related constraints a bit faster - Added missing documentation for -F flag - Added -f flag to search based on message status. (Feature suggestion by Richard D Alloway ) - Fixed a bug where -X and -Y flags after a pattern would not be processed - Added experimental caching capability, which is perhaps 5% slower the first time you run grepmail on a mail folder, and 10-20% faster on subsequent runs. The cache is stored in ~/.grepmail-cache. You must edit the grepmail file and set $USE_CACHING to true to use this feature. (Idea and initial patch by terry jones ) New in version 4.81: - Fixed incompatibilities with older (5.005_03) versions of Perl - Fixed test cases which fail on operating systems (shells?) which emit "Broken Pipe" to standard output. I'd rather break the pipe than have grepmail gobble megabytes of data when it can't handle it. - Added --version flag (patch by Gerald Pfeifer ) - Added documentation for -V flag. New in version 4.80: - Added prototype -E flag to support complex searches. (Thanks to Nelson Minar for the original suggestion in Sep 2000, And terry jones for seconding the idea.) - Added -F flag to force processing of files which grepmail determines are not mailboxes. (feature suggested by terry jones ) - Documentation updated to reflect that -B no longer exists. (By terry jones ) - The test to determine if a file is a mailbox was improved to adhere better to RFC 822, while still providing some flexibility. (Initial suggestion and patch by terry jones ) - Improved date extraction to also look at the 'From ' line when both the Received and Date headers fail. (patch by terry jones ) - Fixed a long-standing bug in which filenames of compressed mailboxes which contained special shell characters would cause problems. (Thanks to Jost Krieger for giving me the kick in the pants to finally fix this.) - Fixed a long-standing bug in which grepmail would incorrectly report the filename of compressed mailboxes in error messages. (Thanks to Jost Krieger for giving me the kick in the pants to finally fix this.) New in version 4.72: - 20% speed improvement in the Perl mailbox parser (By terry jones ) - Fixed a number of potential bugs in command line processing and date processing. (By terry jones ) - Cleaned up return values and use of quotes in the code. (By terry jones ) - Fixed a bug in -X signature processing (By terry jones ) - Modified anonymize_mailbox to anonymize To: and Subject: in the header. (Thanks to terry jones for the idea.) - Fixed a bug in FastReader where emails less than 255 characters in size would occasionally cause a core dump. (Thanks to terry jones for submitting a bug report and sample mailbox.) - Made "big" test mailboxes 4 times bigger for more meaningful speed tests New in version 4.71: - Fixed warning about SIGHUP on Windows. - Fixed -u functionality for emails without the Message-Id header. (Thanks to Felix E. Klee for finding the bug.) NOTE: grepmail will use Digest::MD5 to compute a hash for the email header. If you don't have Digest::MD5, grepmail will just store the header. So, the default tradeoff is time for space. - Fixed a bug in the test script. (Thanks to Joey Hess for finding and fixing the bug.) - Extended workaround for spurious warning about undefined variable to Perl 5.8. (Thanks to Joey Hess for reporting the ongoing heisenbug.) New in version 4.7: - Fixed signal handling to make grepmail easier to debug. Thanks to Ilya Zakharevich for providing the solution. - Fixed a possible performance problem in reading of emails (Perl implementation), and documented the settings in the README. - Expanded the pattern for matching the start of emails to allow different types of emails to be parsed. - Fixed a bug where -R was reported as not recognized. (Thanks to Nicholas Riley for the bug report and fix.) - "anonymize_mailbox" utility included to help people submit bug reports - If a mailbox can not be found, grepmail now searches the $home/mail, $home/Mail, $home/Mailbox directories (or the directory specified by the MAIL environment variable). (Thanks to Michael Friendly for the feature suggestion and initial patch.) - Added -X flag to allow the user to specify a pattern for the signature separator. (Thanks to Michael Friendly for the feature suggestion.) - Added -Y flag to search specific headers. (Thanks to Terry Jones for the idea to automatically wrap header lines as necessary.) New in version 4.60: - Removed -B flag and added -S flag. -B is now performed using -bS. - Added installation flags to suppress interactive installation. (Thanks to Joey Hess for the problem report. He had to patch Makefile.PL for his Debian packaging.) - Fixed a slow implementation of searching for signatures that would cause grepmail to crawl for very large emails. Thanks to Joey Hess for discovering the inefficiency. - Fixed a short-circuit which should have bypassed the search for signatures if -B was not specified. Thanks to Joey Hess for finding the bug. - Implemented a new Perl parser which is 5% to 50% faster depending on how I/O-bound your system is. - Restructured the code a bit and improved detection of invalid arguments. New in version 4.51: - grepmail now dies gracefully when invalid patterns like 'strcpy(' are supplied. (It should be 'strcpy\('.) - Fixed a bug in attachment boundary matching which would cause the boundary match to fail if the boundary contained special pattern matching characters. (Thanks to Richard Everson for identifying the bug, and providing a sample email which demonstrates the problem.) - Added a check for Inline 0.41 or better during "perl Makefile.PL" when Mail::Folder::FastReader is selected to be installed. (Thanks to Brian L. Johnson for the problem report.) - Fixed a bug where grepmail would fail to print matching emails which had signatures, and added a test case for it. This bug was introduced with -B support in version 4.49. (A *huge* thanks to Moritz Barsnick for reporting the bug and doing the initial analysis of the cause.) - Modified Makefile.PL to ask whether the user wants FastReader regardless of whether they specified arguments to "make Makefile.PL". - Modified Makefile.PL to allow the user to interactively specify the installation path. - Fixed a typo in debugging output for emails without "Date:" headers. - Improved error messages. - Usage message now displays just the flags, --help shows a summary of their meanings as well. New in version 4.50: - Added X-Draft-From to support newer versions of Gnus (Thanks to Nevin Kapur for the patch). New in version 4.49: - Fixed test cases to work around PATH modifications made by Date::Manip - Added -B to search the body but not the signature. (Thanks to Helmut Springer for the feature request.) - Added LICENSE file. (Thanks to Janet Casey for the reminder.) New in version 4.48: - Mail::Folder::FastReader migrated from XS to Inline. - -H flag added by Nevin Kapur - Error messages are localized in test cases. (Thanks to cpan-testers and in particular Jost Krieger for finding this bug and diagnosing it.) - Fixed a problem with timezones in the test cases. (Thanks to Roy Lanek for helping me debug this.) - Added a check in the test cases for determining if the user's timezone is not recognized by Date::Manip. New in version 4.47: - Grepmail now converts Gnus emails into mbox emails before printing them. (Thanks to Johan Vromans for supplying a patch and explaining the need for it. - Fixed a couple bugs in -M processing - -M is now 19% faster. (It's now only about 9% slower than without -M.) New in version 4.46: - Fixed a bug in -u message id processing. (Thanks go to an anonymous bug reporter on SourceForge.) - Added more workarounds to prevent warnings resulting from a bug in Perl 5.6 (Thanks to Joey Hess ) - Added -Z flag to tell grepmail not to use Mail::Folder::FastReader even if it is installed. - Fixed a bug introduced in version 4.44 where -m would not work unless used with -n. (Thanks to Imre Simon for catching this.) - --help anywhere on the command line now causes the help to be printed, instead of only when used as the first argument. - Test script now exercises both the Mail::Folder::FastReader and perl mailbox implementations as appropriate. - Restructured code to separate out Perl mailbox implementation as Mail::Folder::SlowReader. (This module is embedded in the grepmail script.) New in version 4.45: - Added -n and -V to usage message. (Thanks to Wolfgang Rohdewald for catching this.) - Added workarounds to prevent warnings resulting from a bug in Perl 5.6 - A blank line before the start of an email is not required now. This allows broken folders created by Netscape to be read. (Thanks to Jeremy Malcolm for the bug report.) - Mail::FastReader is 8% faster. New in version 4.44: - execution with -M flag now 35% faster - Added a Mail::Folder::FastReader module which can cause grepmail to run 10-40% faster, depending on your system. Since this module is experimental, the installation script will allow you to not install the module. A C compiler is required. - "-----Original Message-----" now recognized as beginning an included message - Fixed a bug where errors would not be displayed if compressed data was piped to grepmail - Date::Parse is now only required if -d is used. (Date::Manip is still only required if you use complex date specfications.) (Thanks to Richard Stallman for pointing this out.) - Added -n flag to print line numbers a la grep. (Thanks to Richard Stallman for the suggestion) - Fixed a bug in debug output where the email subject was actually the sender - Fixed an undefined value in the printing of flag information - An ASCII file is now determined to be a mailbox if it has a line whose prefix is 'From' or 'X-From-Line:', and another line whose prefix is 'Received ', 'Date:', 'Subject:', 'X-Status:', or 'Status:'. - Error exits now return 1 (Thanks to Wolfgang Rohdewald for the bug report) - -V flag prints the version (Thanks to Wolfgang Rohdewald for the feature request) - Restructured code: localized reading of the emails from the file, removed two functions New in version 4.43: - Fixed a bug in -r counting when used with -h. (Thanks to Andrew for the bug report.) - Fixed a bug in the handling of included messages. (Thanks to Antoine Martin for the bug report and suggestion for the fix.) New in version 4.42: - Added -a flag to use received date instead of sent date for -d matches. (Thanks to Michael Liljeblad for the patch.) - Included emails are now ignored properly (Thanks to an anonymous submittor for the bug report and part of a patch https://sourceforge.net/bugs/?func=detailbug&bug_id=112159&group_id=2207) - If an email has no date, the -d switch now issues a warning and does not treat the email as a match (Thanks to David Blaine for the bug report.) - -d "" can be used to find emails without dates - Mailbox files are now detected as files using if ($buffer =~ /^(X-From-Line:|From) /im && $buffer =~ /^Subject: /im) rather than if ($buffer =~ /^(X-From-Line:|From) /im && $buffer =~ /^Date: /im) - Improved detection of binary files. (Thanks to Dan Sugalski for the sample code.) - STDERR and STDOUT now checked separately during "make test" - Headers can now be in the format "Date:" in addition to "Date: " (Thanks to Benjamin Korvemaker for the patch and concept.) New in version 4.41: - Support for Gnus-style mail files added (Thanks to Werner Bosse for the patch.) - Test mail files tweaked to make the test cases work better across all time zones. (Thanks to Andreas Kutschera for the patch.) - Added check for unparsable dates in email headers. - Fixed a Perl warning raised when date parsing fails. - Added instructions for getting the necessary modules to README. New in version 4.40: - Date::Parse and Date::Manip version unified -- Date::Parse is now required, and Date::Manip (if present) is used to parse complex dates. (Patch by Seth Cohn , modified by David Coppit) New in version 4.31: - Distro has missing test cases for -u functionality. Doh! New in version 4.30: - Updated code to avoid warnings under Perl 5.6 (Thanks to Andreas Kutschera for the bug report.) - Fixed a bug in the test script where bzip2, gzip, and tzip support would not be tested even though the programs were available. (Thanks to Andreas Kutschera for the patch.) - Added standard --help flag (Patch by Seth Cohn ) - Added -u ("unique") flag, which ensures that no duplicate messages will be output. (A BIG thanks to Seth Cohn .) New in version 4.23: - Updated the test cases to work better in timezones close to +0000 and +2300. (email if you have problems with tests 1 and 23. Thanks to Harald Krause for first finding the bug, and Adam Huffman for his help debugging it.) - Fixed a bug in the "ignore attachments" code New in version 4.22: - grepmail now behaves better when tzip, bzip2 or gunzip aren't present on the system. - The code has been restructured to compile more easily with perlcc. New in version 4.21: - Fixed a bug that would cause grepmail to runaway when a pipe following it was broken. (Thanks to Gerald Pfeifer for the bug report) New in version 4.20: - grepmail development has been moved to SourceForge, and made public. Visit http://grepmail.sourceforge.net/ - Added -s flag, which limits matched emails to a given size - Restructured the code to be more robust with respect to feature interaction. (At a 5-10% slowdown cost.) - Fixed an uninitialized variable warning caused by emails without subjects in debug mode. New in version 4.11: - Fixed a bug where an ASCII file would not be recognized as a mailbox when the first couple emails did not have a "From:" line. (Thanks to Jeff Flowers ) - Added standard Perl testing. New in version 4.1: - Stripped auto-perl execution code, since it never works on all platforms. (Installation instructions modified to require the user to fix the #! line.) - Minor changes to allow grepmail to run without -w complaints. New in version 4.0: - Fixed a bug where shell characters needed to be escaped for compressed files. (Bug found by Richard Clamp - Added #!/bin/sh as first line to make the rest compatible with csh/tcsh users. (Bug found by Ed Arnold ) New in version 3.9: - Took out specialization engine because there wasn't enough support to program in that style. - Offering 2 main versions now -- Date::Manip and Date::Parse - Added -R option, which causes grepmail to recurse any directories encountered. (Thanks to Emil Tiller for the initial code.) - Fixed a small bug that would cause some attachments not to be identified. New in version 3.8: - Added a prototype engine to allow users to specialize grepmail at installation time. (See below) - Fixed buggy mailbox detection algorithm - Fixed bug in identification of email headers. - Fixed bug in parsing timezones of emails. (Thanks to Wolfgang Weisselberg ) - Fixed bug in handling of date specifications like "2 days ago" and "2 weeks ago" - Added -M switch, which causes grepmail to ignore non-text attachments. - Added "quiet mode", -q switch, which supresses warnings about directories, non-mailbox ASCII files, binary files that can't be decompressed, etc. - Restructured code a bit. Moved file and STDIN processing out of main. The whole email is now read before the match is made to the body, instead of trying to match the pattern while reading the body. (This simplifies the algorithms and makes -M support a lot easier, at the cost of increasing the required memory slightly.) Now uses ungetc to put the test characters used during file type detection back on the stream. New in version 3.7: - Added -D for debugging output - Now ignores ASCII files that don't look like mailboxes. Thanks to oak for pointing this out. - Uses Date::Parse instead of Date::Manip, which results in faster execution time at the expense of less flexibility. (e.g. You can't do "12pm January 5 1997" any more) New in version 3.6: - No more temporary files! This addresses the security issues that a few people have sent me email about. The script may use slightly more memory, depending on the size of the largest email. (Email is now buffered as it is read, and the whole buffer is printed when a match occurs. This is in contrast to storing the file pointer and seeking back to the start of the email.) The script is substantially faster for large amounts of data piped as STDIN. Many thanks go to Joey Hess (), who supplied insights and contributions toward making this release happen, especially the buffering code. New in version 3.5: - grepmail will not try to decompress piped input that is empty. - Temporary files are now placed in the user's home directory to help avoid privacy attacks (or in the directory specified by the TMPDIR environment variable, if it exists). - Fixed a bug that would occasionally leave a tempfile around. New in version 3.4.1: - Fixed a bug that added an extra line to the start of output. (Thanks to Moritz Barsnick for helping to find this.) New in version 3.4: - Added tzip support. (thanks to Marc Lehmann ) - Reordered flags to better match grep. - Changed command line syntax again. (Last time, I hope.) New in version 3.3: - Added bzip2 support. (thanks to Josh Plautz ). - Improved error checking on piped binary input. - Added debugging code. New in version 3.2: - Added TMPFILE environment variable support, and a signal handler. (thanks to Ulli Horlacher (). - Fixed a bug where the last paragraph of the last email in a mailbox would not be printed on Linux. (How's that for obscure? Thanks to Eli Criffield for discovering it.) New in version 3.1: - Modified the decompression to be more compatible with older versions of gzip. - Improved error checking so that "grepmail -h" prints a usage message. - Added -m flag, which causes an "X-Mailfolder" line to be added to the header, thereby showing which folder contained the message. (by Ulli Horlacher ). - Improved error checking on flags. - Changed "zcat" to "gunzip -c" to help with backwards compatibility with older versions of gzip (thanks to Eugene Kim ). New in version 3.0: - -h and -b can be used together. - Rewrote the ProcessMailFile to run 2 to 3 times faster, and use less memory. - Correctly diagnoses directories as such (by Gerald Pfeifer ). New in version 2.1: - Added -l,-r, and -e, as suggested by Reinhard Max . - Now uses about 1/3 the memory, and is a little faster. New in version 2.0.1: - Added POD documentation at the end of the script (thanks, Jeffrey Haemer ). - -h for headers only -b for body only New in version 1.9: - "Ignore empty files" by Gerald Pfeifer . - Emails without dates are now automatically output no matter what the date specification is. (Better safe than sorry!) New in version 1.7: - Sped up by Andrew Johnson. It no longer looks for dates unless the email matches the search string. New in version 1.6: - Removed use of Compress::Zlib because it was 30% slower, complicated the code, and because any user with gzip'd mail has zcat... New in version 1.5: - Andrew Johnson fixed a couple of bugs. New in version 1.4: - Incorporated conditional loading of the date module (submitted by Andrew Johnson Many thanks!). - compress::Zlib used instead of shelling out to gunzip (submitted by Andrew Johnson Many thanks!). - Some bug fixes (submitted by Andrew Johnson Many thanks!). - Also restructured the code a bit. New in version 1.3: - Made it pipeable so you can do: grepmail file | grepmail New in version 1.2: - Restructured the code a bit. New in version 1.1: - Support for dates. New in version 1.0: - Initial version, with -v -i, and gzip support grepmail-5.3111/MANIFEST000644 000765 000024 00000007167 13321551102 015202 0ustar00coppitstaff000000 000000 CHANGES LICENSE MANIFEST Makefile.PL README TODO # A utility program for bug reporting anonymize_mailbox # The program files grepmail grepmail.old # The test module files t/Test/Utils.pm t/Test/ConfigureGrepmail.pm # Tests t/append_header.t t/auto_search.t t/body.t t/cache.t t/complex_expression.t t/count.t t/date_manip.t t/date.t t/header.t t/help.t t/ignore_signatures.t t/invalid_date.t t/invalid_mailbox.t t/line_number.t t/list.t t/match_compressed.t t/match_headers.t t/match_words.t t/mime_attachments.t t/nonexistent_mailbox.t t/not_match_compressed.t t/not_match_uncompressed.t t/pattern_file.t t/pipe_compressed.t t/pipe_uncompressed.t t/received_date.t t/recursive.t t/size.t t/status.t t/unique.t t/speed.pl t/no_patterns t/patterns t/mailboxes/invalid_date.txt t/mailboxes/mailseparators.txt t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1-dos.txt t/mailboxes/mailarc-1.txt.bz2 t/mailboxes/mailarc-1.txt.gz t/mailboxes/mailarc-1.txt.lz t/mailboxes/mailarc-1.txt.xz t/mailboxes/mailarc-2.txt t/mailboxes/mailarc-3.txt t/mailboxes/non-mailbox.txt.gz t/mailboxes/directory/mailarc-2.txt t/results/mailarc-2.txt t/results/all_driving t/results/all_handy t/results/all_handy_dos t/results/all_handy_blank t/results/all_handy_buffer t/results/all_handy_imagecraft t/results/all_luikeith t/results/all_test t/results/append_header t/results/append_header_dos t/results/body_handy t/results/body_mime t/results/body_mime_dos t/results/body_my t/results/body_my_dos t/results/count_all t/results/count_handy t/results/count_handy_dos t/results/date_1 t/results/date_2 t/results/date_3 t/results/date_august t/results/date_invalid t/results/date_manip t/results/header_aarone t/results/header_body_handy t/results/header_edsinger t/results/header_handy t/results/header_handy_dos t/results/header_mozilla t/results/help t/results/ignore_signatures t/results/ignore_signatures_dos t/results/invalid_date_1 t/results/list_handy t/results/list_handy_dos t/results/match_word_let t/results/mime_attachments t/results/no_data t/results/none t/results/no_such_file t/results/not_body_handy t/results/not_handy t/results/not_header_body_handy t/results/not_header_handy t/results/number_1 t/results/number_1_dos t/results/number_2 t/results/number_append_header t/results/recursive t/results/recursive2 t/results/ro_status t/results/sep_7_1998 t/results/size_2 t/results/size_3 t/results/size_handy t/results/two_handy t/results/unique_all_1 t/results/unique_all_2 t/results/unique_body t/results/unique_body_imagecraft t/results/unique_handy # Module::Install extensions inc/File/HomeDir.pm inc/File/Which.pm inc/File/Slurper.pm inc/Module/AutoInstall.pm inc/Module/Install.pm inc/Module/Install/AutoLicense.pm inc/Module/Install/AutomatedTester.pm inc/Module/Install/Base.pm inc/Module/Install/Bugtracker.pm inc/Module/Install/Can.pm inc/Module/Install/CheckOptional.pm inc/Module/Install/CustomInstallationPath.pm inc/Module/Install/Fetch.pm inc/Module/Install/GithubMeta.pm inc/Module/Install/Include.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Scripts.pm inc/Module/Install/StandardTests.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm inc/Module/Install/PRIVATE/Add_Test_Target.pm inc/Module/Install/PRIVATE/Enable_Verbose_CPAN_Testing.pm inc/Module/Install/PRIVATE/Fix_Standard_Tests.pm inc/Module/Install/PRIVATE/Update_Test_Version.pm inc/URI/Escape.pm # Private Module::Install extensions private-lib/Module/Install/PRIVATE/Add_Test_Target.pm private-lib/Module/Install/PRIVATE/Enable_Verbose_CPAN_Testing.pm private-lib/Module/Install/PRIVATE/Fix_Standard_Tests.pm private-lib/Module/Install/PRIVATE/Update_Test_Version.pm META.yml grepmail-5.3111/grepmail000755 000765 000024 00000221360 13321551112 015571 0ustar00coppitstaff000000 000000 #!/usr/bin/perl # grepmail # Do a pod2text on this file to get full documentation, or pod2man to get # man pages. # Written by David Coppit (david@coppit.org, http://coppit.org/) with lots of # debugging and patching by others -- see the CHANGES file for a complete # list. use 5.005; use vars qw( %opts $commandLine $VERSION %message_ids_seen $USE_CACHING $USE_GREP ); use Getopt::Std; use strict; use warnings; use Mail::Mbox::MessageParser; use FileHandle; use Carp; $VERSION = sprintf "%d.%02d%02d", q/5.31.11/ =~ /(\d+)/g; # Set to 1 to enable caching capability $USE_CACHING = 1; # Set to 0 to disable use of external grep utility $USE_GREP = 1; # Internal function return values. my $PRINT = 0; my $DONE = 1; my $SKIP = 2; my $CONTINUE = 3; my $NONE = 4; my $BEFORE = 5; my $AFTER = 6; my $NODATE = 8; my $BETWEEN = 9; my $LESS_THAN = 10; my $LESS_THAN_OR_EQUAL = 11; my $GREATER_THAN = 12; my $GREATER_THAN_OR_EQUAL = 13; my $EQUAL = 14; my $NO_PATTERN = '\127\235NO PATTERN\725\125'; my %HEADER_PATTERNS = ( '^TO:' => '(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):)', '^FROM_DAEMON:' => '(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)?))', '^FROM_MAILER:' => '(^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From)([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t][^<)]*(\(.*\).*)?)?$([^>]|$))', ); #------------------------------------------------------------------------------- # Outputs debug messages with the -D flag. Be sure to return 1 so code like # 'dprint "blah\n" and exit' works. sub dprint { return 1 unless $opts{'D'}; my $message = join '',@_; foreach my $line (split /\n/, $message) { warn "DEBUG: $line\n"; } return 1; } #------------------------------------------------------------------------------- # Print a nice error message before exiting sub Report_And_Exit { my $message = shift; $message .= "\n" unless $message =~ /\n$/; warn "grepmail: $message"; exit 1; } #------------------------------------------------------------------------------- # Filter signals to print error messages when CTRL-C is caught, a pipe is # empty, a pipe is killed, etc. my %signals_and_messages = ( 'PIPE' => 'Broken Pipe', 'HUP' => 'Hangup', 'INT' => 'Canceled', 'QUIT' => 'Quit', 'SEGV' => 'Segmentation violation', 'TERM' => 'Terminated', ); # We'll store a copy of the original signal handlers and call them when we're # done. This helps when running under the debugger. my %old_SIG = %SIG; sub Signal_Handler { my $signal = $_[0]; $old_SIG{$signal}->(@_) if $old_SIG{$signal}; Report_And_Exit($signals_and_messages{$signal}); } # Delete the HUP signal for Windows, where it doesn't exist delete $signals_and_messages{HUP} if $^O eq 'MSWin32'; # We have to localize %SIG to prevent odd bugs from cropping up (see # changelog). Using an array slice on %SIG, I assign an array consisting of as # many copies of \&Signal_Handler as there are keys in %signals_and_messages. local @SIG{keys %signals_and_messages} = (\&Signal_Handler) x keys %signals_and_messages; ################################ MAIN PROGRAM ################################# binmode STDOUT; binmode STDERR; my ($dateRestriction, $date1, $date2); my ($sizeRestriction, $size1, $size2); { # PROCESS ARGUMENTS my (@remaining_arguments,$pattern); { my ($opts_ref,$remaining_arguments_ref); ($opts_ref,$remaining_arguments_ref,$pattern) = Get_Options(@ARGV); %opts = %$opts_ref; @remaining_arguments = @$remaining_arguments_ref; } # Initialize seen messages data structure to empty. %message_ids_seen = (); # Save the command line for later when we try to decompress standard input { # Need to quote arguments with spaces my @args = @ARGV; grep { index($_, ' ') == -1 ? $_ : "'$_'" } @args; $commandLine = "$0 @args"; } Print_Debug_Information($commandLine); sub Process_Date; sub Process_Size; sub Get_Files; sub Validate_Files_Are_Not_Output; # Make the pattern insensitive if we need to $pattern = "(?i)$pattern" if ($opts{'i'}) && $pattern ne $NO_PATTERN; # Make the pattern match word boundaries if we need to $pattern = "\\b$pattern\\b" if ($opts{'w'}) && $pattern ne $NO_PATTERN; if (defined $opts{'d'}) { ($dateRestriction,$date1,$date2) = Process_Date($opts{'d'}); } else { $dateRestriction = $NONE; } if (defined $opts{'s'}) { ($sizeRestriction,$size1,$size2) = Process_Size($opts{'s'}); } else { $sizeRestriction = $NONE; } dprint "PATTERN: $pattern\n" unless $pattern eq $NO_PATTERN; dprint "PATTERN: \n" if $pattern eq $NO_PATTERN; dprint "FILES: @remaining_arguments\n"; dprint "DATE RESTRICTION: $dateRestriction\n"; dprint "FIRST DATE: $date1\n" unless $dateRestriction == $NONE; dprint "SECOND DATE: $date2\n" unless $dateRestriction == $NONE; dprint "SIZE RESTRICTION: $sizeRestriction\n"; dprint "FIRST SIZE: $size1\n" unless $sizeRestriction == $NONE; dprint "SECOND SIZE: $size2\n" unless $sizeRestriction == $NONE; Validate_Pattern($pattern); my @files = Get_Files(@remaining_arguments); # If the user provided input files... if (@files) { Validate_Files_Are_Not_Output(@files); Handle_Input_Files(@files,$pattern); } # Using STDIN elsif (!@remaining_arguments) { Handle_Standard_Input($pattern); } exit 0; } #------------------------------------------------------------------------------- sub Get_Options { local @ARGV = @_; my @argv = @ARGV; # Print usage error if no arguments given Report_And_Exit("No arguments given.\n\n" . usage()) unless @ARGV; # Check for --help, the standard usage command, or --version. print usage() and exit(0) if grep { /^--help$/ } @ARGV; print "$VERSION\n" and exit(0) if grep { /^--version$/ } @ARGV; my @valid_options = qw( a b B C d D e E f F i j h H l L M m n q r R s S t T u v V w X Y Z ); my %opts; my $pattern; # Initialize all options to zero. map { $opts{$_} = 0; } @valid_options; # And some to non-zero. $opts{'d'} = $opts{'V'} = undef; $opts{'X'} = '^-- $'; $opts{'C'} = undef; # Ensure valid options. ALSO UPDATE 2ND GETOPT CALL BELOW getopt("CdeEfjsXY",\%opts); # Here we have to deal with the possibility that the user specified the # search pattern without the -e flag. # getopts stops as soon as it sees a non-flag, so $ARGV[0] may contain the # pattern with more flags after it. unless ($opts{'e'} || $opts{'E'} || $opts{'f'}) { my $missing_flags = ''; foreach my $flag (keys %opts) { $missing_flags .= $flag unless $opts{$flag}; } $missing_flags = "[$missing_flags]"; # If it looks like more flags are following, then grab the pattern and # process them. unless (defined $argv[-($#ARGV+2)] && $argv[-($#ARGV+2)] eq '--') { if ( $#ARGV > 0 && $ARGV[1] =~ /^-$missing_flags$/) { $pattern = shift @ARGV; getopt("CdfjsXY",\%opts); } # If we've seen a -d, -j, -s, or -u flag, and it doesn't look like there # are flags following $ARGV[0], then look at the value in $ARGV[0] elsif ( ( defined $opts{'d'} || $opts{'j'} || $opts{'s'} || $opts{'u'} ) && ( $#ARGV <= 0 || ( $#ARGV > 0 && $ARGV[1] !~ /^-$missing_flags$/ ) ) ) { # If $ARGV[0] looks like a file we assume there was no pattern and # set a default pattern of "." to match everything. if ($#ARGV != -1 && -f Search_Mailbox_Directories($ARGV[0])) { $pattern = '.'; } # Otherwise we take the pattern and move on else { $pattern = shift @ARGV; } } # If we still don't have a pattern or any -d, -j, -s, or -u flag, we # assume that $ARGV[0] is the pattern elsif (!defined $opts{'d'} && !$opts{'j'} && !$opts{'s'} && !$opts{'u'}) { $pattern = shift @ARGV; } } } if ($opts{'e'} || $opts{'E'} || $opts{'f'}) { Report_And_Exit("You specified two search patterns, or a pattern and a pattern file.\n") if defined $pattern; if ($opts{'e'}) { $pattern = $opts{'e'}; } elsif ($opts{'E'}) { $pattern = $opts{'E'}; } else { open my $pattern_file, $opts{'f'} or Report_And_Exit("Can't open pattern file $opts{'f'}"); $pattern = '('; my $first = 1; while (my $line = <$pattern_file>) { if ($first) { $first = 0; } else { $pattern .= '|'; } chomp $line; $pattern .= $line; } close $pattern_file; $pattern .= ')'; } } elsif (defined $opts{'V'}) { # Print version and exit if we need to print "$VERSION\n"; exit (0); } elsif (!defined $pattern) { # The only times you don't have to specify the pattern is when -d, -j, -s, or -u # is being used. This should catch people who do "grepmail -h" thinking # it's help. Report_And_Exit("Invalid arguments.\n\n" . usage()) unless defined $opts{'d'} || $opts{'j'} || $opts{'s'} || $opts{'u'}; $pattern = '.'; } if (defined $opts{'d'}) { if (eval {require Date::Parse}) { import Date::Parse; } else { Report_And_Exit('You specified -d, but do not have Date::Parse. ' . "Get it from CPAN.\n"); } if (eval {require Time::Local}) { import Time::Local; } else { Report_And_Exit('You specified -d, but do not have Time::Local. ' . "Get it from CPAN.\n"); } if (eval {require Date::Manip}) { my ($version_number) = $Date::Manip::VERSION =~ /^(\d+\.\d+)/; Date::Manip::Date_Init("TodayIsMidnight=1") if ($version_number >= 5.43 && $version_number < 6); } } $opts{'h'} = 1 if $opts{'Y'}; # Make sure no unknown flags were given foreach my $option (keys %opts) { unless (grep {/^$option$/} @valid_options) { Report_And_Exit("Invalid option \"$option\".\n\n" . usage()); } } # Check for -E flag incompatibilities. if ($opts{'E'}) { # Have to do -Y before -h because the former implies the latter my @options = qw(e f M S Y); for my $option (@options) { if ($opts{$option}) { Report_And_Exit "-$option can not be used with -E"; } } if ($opts{'i'}) { Report_And_Exit "-i can not be used with -E. Use -E '\$email =~ /pattern/i' instead"; } if ($opts{'b'}) { Report_And_Exit "-b can not be used with -E. Use -E '\$email_body =~ /pattern/' instead"; } if ($opts{'h'}) { Report_And_Exit "-h can not be used with -E. Use -E '\$email_header =~ /pattern/' instead"; } } # Check for -f flag incompatibilities. if ($opts{'f'}) { # Have to do -Y before -h because the former implies the latter my @options = qw(E e); for my $option (@options) { if ($opts{$option}) { Report_And_Exit "-$option can not be used with -E"; } } } unless (defined $opts{'C'}) { if(defined $ENV{'HOME'}) { $opts{'C'} = "$ENV{'HOME'}/.grepmail-cache"; } elsif ($USE_CACHING) { # No cache file, so disable caching $USE_CACHING = 0; warn "grepmail: No cache file specified, and \$HOME not set. " . "Disabling cache.\n" unless $opts{'q'}; } } $opts{'R'} = 1 if $opts{'L'}; $pattern = $NO_PATTERN if $pattern eq '()'; return (\%opts, \@ARGV, $pattern); } #------------------------------------------------------------------------------- sub Print_Debug_Information { my $commandLine = shift; return unless $opts{'D'}; dprint "Version: $VERSION"; dprint "Command line was (special characters not escaped):"; dprint " $commandLine"; if (defined $Date::Parse::VERSION) { dprint "Date::Parse VERSION: $Date::Parse::VERSION"; } dprint "Options are:"; foreach my $i (sort keys %opts) { if (defined $opts{$i}) { dprint " $i: $opts{$i}"; } else { dprint " $i: undef"; } } dprint "INC is:"; foreach my $i (@INC) { dprint " $i"; } } #------------------------------------------------------------------------------- # Dies if the given pattern's syntax is invalid sub Validate_Pattern { my $pattern = shift; local $@; if ($opts{'E'}) { eval {if ($pattern) {}}; Report_And_Exit "The match condition \"$pattern\" is invalid.\n" if $@; } elsif ($pattern ne $NO_PATTERN) { eval {'string' =~ /$pattern/}; Report_And_Exit "The pattern \"$pattern\" is invalid.\n" if $@; } } #------------------------------------------------------------------------------- # Get a list of files, taking recursion into account if necessary. sub Get_Files { my @files_and_directories = @_; # We just return what we were given unless we need to recurse subdirectories. return @files_and_directories unless $opts{'R'}; my @files; foreach my $arg (@files_and_directories) { if (-f $arg) { push @files, $arg; } elsif( -d $arg || -l $arg && $opts{'L'} ) { dprint "Recursing directory $arg looking for files..." if -d $arg; dprint "Following symbolic link $arg looking for files..." if -l $arg; unless (eval {require File::Find}) { Report_And_Exit("You specified -R or -L, but do not have File::Find. " . "Get it from CPAN.\n"); } import File::Find; # Gets all plain files in directory and descendents. Puts them in @files $File::Find::name = ''; my $wanted = sub { push @files,$File::Find::name if -f $_ }; if ($opts{'L'}) { find({ wanted => $wanted, follow => 1, follow_skip => 2 }, $arg); } else { find({ wanted => $wanted }, $arg); } } else { # Ignore unknown file types } } return @files; } #------------------------------------------------------------------------------- sub Same_Inode { my $fh1 = shift; my $fh2 = shift; return 0 unless defined $fh1 && defined $fh2; my ($device1, $inode1) = (stat($fh1))[0,1]; my ($device2, $inode2) = (stat($fh2))[0,1]; return $device1 == $device2 && $inode1 == $inode2; } #------------------------------------------------------------------------------- sub Validate_Files_Are_Not_Output { my @files = @_; # Doesn't work properly on Windows for some reason return if $^O eq 'MSWin32'; foreach my $file (@files) { my $fh = new FileHandle($file); if (Same_Inode($fh, *STDOUT)) { Report_And_Exit("Input file $file is also standard output"); } if (Same_Inode($fh, *STDERR)) { Report_And_Exit("Input file $file is also standard error"); } } } #------------------------------------------------------------------------------- sub Handle_Input_Files { my $pattern = pop @_; my @files = @_; # For each input file... foreach my $file (@files) { dprint '#'x70; dprint "Processing file $file"; # First of all, silently ignore empty files... next if -z $file; # ...and also ignore directories. if (-d $file) { warn "grepmail: Skipping directory: '$file'\n" unless $opts{'q'}; next; } $file = Search_Mailbox_Directories($file) unless -f $file; Process_Mail_File(undef,$file,$#files+1,$pattern); } } #------------------------------------------------------------------------------- sub Search_Mailbox_Directories { my $file = shift; my @maildirs; push @maildirs, $ENV{'MAILDIR'} if defined $ENV{'MAILDIR'} && -d $ENV{'MAILDIR'}; push @maildirs, "$ENV{HOME}/mail" if defined $ENV{'HOME'} && -d "$ENV{HOME}/mail"; push @maildirs, "$ENV{HOME}/Mail" if defined $ENV{'HOME'} && -d "$ENV{HOME}/Mail"; push @maildirs, "$ENV{HOME}/Mailbox" if defined $ENV{'HOME'} && -d "$ENV{HOME}/Mailbox"; foreach my $mail_folder (@maildirs) { my $path_and_file = "$mail_folder/$file"; return $path_and_file if -e $path_and_file; } return $file; } #------------------------------------------------------------------------------- sub Handle_Standard_Input { my $pattern = shift; dprint "Handling STDIN"; # We have to implement our own -B and -s, because STDIN gets eaten by them binmode STDIN; my $fileHandle = new FileHandle; $fileHandle->open('-'); Process_Mail_File($fileHandle,undef,1,$pattern); } #------------------------------------------------------------------------------- # This algorithm is complicated by code to short-circuit some # computations. For example, if the user specified -h but not -b, when # we can analyze the header for a match and avoid needing to search # the body, which may be much larger. sub Do_Simple_Pattern_Matching { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $fileName = shift; my $number_files = shift; my $numberOfMatches = shift; my $line = shift; my $endline = shift; my $pattern = shift; die unless ref $email_header && ref $email_body; return ($CONTINUE,$numberOfMatches) if $pattern eq $NO_PATTERN; dprint "Checking for early match or abort based on header information." if $opts{'D'}; my ($result,$matchesHeader) = Analyze_Header($email_header,$email_body,$fileHandle,$pattern,1,$endline); if ($result == $SKIP) { dprint "Doing an early abort based on header." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } if ($result == $PRINT) { dprint "Doing an early printout based on header." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- my $matchesBody = 0; my $signature_offset = undef; if ($opts{'S'}) { my $signature_pattern = $opts{'X'}; $signature_pattern =~ s#\$#$/#; if ($$email_body =~ m/($signature_pattern)/mg) { $signature_offset = pos($$email_body) - length($1); pos($$email_body) = 0; dprint "Signature offset: $signature_offset"; } } # Ignore the MIME attachments if -M was specified if ($opts{'M'} && ($$email_header =~ /^Content-Type:.*?boundary=(?:"([^"]*)"|([^\r\n]*))/ism)) { my $boundary; $boundary = $1 if defined $1; $boundary = $2 if defined $2; dprint "Found attachments with boundary:\n $boundary" if $opts{'D'}; my @attachment_positions; # Get each of the binary attachment beginnings and endings. while ($$email_body =~ m/\n((?:--)?\Q$boundary\E(?:--)?$endline(?:(.*?)$endline$endline)?)/sg) { my $header = $2; # The beginning of this attachment is the end of the previous. $attachment_positions[$#attachment_positions]{'end'} = pos($$email_body) - length($1) if @attachment_positions; $attachment_positions[$#attachment_positions+1]{'beginning'} = pos($$email_body); # If it's the beginning of a binary attachment, store the position if (defined $header && $header =~ /^Content-Type:\s+(?!text)/i) { $attachment_positions[-1]{'type'} = 'binary'; } else { $attachment_positions[-1]{'type'} = 'text'; } } # The last boundary terminates the attachments. pop @attachment_positions; @attachment_positions = grep { $_->{'type'} eq 'binary' } @attachment_positions; pos($$email_body) = 0; # Now search the body, ignoring any matches in binary # attachments. # Avoid perl 5.6 bug which causes spurious warning even though # $pattern is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; SEARCH: while ($$email_body =~ m/($pattern)/omg) { my $position = pos($$email_body) - length($1); last SEARCH if $opts{'S'} && defined $signature_offset && $position > $signature_offset; foreach my $attachment (@attachment_positions) { next SEARCH if ($position > $attachment->{'beginning'} && $position < $attachment->{'end'}); } $matchesBody = 1; last; } pos($$email_body) = 0; } else { # Avoid perl 5.6 bug which causes spurious warning even though # $pattern is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; pos($$email_body) = 0; if ($$email_body =~ m/($pattern)/omg) { my $position = pos($$email_body) - length($1); $matchesBody = 1 unless $opts{'S'} && defined $signature_offset && $position > $signature_offset; } pos($$email_body) = 0; } #---------------------------------------------------------------- my $matchesSize = Is_In_Size($email_header,$email_body,$sizeRestriction,$size1,$size2); #---------------------------------------------------------------- dprint "Checking for early match or abort based on header, body, " . "and size information." if $opts{'D'}; my $isMatch = 1; $isMatch = 0 if $opts{'s'} && !$matchesSize || $opts{'b'} && !$matchesBody || $opts{'h'} && !$matchesHeader || !$opts{'b'} && !$opts{'h'} && !($matchesBody || $matchesHeader); if (!$isMatch && !$opts{'v'}) { dprint "Doing an early abort based on header, body, and size." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } elsif (!$isMatch && $opts{'v'}) { dprint "Doing an early printout based on header, body, and size." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- dprint "Checking date constraint." if $opts{'D'}; $isMatch = 1; { my $matchesDate = Email_Matches_Date($email_header,$endline); $isMatch = 0 if defined $opts{'d'} && !$matchesDate; dprint "Email matches date constraint\n" if $opts{'D'} && defined $opts{'d'} && $matchesDate; dprint "Email doesn't match date constraint\n" if $opts{'D'} && defined $opts{'d'} && !$matchesDate; } $isMatch = !$isMatch if $opts{'v'}; # If the match occurred in the right place... if ($isMatch) { dprint "Email matches all patterns and constraints." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; } } else { dprint "Email did not match all patterns and constraints." if $opts{'D'}; } return ($CONTINUE,$numberOfMatches); } #------------------------------------------------------------------------------- # This algorithm is complicated by code to short-circuit some # computations. For example, if the user specified -h but not -b, when # we can analyze the header for a match and avoid needing to search # the body, which may be much larger. sub Do_Complex_Pattern_Matching { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $fileName = shift; my $number_files = shift; my $numberOfMatches = shift; my $line = shift; my $endline = shift; my $pattern = shift; die unless ref $email_header && ref $email_body; return ($CONTINUE,$numberOfMatches) if $pattern eq $NO_PATTERN; dprint "Checking for early match or abort based on header information." if $opts{'D'}; my ($result,$matchesHeader) = Analyze_Header($email_header,$email_body,$fileHandle,$pattern,0,$endline); if ($result == $SKIP) { dprint "Doing an early abort based on header." if $opts{'D'}; return ($CONTINUE,$numberOfMatches); } if ($result == $PRINT) { dprint "Doing an early printout based on header." if $opts{'D'}; if ($opts{'l'}) { print Get_Filename($fileName)."\n"; # We can return since we found at least one email that matches. return ($DONE,$numberOfMatches); } elsif ($opts{'r'}) { $numberOfMatches++; return ($CONTINUE,$numberOfMatches); } else { Convert_Email_To_Mbox_And_Print_It($fileName,$email_header, $email_body,$number_files,$line,$endline) if $opts{'u'} && Not_A_Duplicate($email_header) || !$opts{'u'}; return ($CONTINUE,$numberOfMatches); } } #---------------------------------------------------------------- my $modified_pattern = $pattern; $modified_pattern =~ s/\$email_header\b/\$\$email_header/g; $modified_pattern =~ s/\$email_body\b/\$\$email_body/g; $modified_pattern =~ s#(=~\s*)/(.*?(? $opts{'C'} } ) if $USE_CACHING; $USE_CACHING = 0 if $USE_CACHING && $setup_result ne 'ok'; my $folder_reader = new Mail::Mbox::MessageParser( { 'file_name' => $fileName, 'file_handle' => $fileHandle, 'enable_cache' => $USE_CACHING, 'enable_grep' => $USE_GREP, 'force_processing' => $opts{'F'}, 'debug' => $opts{'D'}, } ); unless (ref $folder_reader) { my $error = $folder_reader; # Catch fatal errors if ($error eq 'No data on filehandle') { Report_And_Exit('No data on standard input'); } elsif ($error eq 'Not a mailbox') { unless($opts{'q'}) { if (defined $fileName) { warn "grepmail: \"$fileName\" is not a mailbox, skipping\n" } else { warn "grepmail: Standard input is not a mailbox, skipping\n" } } return; } else { warn "grepmail: $error, skipping\n" unless $opts{'q'}; return; } } my $numberOfMatches = 0; my $endline = $folder_reader->endline(); local $/ = $endline; my $modified_pattern = $pattern; $modified_pattern =~ s#\$([^\w]|$)#$/$1#; # This is the main loop. It's executed once for each email while(!$folder_reader->end_of_file()) { dprint "Reading email" if $opts{'D'}; my $email = $folder_reader->read_next_email(); # Direct access for performance reasons #my $line = $folder_reader->line_number(); my $line = $folder_reader->{'email_line_number'}; my ($email_header,$email_body); { my $end_of_header; my $newlines_position = index($$email,"$endline$endline"); if ($newlines_position != -1) { $end_of_header = $newlines_position+length("$endline$endline"); } else { $end_of_header = length($$email); } $$email_header = substr($$email,0,$end_of_header); $email_body = $email; substr($$email_body,0,$end_of_header) = ''; } Print_Email_Statistics($email_header,$email_body,$endline) if $opts{'D'}; #---------------------------------------------------------------- if ($opts{'E'}) { my $result; ($result, $numberOfMatches) = Do_Complex_Pattern_Matching($email_header, $email_body, $fileHandle, $fileName, $number_files, $numberOfMatches, $line, $endline, $modified_pattern); return if $result == $DONE; } else { my $result; ($result, $numberOfMatches) = Do_Simple_Pattern_Matching($email_header, $email_body, $fileHandle, $fileName, $number_files, $numberOfMatches, $line, $endline, $modified_pattern); return if $result == $DONE; } } print Get_Filename($fileName).": $numberOfMatches\n" if $opts{'r'}; } #------------------------------------------------------------------------------- # Checks that an email is not a duplicate of one already printed. This should # only be called when $opts{'u'} is true. Also, as a side-effect, it updates # the %message_ids_seen when it sees an email that hasn't been printed yet. { my $tried_to_load_digest_md5; sub Not_A_Duplicate { my $email_header = shift; die unless ref $email_header; my ($message_id) = $$email_header =~ /^Message-Id:\s*<([^>]+)>/mi; if (defined $message_id) { dprint "Checking uniqueness of message id: $message_id"; } else { dprint "Email does not have a message id"; # Try to load Digest::MD5 if we haven't already unless (defined $tried_to_load_digest_md5) { $tried_to_load_digest_md5 = 1; if (eval {require Digest::MD5}) { dprint "Digest::MD5 VERSION: $Digest::MD5::VERSION"; # To prevent warning about variable being used only once my $dummy = $Digest::MD5::VERSION; } else { dprint "Digest::MD5 could not be loaded"; } } # Now create a message id if (defined $Digest::MD5::VERSION) { $message_id = Digest::MD5::md5_hex($$email_header); dprint "Generated message id $message_id with Digest::MD5"; } else { $message_id = $$email_header; dprint "Using email header as message id."; } } my $result; if (exists $message_ids_seen{$message_id}) { $result = 0; dprint "Found duplicate message"; } else { $result = 1; dprint "Found non-duplicate message"; $message_ids_seen{$message_id} = 1; } return $result; } } #------------------------------------------------------------------------------- # - Returns header lines in the email header which match the given name. # - Example names: 'From:', 'Received:' or 'From ' # - If the calling context wants a list, a list of the matching header lines # are returned. Otherwise, the first (and perhaps only) match is returned. # - Wrapped lines are handled. Look for multiple \n's in the return value(s) # - 'From ' also looks for Gnus 'X-From-Line:' or 'X-Draft-From:' sub Get_Header_Field { my $email_header = shift; my $header_name = shift; my $endline = shift; die unless ref $email_header; # Avoid perl 5.6 bug which causes spurious warning even though $email_header # is defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; if ($header_name =~ /^From$/i && $$email_header =~ /^((?:From\s|X-From-Line:|X-Draft-From:).*$endline(\s.*$endline)*)/im) { return wantarray ? ($1) : $1; } my @matches = $$email_header =~ /^($header_name\s.*$endline(?:\s.*$endline)*)/igm; if (@matches) { return wantarray ? @matches : shift @matches; } if (lc $header_name eq 'from ' && $$email_header =~ /^(From\s.*$endline(\s.*$endline)*)/im) { return wantarray ? ($1) : $1; } return undef; ## no critic (ProhibitExplicitReturnUndef) } #------------------------------------------------------------------------------- # Print the email author and subject, given a reference to an email header. sub Print_Email_Statistics { my $email_header = shift; my $email_body = shift; my $endline = shift; die unless ref $email_header && ref $email_body; dprint '-'x70; dprint "Processing email:"; my $message_id = Get_Header_Field($email_header,'Message-Id:',$endline); if (defined $message_id) { dprint " $message_id"; } else { dprint " [No message id line found]"; } my $author = Get_Header_Field($email_header,'From:',$endline); $author = Get_Header_Field($email_header,'From ',$endline) unless defined $author; if (defined $author) { dprint " $author"; } else { dprint " [No from line found]"; } my $subject = Get_Header_Field($email_header,'Subject:',$endline); if (defined $subject) { dprint " $subject"; } else { dprint " [No subject line found]"; } my $date = Get_Header_Field($email_header,'Date:',$endline); if (defined $date) { dprint " $date"; } else { dprint " [No subject line found]"; } dprint " Size: " . (length($$email_header) + length($$email_body)); } #------------------------------------------------------------------------------- # Returns: # A result: # - $PRINT if the email is a match and we need to print it # - $SKIP if we should skip the current email and go on to the next one # - $CONTINUE if we need to keep processing the email. # A boolean for whether the header matches the pattern. # A boolean for whether the header has the correct date. # It turns out that -h, -b, -d, -s , -j, and -v have some nasty feature # interaction. The easy cases are when a constraint is not met--either we skip # if -v is not specified, or we print if -v is specified. # # If a constraint *is* met, we can still do an early abort of there are no other # constraints, or if we know the values of previously checked constraints. # # Finally, -b must be taken into account when analyzing -h matching. Also, we # don't analyze the date here because it is too darn slow. sub Analyze_Header { my $email_header = shift; my $email_body = shift; my $fileHandle = shift; my $pattern = shift; my $doHeaderMatch = shift; my $endline = shift; die unless ref $email_header && ref $email_body; # See if the email fails the status flag restriction my $matchesStatus = 1; if ($opts{'j'}) { foreach my $flag (split //,$opts{'j'}) { $matchesStatus = 0 unless $$email_header =~ /^Status: .*(?i:$flag)/m; } # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesStatus; return ($PRINT,1) if $opts{'v'} && !$matchesStatus; # If we know there are no other constraints return ($PRINT,1) if !$opts{'v'} && $matchesStatus && !$opts{'s'} && !defined $opts{'d'} && $pattern eq '.'; return ($SKIP,0) if $opts{'v'} && $matchesStatus && !$opts{'s'} && !defined $opts{'d'} && $pattern eq '.'; } # See if the email header fails the size restriction. my $matchesSize = 1; if ($opts{'s'}) { $matchesSize = 0 if !Is_In_Size($email_header,$email_body,$sizeRestriction,$size1,$size2); # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesSize; return ($PRINT,1) if $opts{'v'} && !$matchesSize; # If we know there are no other constraints, or we know their values return ($PRINT,1) if !$opts{'v'} && $matchesSize && $matchesStatus && !defined $opts{'d'} && $pattern eq '.'; return ($SKIP,0) if $opts{'v'} && $matchesSize && $matchesStatus && !defined $opts{'d'} && $pattern eq '.'; } if ($doHeaderMatch) { # See if the header matches the pattern # Avoid perl 5.6 bug which causes spurious warning even though $pattern is # defined. local $^W = 0 if $] >= 5.006 && $] < 5.8; my $matchesHeader = Header_Matches_Pattern($email_header,$pattern,$endline); if ($opts{'h'}) { # Easy cases return ($SKIP,0) if !$opts{'v'} && !$matchesHeader; return ($PRINT,1) if $opts{'v'} && !$matchesHeader; } # If we know there are no other constraints, or we know their values return ($PRINT,1) if !$opts{'v'} && $matchesHeader && $matchesSize && $matchesStatus && !defined $opts{'d'} && !$opts{'b'}; return ($SKIP,0) if $opts{'v'} && $matchesHeader && $matchesSize && $matchesStatus && !defined $opts{'d'} && !$opts{'b'}; return ($CONTINUE,$matchesHeader); } else { return ($CONTINUE,1); } } #------------------------------------------------------------------------------- my $header_pattern = undef; sub Header_Matches_Pattern { my $email_header = ${shift @_}; my $pattern = shift; my $endline = shift; return ($email_header =~ /$pattern/om) || 0 unless $opts{'Y'}; dprint "Searching individual headers."; $email_header =~ s/\n(\s+)/$1/g; unless (defined $header_pattern) { $header_pattern = $opts{'Y'}; for my $special_header_pattern (keys %HEADER_PATTERNS) { $header_pattern =~ s/\Q$special_header_pattern\E/$HEADER_PATTERNS{$special_header_pattern}/g; } # Make the pattern insensitive if we need to $header_pattern = "(?i)$header_pattern" if ($opts{'i'}); } for my $header (split(/$endline/, $email_header)) { if ($header =~ /$header_pattern/) { dprint "Header matched header pattern:\n $header\n"; return 1 if $header =~ /$pattern/om; } } return 0; } #------------------------------------------------------------------------------- sub Convert_Email_To_Mbox_And_Print_It { my $fileName = shift; my $email_header = shift; my $email_body = shift; my $number_files = shift; my $line_number = shift; my $endline = shift; ($email_header,$email_body) = Convert_Email_To_Mbox($email_header,$email_body); Print_Email($fileName,$email_header,$email_body,$number_files,$line_number, $endline); } #------------------------------------------------------------------------------- sub Convert_Email_To_Mbox { my $email_header = shift; my $email_body = shift; dprint "Making email mbox format."; # Check for a Gnus email $$email_header =~ s/^(X-From-Line|X-Draft-From):\s+/From /; return ($email_header,$email_body); } #------------------------------------------------------------------------------- sub Get_Filename { my $fileName = shift; if (defined $fileName) { return "$fileName"; } else { return "(standard input)"; } } #------------------------------------------------------------------------------- sub Print_Email { my $fileName = shift; my $email_header = shift; my $email_body = shift; my $number_files = shift; my $line_number = shift; my $endline = shift; dprint "Printing email."; if ($opts{'n'}) { # Print header-by-header my @headers = $$email_header =~ /^(.*$endline(?:\s.*$endline)*)/gm; foreach my $header (@headers) { # Add the mailfolder to the headers if -m was given. Careful # about line numbers! if ($opts{'m'} && $header eq $endline) { print Get_Filename($fileName).":" if $number_files > 1; print " " x length $line_number, ":X-Mailfolder: ", Get_Filename($fileName), $endline; } # Print only 3-line header if -B if ($opts{'B'} && $header !~ /^(From\s|X-From-Line:|X-Draft-From:|From:|Date:|Subject:|$endline)/i) { $line_number += ($header =~ tr/\n//); } else { my $prefix = ''; $prefix = Get_Filename($fileName).":" if $number_files > 1; $header =~ s/^/$line_number++;$prefix . ($line_number-1) . ':'/mge; print $header; } } # Don't print the body if -H is specified if($opts{'H'}) { $line_number += ($$email_body =~ tr/\n//); return; } while ($$email_body =~ /([^\r\n]*$endline)/g) { my $line = $1; print Get_Filename($fileName).":" if $number_files > 1; print "$line_number:$line"; $line_number++; } } else { # print short headers if -B is specified if ($opts{'B'}) { print Get_Header_Field($email_header,'From ',$endline); my $date_header = Get_Header_Field($email_header,'Date:',$endline); print $date_header if defined $date_header; my $from_header = Get_Header_Field($email_header,'From:',$endline); print $from_header if defined $from_header; my $subject_header = Get_Header_Field($email_header,'Subject:',$endline); print $subject_header if defined $subject_header; print "X-Mailfolder: ".Get_Filename($fileName)."$endline$endline" if $opts{'m'}; } else { chomp $$email_header; print $$email_header; print "X-Mailfolder: ".Get_Filename($fileName).$endline if $opts{'m'}; print $endline; $$email_header .= $endline; } # Don't print the body if -H is specified return if $opts{'H'}; # Print whatever body we've read already. print $$email_body; } } #------------------------------------------------------------------------------- # Checks to see if the date in the header matches the date specification. The # date specification can be $NODATE, meaning that the email doesn't have # a Date: line. sub Email_Matches_Date { my $email_header = shift @_; my $endline = shift; die unless ref $email_header; return 1 unless defined $opts{'d'}; return 0 if $dateRestriction == $NODATE; my $received_header = Get_Header_Field($email_header, 'Received:',$endline); my $date_header = Get_Header_Field($email_header, 'Date:',$endline); my $subject_header = Get_Header_Field($email_header, 'Subject:',$endline); my $from_header = Get_Header_Field($email_header, 'From ',$endline); # Collect different date header values. We'll try each one until # we find a value that parses. my @dateValues = (); push(@dateValues, $1) if $opts{'a'} && defined $received_header && $received_header =~ /.*\;\s*(.*?)$/s; push(@dateValues, $1) if defined $date_header && $date_header =~ /^[^:]*:\s*(.*)$/s; push(@dateValues, $1) if defined $from_header && $from_header =~ /^[^ ]*\s*\S+\s+(.*)$/s; unless (scalar(@dateValues) > 0) { warn "grepmail: Couldn't find a date. Assuming email doesn't match the " . "date constraint:\n"; warn " $from_header\n" if defined $from_header; warn " $subject_header\n" if defined $subject_header; return 0; } foreach my $date (@dateValues) { $date =~ s/$endline//g; } my $emailDate = undef; foreach my $date (@dateValues) { dprint("Trying to parse date: $date"); $emailDate = str2time($date); last if defined($emailDate); } return Is_In_Date($emailDate,$dateRestriction,$date1,$date2) if defined $emailDate; warn "grepmail: Couldn't parse email date(s) [" . join("|", @dateValues) . "]. " . "Assuming message doesn't match the date constraint\n"; warn " $from_header\n" if defined $from_header; warn " $subject_header\n" if defined $subject_header; return 0; } #------------------------------------------------------------------------------- # This function tries to parse a date first with Date::Parse. If Date::Parse # can't parse the date, then the function tries to use Date::Manip to parse # it. Returns the parsed date in unix time format, or undef if it can't be # parsed. sub Parse_Date { my $date = shift; # First try to parse the date with Date::Parse; { my $parsedDate = str2time($date); return $parsedDate if defined $parsedDate; } # Then try Date::Manip, if it is installed if (defined $Date::Manip::VERSION) { my $parsedDate = Date::Manip::UnixDate(Date::Manip::ParseDate($date),'%s'); return $parsedDate if defined $parsedDate; } return undef; ## no critic (ProhibitExplicitReturnUndef) } #------------------------------------------------------------------------------- # Figure out what kind of date restriction they want, and what the dates in # question are. An empty date string results in the type of date restriction # being $NODATE. sub Process_Date { my $datestring = shift; return ($NODATE,'','') if $datestring eq ''; if ($datestring =~ /^before (.*)/i) { $dateRestriction = $BEFORE; $date1 = Parse_Date($1); $date2 = ''; Report_And_Exit "\"$1\" is not a valid date" unless defined $date1; } elsif ($datestring =~ /^(after|since)\s(.*)/i) { $dateRestriction = $AFTER; $date1 = Parse_Date($2); Report_And_Exit "\"$2\" is not a valid date" unless defined $date1; $date2 = ''; } elsif ($datestring =~ /^between (.+) and (.+)/i) { $dateRestriction = $BETWEEN; $date1 = Parse_Date($1); $date2 = Parse_Date($2); Report_And_Exit "\"$1\" is not a valid date" unless defined $date1; Report_And_Exit "\"$2\" is not a valid date" unless defined $date2; # Swap the dates if the user gave them backwards. if ($date1 > $date2) { my $temp; $temp = $date1; $date1 = $date2; $date2 = $temp; } } else { $dateRestriction = $BETWEEN; ($date1,$date2) = Parse_Date_Span($datestring); Report_And_Exit "\"$datestring\" is an invalid date specification. Use \"$0 --help\" for help" unless defined $date1; } return ($dateRestriction,$date1,$date2); } #------------------------------------------------------------------------------- sub Parse_Date_Span { my $datestring = shift; # @parsed_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @parsed_time = Date_Parse_strptime($datestring); @parsed_time = Date_Manip_strptime($datestring) if !@parsed_time && defined $Date::Manip::VERSION; # For "jan 2004" if (defined $parsed_time[3] && $parsed_time[3] > 31 && !defined $parsed_time[5]) { $parsed_time[5] = $parsed_time[3] - 1900; $parsed_time[3] = undef; } return (undef,undef) unless grep { defined } @parsed_time; # @current_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @current_time = ((localtime(time))[0..5],$parsed_time[-1]); # Starting from the largest time unit, set it to the current value as long # as it's undefined. for (my $i = -1; !defined($parsed_time[$i]); $i--) { $parsed_time[$i] = $current_time[$i]; } my @date1 = @parsed_time; my $increment_unit = 1; # Set the low date and the increment unit. Starting from the smallest time # unit, set it to the smallest value as long as it's undefined. unless (defined $date1[0]) { $date1[0] = 0; $increment_unit *= 60; unless (defined $date1[1]) { $date1[1] = 0; $increment_unit *= 60; unless (defined $date1[2]) { $date1[2] = 0; $increment_unit *= 24; unless (defined $date1[3]) { $date1[3] = 1; if (defined $date1[4]) { $increment_unit *= Number_Of_Days_In_Month($date1[4],$date1[5]); } else { $date1[4] = 0; $increment_unit *= Number_Of_Days_In_Year($date1[5]); } } } } } my $date1 = timelocal(@date1); my $date2 = timelocal(@date1)+$increment_unit; return ($date1,$date2); } #------------------------------------------------------------------------------- # http://groups.google.com/groups?selm=8FA9D001darkononenet%40206.112.192.118 # $month: 0..11; $year: CCYY sub Number_Of_Days_In_Month { my ($month, $year) = @_; ( qw(31 0 31 30 31 30 31 31 30 31 30 31) )[$month] || 28 + (($year % 100 && !($year % 4))|| !($year % 400)); } #------------------------------------------------------------------------------- sub Number_Of_Days_In_Year { my $year = @_; 365 + (($year % 100 && !($year % 4))|| !($year % 400)); } #------------------------------------------------------------------------------- sub Date_Parse_strptime { my $datestring = shift; my @parsed_time = strptime($datestring); return () unless @parsed_time; if (defined $parsed_time[3] && $parsed_time[3] > 31 && !defined $parsed_time[5]) { $parsed_time[5] = $parsed_time[3] - 1900; $parsed_time[3] = undef; } # @current_time == ($ss,$mm,$hh,$day,$month,$year,$zone) my @current_time = ((localtime(time))[0..5],$parsed_time[-1]); # Starting from the largest time unit, set it to the current value as long # as it's undefined. for (my $i = -1; !defined($parsed_time[$i]); $i--) { $parsed_time[$i] = $current_time[$i]; } foreach my $item (@parsed_time) { next unless defined $item; $item =~ s/^0+//; $item = 0 if $item eq ''; $item += 0 if $item =~ /^\d+$/; } return @parsed_time; } #------------------------------------------------------------------------------- sub Date_Manip_strptime { my $datestring = shift; my @parsed_time = Date::Manip::UnixDate(Date::Manip::ParseDate($datestring), '%S','%M','%H','%d','%m','%Y','%Z'); return () unless @parsed_time; { my $old_tz = $Date::Manip::Cnf{"TZ"}; my $parsed_time = Date::Manip::ParseDate($datestring); $Date::Manip::Cnf{"TZ"} = 'CST'; my $tz_test_1 = Date::Manip::ParseDate($datestring); $Date::Manip::Cnf{"TZ"} = 'EST'; my $tz_test_2 = Date::Manip::ParseDate($datestring); # Different lines so that CVS doesn't insert the date $Date::Manip::Cnf{"TZ"} = $old_tz; if ($parsed_time eq $tz_test_1 && $parsed_time eq $tz_test_2) { $parsed_time[-1] = undef; } } foreach my $item (@parsed_time) { next unless defined $item; $item =~ s/^0+//; $item = 0 if $item eq ''; $item += 0 if $item =~ /^\d+$/; } $parsed_time[4] -= 1 if defined $parsed_time[4]; $parsed_time[5] -= 1900 if defined $parsed_time[5]; # This is not quite correct, because we can't tell when Date::Manip sets the # time to 0 and when the user specifies it explicitely at 0:00:00. if ($parsed_time[0] == 0 && $parsed_time[1] == 0 && $parsed_time[2] == 0) { $parsed_time[0] = $parsed_time[1] = $parsed_time[2] = undef; } #Until 'Date::Manip::Date_Init("TodayIsMidnight=1");' is released if ($datestring eq 'today' || $datestring eq 'now' || $datestring eq 'yesterday') { $parsed_time[0] = $parsed_time[1] = $parsed_time[2] = undef; } return @parsed_time; } #------------------------------------------------------------------------------- # Figure out what kind of size restriction they want, and what the sizes in # question are. sub Process_Size { my $sizestring = shift; if ($sizestring =~ /^\s*(<|<=|>|>=)\s*(\d+)\s*$/i) { if ($1 eq '<') { $sizeRestriction = $LESS_THAN; } elsif ($1 eq '<=') { $sizeRestriction = $LESS_THAN_OR_EQUAL; } elsif ($1 eq '>') { $sizeRestriction = $GREATER_THAN; } elsif ($1 eq '>=') { $sizeRestriction = $GREATER_THAN_OR_EQUAL; } $size1 = $2; $size2 = ''; } elsif ($sizestring =~ /^\s*(\d+)\s*-\s*(\d+)\s*$/i) { $sizeRestriction = $BETWEEN; $size1 = $1; $size2 = $2; # Swap the sizes if the user gave them backwards. if ($size1 > $size2) { my $temp; $temp = $size1; $size1 = $size2; $size2 = $temp; } } elsif ($sizestring =~ /^\s*(\d+)\s*$/i) { $sizeRestriction = $EQUAL; $size1 = $1; $size2 = ''; } else { Report_And_Exit "\"$sizestring\" is an invalid size specification. Use \"$0 --help\" for help"; } return ($sizeRestriction,$size1,$size2); } #------------------------------------------------------------------------------- sub Is_In_Date { my $emailDate = shift @_; my $dateRestriction = shift @_; my $date1 = shift @_; my $date2 = shift @_; # Now we do the date checking. return 1 if $dateRestriction == $NONE; return $emailDate < $date1 if $dateRestriction == $BEFORE; return $emailDate > $date1 if $dateRestriction == $AFTER; return $emailDate > $date1 && $emailDate < $date2 if $dateRestriction == $BETWEEN; return 0; } #------------------------------------------------------------------------------- sub Is_In_Size { my $email_header = shift @_; my $email_body = shift @_; my $sizeRestriction = shift @_; my $size1 = shift @_; my $size2 = shift @_; die unless ref $email_header && ref $email_body; my $length = length($$email_header) + length($$email_body); # Now we do the size checking. return 1 if $sizeRestriction == $NONE; return $length < $size1 if $sizeRestriction == $LESS_THAN; return $length <= $size1 if $sizeRestriction == $LESS_THAN_OR_EQUAL; return $length > $size1 if $sizeRestriction == $GREATER_THAN; return $length >= $size1 if $sizeRestriction == $GREATER_THAN_OR_EQUAL; return $length == $size1 if $sizeRestriction == $EQUAL; return $length >= $size1 && $length <= $size2 if $sizeRestriction == $BETWEEN; return 0; } #------------------------------------------------------------------------------- sub usage { <] [-j ] [-s ] [-d ] [-X ] [-Y ] [-e] grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -E grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -f At least one of -s, -d, -u, -e, and -E must be specified, and can appear in any relative order following the other flags. The -e flag is optional if pattern appears immediately before -s or -d. Files can be plain ASCII or ASCII files compressed with gzip, bzip2, lzip, or xz. -E allows for complex pattern matches involving logical operators. If no file is provided, normal or compressed ASCII input is taken from STDIN. -a Use received date instead of sent date for -d matching -b Search must match body -B Print message bodies but with only limited headers -C Specify the location of the cache file -d Specify a required date range (see below) -D Debug mode -e Explicitly name pattern (when searching for strings beginning with "-") -E Specify a complex search expression -f Read patterns from a file -F Force processing of all data as mailboxes -h Search must match header -H Print headers but not bodies of matching emails -i Ignore case in the search expression -j Search must match status (A=answered, R=read, D=deleted, O=old, F=flagged) -l Output the names of files having an email matching the expression -L Follow symbolic links (implies -R) -M Do not search non-text mime attachments -m Append "X-Mailfolder: " to all headers to indicate in which folder the match occurred -n Print the line number info (and filename if necessary) for the emails -q Quiet mode -- don't output warnings -r Output the names of the files and the number of emails matching the expression -R Recurse directories -s Specify a size range in bytes (see below) -S Ignore signatures -u Ensure that no duplicate emails are output -v Output emails that don't match the expression -V Display the version number -w Match word boundaries -X Specify a regular expression for the signature separator -Y Specify a header to search (implies -h) --help Print a help message Date constraints require Date::Parse. Date specifications must be of the form of: - a date like "today", "1st thursday in June 1992" (requires Date::Manip), "05/18/93", "12:30 Dec 12th 1880", "8:00pm december tenth", - "before", "after", or "since", followed by a date as defined above, - "between and ", where is defined as above. Size constraints must be of the form of: - 12345: match size of exactly 12345 - <12345, <=12345, >12345, >=12345: match size less than, less than or equal, greater than, or greater than or equal to 12345 - 10000-12345: match size between 10000 and 12345 inclusive EOF } #------------------------------------------------------------------------------- =head1 NAME grepmail - search mailboxes for mail matching a regular expression =head1 SYNOPSIS grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] [[-e] |-E |-f ] =head1 DESCRIPTION =over 2 I looks for mail messages containing a pattern, and prints the resulting messages on standard out. By default I looks in both header and body for the specified pattern. When redirected to a file, the result is another mailbox, which can, in turn, be handled by standard User Agents, such as I, or even used as input for another instance of I. At least one of B<-E>, B<-e>, B<-d>, B<-s>, or B<-u> must be specified. The pattern is optional if B<-d>, B<-s>, and/or B<-u> is used. The B<-e> flag is optional if there is no file whose name is the pattern. The B<-E> option can be used to specify complex search expressions involving logical operators. (See below.) If a mailbox can not be found, grepmail first searches the directory specified by the MAILDIR environment variable (if one is defined), then searches the $HOME/mail, $HOME/Mail, and $HOME/Mailbox directories. =back =head1 OPTIONS AND ARGUMENTS Many of the options and arguments are analogous to those of grep. =over 2 =item B The pattern to search for in the mail message. May be any Perl regular expression, but should be quoted on the command line to protect against globbing (shell expansion). To search for more than one pattern, use the form "(pattern1|pattern2|...)". Note that complex pattern features such as "(?>...)" require that you use a version of perl which supports them. You can use the pattern "()" to indicate that you do not want to match anything. This is useful if you want to initialize the cache without printing any output. =item B Mailboxes must be traditional, UNIX C mailbox format. The mailboxes may be compressed by gzip, bzip2, lzip or xz, in which case the associated compression tool must be installed on the system, as well as a recent version of the Mail::Mbox::MessageParser Perl module that supports the format. If no mailbox is specified, takes input from stdin, which can be compressed or not. grepmail's behavior is undefined when ASCII and binary data is piped together as input. =item B<-a> Use arrival date instead of sent date. =item B<-b> Asserts that the pattern must match in the body of the email. =item B<-B> Print the body but with only minimal ('From ', 'From:', 'Subject:', 'Date:') headers. This flag can be used with -H, in which case it will print only short headers and no email bodies. =item B<-C> Specifies the location of the cache file. The default is $HOME/.grepmail-cache. =item B<-D> Enable debug mode, which prints diagnostic messages. =item B<-d> Date specifications must be of the form of: - a date like "today", "yesterday", "5/18/93", "5 days ago", "5 weeks ago", - OR "before", "after", or "since", followed by a date as defined above, - OR "between and ", where is defined as above. Simple date expressions will first be parsed by Date::Parse. If this fails, grepmail will attempt to parse the date with Date::Manip, if the module is installed on the system. Use an empty pattern (i.e. B<-d "">) to find emails without a "Date: ..." line in the header. Date specifications without times are interpreted as having a time of midnight of that day (which is the morning), except for "after" and "since" specifications, which are interpreted as midnight of the following day. For example, "between today and tomorrow" is the same as simply "today", and returns emails whose date has the current day. ("now" is interpreted as "today".) The date specification "after July 5th" will return emails whose date is midnight July 6th or later. =item B<-E> Specify a complex search expression using logical operators. The current syntax allows the user to specify search expressions using Perl syntax. Three values can be used: $email (the entire email message), $email_header (just the header), or $email_body (just the body). A search is specified in the form "$email =~ /pattern/", and multiple searches can be combined using "&&" and "||" for "and" and "or". For example, the expression $email_header =~ /^From: .*\@coppit.org/ && $email =~ /grepmail/i will find all emails which originate from coppit.org (you must escape the "@" sign with a backslash), and which contain the keyword "grepmail" anywhere in the message, in any capitalization. B<-E> is incompatible with B<-b>, B<-h>, and B<-e>. B<-i>, B<-M>, B<-S>, and B<-Y> have not yet been implemented. NOTE: The syntax of search expressions may change in the future. In particular, support for size, date, and other constraints may be added. The syntax may also be simplified in order to make expression formation easier to use (and perhaps at the expense of reduced functionality). =item B<-e> Explicitly specify the search pattern. This is useful for specifying patterns that begin with "-", which would otherwise be interpreted as a flag. =item B<-f> Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. =item B<-F> Force grepmail to process all files and streams as though they were mailboxes. (i.e. Skip checks for non-mailbox ASCII files or binary files that don't look like they are compressed using known schemes.) =item B<-h> Asserts that the pattern must match in the header of the email. =item B<-H> Print the header but not body of matching emails. =item B<-i> Make the search case-insensitive (by analogy to I). =item B<-j> Asserts that the email "Status:" header must contain the given flags. Order and case are not important, so use I<-j AR> or I<-j ra> to search for emails which have been read and answered. =item B<-l> Output the names of files having an email matching the expression, (by analogy to I). =item B<-L> Follow symbolic links. (Implies I<-R>) =item B<-M> Causes grepmail to ignore non-text MIME attachments. This removes false positives resulting from binaries encoded as ASCII attachments. =item B<-m> Append "X-Mailfolder: " to all email headers, indicating which folder contained the matched email. =item B<-n> Prefix each line with line number information. If multiple files are specified, the filename will precede the line number. NOTE: When used in conjunction with B<-m>, the X-Mailfolder header has the same line number as the next (blank) line. =item B<-q> Quiet mode. Suppress the output of warning messages about non-mailbox files, directories, etc. =item B<-r> Generate a report of the names of the files containing emails matching the expression, along with a count of the number of matching emails. =item B<-R> Causes grepmail to recurse any directories encountered. =item B<-s> Return emails which match the size (in bytes) specified with this flag. Note that this size includes the length of the header. Size constraints must be of the form of: - 12345: match size of exactly 12345 - <12345, <=12345, >12345, >=12345: match size less than, less than or equal, greater than, or greater than or equal to 12345 - 10000-12345: match size between 10000 and 12345 inclusive =item B<-S> Ignore signatures. The signature consists of everything after a line consisting of "-- ". =item B<-u> Output only unique emails, by analogy to I. Grepmail determines email uniqueness by the Message-ID header. =item B<-v> Invert the sense of the search, by analogy to I. This results in the set of emails printed being the complement of those that would be printed without the B<-v> switch. =item B<-V> Print the version and exit. =item B<-w> Search for only those lines which contain the pattern as part of a word group. That is, the start of the pattern must match the start of a word, and the end of the pattern must match the end of a word. (Note that the start and end need not be for the I word.) If you are familiar with Perl regular expressions, this flag simply puts a "\b" before and after the search pattern. =item B<-X> Specify a regular expression for the signature separator. By default this pattern is '^-- $'. =item B<-Y> Specify a pattern which indicates specific headers to be searched. The search will automatically treat headers which span multiple lines as one long line. This flag implies B<-h>. In the style of procmail, special strings in the pattern will be expanded as follows: =over 2 If the regular expression contains "^TO:" it will be substituted by ^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To): which should match all headers with destination addresses. If the regular expression contains "^FROM_DAEMON:" it will be substituted by (^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t ][^<)]*(\(.*\).*)?)? which should catch mails coming from most daemons. If the regular expression contains "^FROM_MAILER:" it will be substituted by (^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From)([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>\t][^<)]*(\(.*\).*)?)?$([^>]|$)) (a stripped down version of "^FROM_DAEMON:"), which should catch mails coming from most mailer-daemons. So, to search for all emails to or from "Andy": grepmail -Y '(^TO:|^From:)' Andy mailbox =back =item B<--help> Print a help message summarizing the usage. =item B<--> All arguments following I<--> are treated as mail folders. =back =head1 EXAMPLES Count the number of emails. ("." matches every email.) grepmail -r . sent-mail Get all email between 2000 and 3000 bytes about books grepmail books -s 2000-3000 sent-mail Get all email that you mailed yesterday grepmail -d yesterday sent-mail Get all email that you mailed before the first thursday in June 1998 that pertains to research (requires Date::Manip): grepmail research -d "before 1st thursday in June 1998" sent-mail Get all email that you mailed before the first of June 1998 that pertains to research: grepmail research -d "before 6/1/98" sent-mail Get all email you received since 8/20/98 that wasn't about research or your job, ignoring case: grepmail -iv "(research|job)" -d "since 8/20/98" saved-mail Get all email about mime but not about Netscape. Constrain the search to match the body, since most headers contain the text "mime": grepmail -b mime saved-mail | grepmail Netscape -v Print a list of all mailboxes containing a message from Rodney. Constrain the search to the headers, since quoted emails may match the pattern: grepmail -hl "^From.*Rodney" saved-mail* Find all emails with the text "Pilot" in both the header and the body: grepmail -hb "Pilot" saved-mail* Print a count of the number of messages about grepmail in all saved-mail mailboxes: grepmail -br grepmail saved-mail* Remove any duplicates from a mailbox: grepmail -u saved-mail Convert a Gnus mailbox to mbox format: grepmail . gnus-mailbox-dir/* > mbox Search for all emails to or from an address (taking into account wrapped headers and different header names): grepmail -Y '(^TO:|^From:)' my@email.address saved-mail Find all emails from postmasters: grepmail -Y '^FROM_MAILER:' . saved-mail =head1 FILES grepmail will I create temporary files while decompressing compressed archives. The last version to do this was 3.5. While the new design uses more memory, the code is much simpler, and there is less chance that email can be read by malicious third parties. Memory usage is determined by the size of the largest email message in the mailbox. =head1 ENVIRONMENT The MAILDIR environment variable can be used to specify the default mail directory. This directory will be searched if the specified mailbox can not be found directly. The HOME environment variable is also used to find mailboxes if they can not be found directly. It is also used to store grepmail state information such as its cache file. =head1 BUGS AND LIMITATIONS =over 2 =item Patterns containing "$" may cause problems Currently I look for "$" followed by a non-word character and replace it with the line ending for the current file (either "\n" or "\r\n"). This may cause problems with complex patterns specified with -E, but I'm not aware of any. =item Mails without bodies cause problems According to RFC 822, mail messages need not have message bodies. I've found and removed one bug related to this. I'm not sure if there are others. =item Complex single-point dates not parsed correctly If you specify a point date like "September 1, 2004", grepmail creates a date range that includes the entire day of September 1, 2004. If you specify a complex point date such as "today", "1st Monday in July", or "9/1/2004 at 0:00" grepmail may parse the time incorrectly. The reason for this problem is that Date::Manip, as of version 5.42, forces default values for parsed dates and times. This means that grepmail has a hard time determining whether the user supplied certain time/date fields. (e.g. Did Date::Manip provide a default time of 0:00, or did the user specify it?) grepmail tries to work around this problem, but the workaround is inherently incomplete in some rare cases. =item File names that look like flags cause problems. In some special circumstances, grepmail will be confused by files whose names look like flags. In such cases, use the B<-e> flag to specify the search pattern. =back =head1 LICENSE This code is distributed under the GNU General Public License (GPL) Version 2. See the file LICENSE in the distribution for details. =head1 AUTHOR David Coppit Edavid@coppit.orgE =head1 SEE ALSO elm(1), mail(1), grep(1), perl(1), printmail(1), Mail::Internet(3), procmailrc(5). Crocker, D. H., Standard for the Format of Arpa Internet Text Messages, RFC 822. =cut grepmail-5.3111/t/000755 000765 000024 00000000000 13321551743 014314 5ustar00coppitstaff000000 000000 grepmail-5.3111/README000644 000765 000024 00000013110 12514467351 014731 0ustar00coppitstaff000000 000000 grepmail - search mailboxes for a particular email Grepmail searches a mailbox for a given regular expression, and returns those emails that match it. Piped input is allowed, and date and size restrictions are supported, as are searches using logical operators. Grepmail also supports a variety of compression formats: gzip, bzip2, lzip, and xz. SOME NOTES perl version: If you plan to use advanced pattern features such as "(?>...)", you will need to make sure that your version of perl supports them. Complex queries: The -E flag allows you to perform complex searches involving logical operators. For example, $email_header =~ /^From: .*\@coppit.org/ && $email =~ /grepmail/i will find all emails which originate from coppit.org (you must escape the "@" sign with a backslash), and which contain the keyword "grepmail" anywhere in the message, in any capitalization. NOTE: -E support is experimental right now. I'm looking for feedback on the following: - Do you like the feature? - Do you like the Perl-based syntax? Is there an alternative which is easier? - How should date and size constraints be integrated? Should they be "variables", a la: "$email =~ /grepmail/ && $date <= 'sep 20 1998' || $size > 50000"? - Should -i, -h, and -b be supported in conjunction with -E? (Where "-h pattern" would mean augmenting the -E pattern with "$email_header =~ /pattern/ && ") - -S ignores signatures. If/when this feature is implemented for -E, should it be "global" for all $email_body matches, or should it be possible to specify this for each $email_body match? For example, one can append an "i" modifier to an individual pattern match to make it case-insensitive. Should there be a standard way of dealing with such "global" pattern matching options on an individual pattern match basis? Message IDs: NOTE: For emails without message ids, grepmail will use Digest::MD5 to compute a hash based on the email header. If you don't have Digest::MD5, grepmail will just use the header itself as the messsage id. The Digest::MD5 checksum takes a little while to compute, but saves a lot of space. Currently there is no easy way to choose space over time. Let me know if this is a problem. MODULE DEPENDENCIES To use this program, you will need to install: - Mail::Mbox::MessageParser: required - Date::Parse: required - Date::Manip: required if you want to search using complex date specifications (-d) - Digest::MD5: not required, but can help grepmail use less memory if you are checking for unique emails (-u) and your emails don't have a Message-Id header To test this module, you will need to install: - Test::More INSTALLATION => On Non-Windows (Unix/Cygwin/etc.) systems: To install this package, change to the directory where you unarchived this distribution and type the following: perl Makefile.PL make make test make install You can install this package into a non-default location by appending one of the following to the "perl Makefile.PL" command: - "PREFIX=/installation/path" (for installation into a custom location), - "INSTALLDIRS=site" (for installation into site-specific Perl directories) - "INSTALLDIRS=perl" (for installation into standard Perl directories). If make test fails, please see the INSTALLATION PROBLEMS section below. => On Windows systems: - Just copy "grepmail" to a place in your path. You may want to rename it "grepmail.pl" if you've associated .pl files with perl.exe. CONFIGURATION You may want to set your MAIL environment variable so that grepmail will know the default location to search for mailboxes. If you are terribly concerned about performance, you may want to modify the value of the variable READ_CHUNK_SIZE located in the code. This variable controls how much text is read from the mailbox at a time. If the value is set to 0, the entire file is read into memory. (There is no user-visible option for setting this value.) You may also want to hack the code to not use Digest::MD5, thereby trading space for time. If you frequently use the same set of flags, you may wish to alias "grepmail" to "grepmail -flags" within your command interpreter (shell). See the documentation for your shell for details on how to do this. INSTALLATION PROBLEMS If "make test" fails, run make test TEST_VERBOSE=1 and see which test(s) are failing. Please email, to the address below, the output files for the test. Also email the output of running the particular subtest with the -D flag. e.g.: ./blib/script/grepmail -D --help > test_name.debug If the first date_manip test case fails, you are in a timezone that Date::Manip does not yet support. You will need to contact the author of Date::Manip. For other bugs, see the section REPORTING BUGS below. DOCUMENTATION Just "perldoc grepmail". After installation on Unix systems, you can also do "man grepmail". RESOURCES The CPAN Page: http://search.cpan.org/dist/grepmail/ The GitHub page: https://github.com/coppit/grepmail/ Bug and feature tracking: http://rt.cpan.org/Public/Dist/Display.html?Name=grepmail When reporting a bug, please attach the output of running grepmail with the -D switch. If the bug is related to processing of a particular mailbox, try to trim the mailbox to the smallest set of emails that still exhibit the problem. Then use the "anonymize_mailbox" program that comes with grepmail to remove any sensitive information, and attach the mailbox to the bug report. COPYRIGHT Copyright (c) 1998-Sep 1 2000 Broc Seib. Copyright (c) Sep 1 2000-2015 David Coppit. All rights reserved, save those granted by the license. See the file LICENSE for licensing terms. AUTHOR David Coppit grepmail-5.3111/anonymize_mailbox000755 000765 000024 00000007045 12504145755 017535 0ustar00coppitstaff000000 000000 #!/usr/bin/perl -w $VERSION = '1.00'; use strict; use FileHandle; #------------------------------------------------------------------------------- my $LINE = 0; my $FILE_HANDLE = undef; my $START = 0; my $END = 0; my $READ_BUFFER = ''; sub reset_file { my $file_handle = shift; $FILE_HANDLE = $file_handle; $LINE = 1; $START = 0; $END = 0; $READ_BUFFER = ''; } #------------------------------------------------------------------------------- # Need this for a lookahead. my $READ_CHUNK_SIZE = 0; sub read_email { # Undefined read buffer means we hit eof on the last read. return 0 unless defined $READ_BUFFER; my $line = $LINE; $START = $END; # Look for the start of the next email LOOK_FOR_NEXT_HEADER: while($READ_BUFFER =~ m/^(From\s.*\d:\d+:\d.* \d{4})/mg) { $END = pos($READ_BUFFER) - length($1); # Don't stop on email header for the first email in the buffer next if $END == 0; # Keep looking if the header we found is part of a "Begin Included # Message". my $end_of_string = substr($READ_BUFFER, $END-200, 200); if ($end_of_string =~ /\n-----( Begin Included Message |Original Message)-----\n[^\n]*\n*$/i) { next; } # Found the next email! my $email = substr($READ_BUFFER, $START, $END-$START); $LINE += ($email =~ tr/\n//); return (1, $email, $line); } # Didn't find next email in current buffer. Most likely we need to read some # more of the mailbox. Shift the current email to the front of the buffer # unless we've already done so. $READ_BUFFER = substr($READ_BUFFER,$START) unless $START == 0; $START = 0; # Start looking at the end of the buffer, but back up some in case the edge # of the newly read buffer contains the start of a new header. I believe the # RFC says header lines can be at most 90 characters long. my $search_position = length($READ_BUFFER) - 90; $search_position = 0 if $search_position < 0; # Can't use sysread because it doesn't work with ungetc if ($READ_CHUNK_SIZE == 0) { local $/ = undef; if (eof $FILE_HANDLE) { my $email = $READ_BUFFER; undef $READ_BUFFER; return (1, $email, $line); } else { $READ_BUFFER = <$FILE_HANDLE>; pos($READ_BUFFER) = $search_position; goto LOOK_FOR_NEXT_HEADER; } } else { if (read($FILE_HANDLE, $READ_BUFFER, $READ_CHUNK_SIZE, length($READ_BUFFER))) { pos($READ_BUFFER) = $search_position; goto LOOK_FOR_NEXT_HEADER; } else { my $email = $READ_BUFFER; undef $READ_BUFFER; return (1, $email, $line); } } } sub Read_Chunk_Of_Body { my $email = shift; local $/ = "\nFrom "; my $chunk = <$FILE_HANDLE>; local $/ = "From "; chomp $chunk; $LINE += ($chunk =~ tr/\n//); $$email .= $chunk; } die unless @ARGV; $FILE_HANDLE = new FileHandle($ARGV[0]); while(1) { my ($status,$email,$line) = read_email(); exit unless $status; my ($header,$body) = $email =~ /(.*?\n\n)(.*)/s; $body =~ s/\w/X/g; { my ($header_to) = $header =~ /^To: (.*)$/m; my ($header_subject) = $header =~ /^Subject: (.*)$/m; if (defined $header_to) { my $modified_header_to = $header_to; $modified_header_to =~ s/\w/X/g; $header =~ s/To: \Q$header_to\E/To: $modified_header_to/g; } if (defined $header_subject) { my $modified_header_subject = $header_subject; $modified_header_subject =~ s/\w/X/g; $header =~ s/Subject: \Q$header_subject\E/Subject: $modified_header_subject/g; } } print $header,$body; } grepmail-5.3111/TODO000644 000765 000024 00000020160 12512505127 014534 0ustar00coppitstaff000000 000000 - After Module::Install support CPAN::Meta 2.0, specify gpl_2 as the license. Suggested by Paul Howarth - After Module::Install support CPAN::Meta 2.0, add info for repository URL and bug tracker. Suggested by Paul Howarth - Support for searches on email threads. (Thanks to Zack Brown for the excellent feature idea and a prototype implementation.) - implement unimplemented code - update anonymize_mailbox to anonymize more of the header, and handle attachments. - Add mbx format support (email request) https://sourceforge.net/p/grepmail/feature-requests/10/ - Improve unique to avoid X-MimeOLE, X-MozillaStatus, and Content-Type/boundary differences. (Maybe just hash on the received headers?) Skye Otten - Interpret transfer encodings to search the actual content of emails (SF 102207) - IMAP URLs (SF 894486) - grepmailrc - override system paths to decompressor programs - set flags - Decode different transfer encodings before checking the pattern - Then support charset-independent patterns and mailboxes https://sourceforge.net/p/grepmail/bugs/34/ - Newest 25 messages. (Beth Scaer ) - grepmail -D --help doesn't display debug info. - -D should print module versions - Support ^M as a line terminator. Requested by Giovanni Bechis (https://sourceforge.net/users/gbechis). https://sourceforge.net/tracker/?func=detail&aid=1789911&group_id=2207&atid=352207 - Emit an X-UID header with an IMAP URL. Requested by Bart Schaefer (https://sourceforge.net/users/barts). https://sourceforge.net/tracker/index.php?func=detail&aid=894486&group_id=2207&atid=352207 - Michael D. Schleif suggested grepmail have support for compressed mail directories. ------------------------------------------------------------------------------ From Egmont Koblinger (https://sourceforge.net/users/egmont): - grepmail should operate at a higher level of semantics, interpreting the mbox format to extract the real text of the email for searching. Details, including sample code is here: https://sourceforge.net/tracker/?func=detail&aid=1058206&group_id=2207&atid=352207 Hi, I'm new to grepmail and tried it to see whether it fits my needs. Unfortunately it doesn't really. My problem is that grepmail performs the grep on the low level mailbox files, this way it is not *much* more than a simple grep, though definitely it is more. Basically I mean there are two problems: neither transfer encoding nor character set encodings are taken into accont. Mailbox format is a very complicated format which converts between human readable texts and byte sequences. The same human readable content can usually be converted into mailbox format more ways: there are more character set conversions (iso- 8859-1, iso-8859-2, koi8-r, utf-8...) and more transfer encodings (8- bit, base64, quoted-printable...) to choose from. I think that greping the low level mailbox doesn't make much sense, since I really don't care what charset or transfer encoding a message is encoded in. I'd like to grep in the _meaning_, the interpretation of each particular message. I'd like to find all letters where the sender typed a certain human-readable word. If a word in message body is split over multiple lines, for example, it is encoded in quoted-printable the mailbox file and there's an equal sign at the end of a line such as this: ... this is an examp= le to show what I'm talking about then I see the "example" word in my mail client without being wrapped, but `grepmail example' doesn't find it matching. Similarly, `grepmail 8859' matches every letter encoded in some of the iso-8859-* charsets, but hey, I don't care what encoding a message uses, I'm interested in whether the real content of what my friend typed includes the number 8859. And greping for accented letters is nearly impossible as each letter uses different character set encodings, but I don't want to find a particular byte sequence, I want to find a particular sequence of human-visible characters, no matter what encodings they use. So this is what IMHO grepmail should use: - convert the pattern it founds on the command line from my locale to utf-8, - for each message found in the mailbox, separately, first decode it from its transfer encoding (quoted-printable, base64...) and then iconv it from its charset to utf-8, specially taking care of the complicated encodings used in the header fields such as Subjec, - and after all these it should perform the greping, and for matching messages it should print their original (unconverted) raw mailbox version. ------------------------------------------------------------------------------ - Revise -E functionality. (Thanks to Vadim for the feedback and suggestions) Dear David, in the README of your 'grepmail' I found that you are looking for feedback on the '-E' option. So I decided do comment on it. I like this feature and I want to use all the power of perl here, so there is no need for alternatives. But I think something can be improved. First of all the variable names '$email_header' '$email_body' and '$email' are too long for command-line option. I would prefer to use for example '$h', '$b' and '$a' instead. I would also suggest to add an option (say -A) similar to perl's '-M' to allow including any perl module, so the complex conditions like grepmail -E 'use Foo::Bar; ...' may be simplified to grepmail -AFoo::Bar -E '...' Also I think that modification and compilation of user's pattern for every e-mail (in function Do_Complex_Pattern_Matching) is not an efficient way to allow complex matching. I would suggest to compile user's pattern once into anonymous subroutine and call that subroutine for each e-mail. Probably it's a good idea to use Data::Alias module to avoid extra copying. Let me summarize in pseudocode: use Data::Alias; our $h; # $a and $b are always present #... my $sub_ref; if ( $opts{'E'} ) { $sub_ref = eval "sub { $opts{'E'} }" or die "..."; } # Before calling Do_Complex_Pattern_Matching alias local $a = $email; alias local $h = $email_header; alias local $b = $email_body; ... = Do_Complex_Pattern_Matching(...); # In Do_Complex_Pattern_Matching if( $sub_ref ) { $matchesEmail = $sub_ref->(); } Thank you for 'grepmail' and I hope you will find something useful in my feedback. Vadim. ------------------------------------------------------------------------------ - Add UTF mime support. (Thanks to Peter Jakobi for the feature suggestion and patch.) See email and grepmail.jakobi* Hi, given the recent increase in utf mime mails, I was a bit annoyed at grepmail's lack of support. And living in Germany, the few umlauts make it far more likely to write/receive/archive mimed-email. From header =?...?= to real mimes. And encountering old latin1 umlauts in source, filenames and stuff on an utf-8 system is nice. Nearly as nice as not having set LC_COLLATE and wondering why [a-z]* suddenly likes to match uppercase on a new ubuntu box. Anyway, annoyance breeds code, and code lacks testing. I'd love if you could take a look at this, as I don't have enough interesting test cases on my own. Worse, as it works for me more or less now, the annoyance level is too low to properly maintain and bulletproof the patch. The basic idea is: grep a mangled mail version on -z, but return the valid one on output. Furthermore, I'm not that much interested in anything but German umlauts and the most common European one, and I want to grep for words containing them in Plain-Ascii (i.e. the eMail is mangled to Ue instead of uppercase U diaeris), where latin1==ascii==utf-8, so this kind of allows skipping the whole thorny $LANG issue during grep. As the mangled version isn't for output, this allowed to add on a basic de-html and paragraph mode to ease grepping. My few test cases were in simple mode, but as I'm outside the grep functions, -E queries should also behave. See attachments; patch is against ubuntu7.10beta's take on the ancient stable version of grepmail. what do you think? ------------------------------------------------------------------------------ grepmail-5.3111/META.yml000644 000765 000024 00000001736 13321551653 015331 0ustar00coppitstaff000000 000000 --- abstract: 'search mailboxes for mail matching a regular expression' author: - 'David Coppit ' build_requires: ExtUtils::MakeMaker: 6.36 File::Slurper: 0 Test::Compile: 0 Test::More: 0 UNIVERSAL::require: 0 configure_requires: ExtUtils::MakeMaker: 6.36 URI::Escape: 0 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.19' license: gpl2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: grepmail no_index: directory: - inc - private-lib - t provides: grepmail: file: grepmail version: '5.3111' requires: Date::Parse: 0 Mail::Mbox::MessageParser: '1.4001' Time::Local: '1.2300' perl: '5.005' resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=grepmail homepage: https://github.com/coppit/grepmail license: http://opensource.org/licenses/gpl-2.0.php repository: https://github.com/coppit/grepmail version: '5.3111' grepmail-5.3111/private-lib/000755 000765 000024 00000000000 13321551743 016267 5ustar00coppitstaff000000 000000 grepmail-5.3111/Makefile.PL000644 000765 000024 00000005034 13321551444 016023 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; # For PRIVATE Module::Install extensions use lib 'private-lib'; use lib '.'; use inc::Module::Install; # To prevent MakeMaker from processing our old directory BEGIN { makemaker_args( NORECURS => 1 ) } # Do all_from first to get the required perl version before # check_custom_installation runs name('grepmail'); all_from('grepmail'); auto_set_bugtracker; githubmeta; provides( 'grepmail' => { file => 'grepmail', version => version(), } ); # Perl 5.6 doesn't work with URI::Escape. We get an error about Exporter not exporting "import" perl_version '5.008'; check_custom_installation(); install_script('grepmail'); configure_requires( # Module::Install::Bugtracker needs this 'URI::Escape' => 0, ); requires( 'Date::Parse' => 0, 'Mail::Mbox::MessageParser' => '1.4001', # I don't really require such a new version, but some old OSes have a # version 1.11 that doesn't work right. Updating to the "real" 1.11 does # work right. Repro'd on a RHEL 5 Update 11 VM in AWS, running perl 5.8.8. 'Time::Local' => '1.2300', ); test_requires( 'Test::Compile' => 0, 'File::Slurper' => 0, 'Test::More' => 0, ); check_optional('Digest::MD5' => 0, "Digest::MD5 reduces memory consumption for the -u (unique) option\n"); check_optional('Date::Manip' => 0, "Date::Manip allows you to use complex date patterns for the -d option\n"); check_optional('Benchmark::Timer' => 0, "Benchmark::Timer is required for speed tests\n"); Add_Test_Target('testspeed', 't/speed.pl'); license 'gpl2'; use_standard_tests; auto_license(holder => 'David Coppit'); no_index 'directory' => 'private-lib'; enable_verbose_cpan_testing(); realclean_files('inc'); WriteAll; # ---- Workaround for broken module ---- # https://rt.cpan.org/Ticket/Display.html?id=125772 { package Module::Install::StandardTests; sub write_standard_test_compile { my $self = shift; $self->write_test_file('000_standard__compile.t', q/ BEGIN { if ($^O eq 'MSWin32') { require Test::More; Test::More->import(skip_all => "Test::Compile doesn't work properly on Windows"); } else { require Test::More; Test::More->import(); eval "use Test::Compile"; Test::More->builder->BAIL_OUT( "Test::Compile required for testing compilation") if $@; all_pm_files_ok(); } } /); } } fix_standard_tests('grepmail'); Update_Test_Version('grepmail','t/results/help'); grepmail-5.3111/private-lib/Module/000755 000765 000024 00000000000 13321551743 017514 5ustar00coppitstaff000000 000000 grepmail-5.3111/private-lib/Module/Install/000755 000765 000024 00000000000 13321551743 021122 5ustar00coppitstaff000000 000000 grepmail-5.3111/private-lib/Module/Install/PRIVATE/000755 000765 000024 00000000000 13321551743 022234 5ustar00coppitstaff000000 000000 grepmail-5.3111/private-lib/Module/Install/PRIVATE/Add_Test_Target.pm000644 000765 000024 00000001045 12515001403 025552 0ustar00coppitstaff000000 000000 package Module::Install::PRIVATE::Add_Test_Target; use strict; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.10.0/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub Add_Test_Target { my ($self, $target, $test) = @_; *main::MY::postamble = sub { return &Module::AutoInstall::postamble . <perl_version('5.005'); $self->include_deps('File::Slurper', 0); require File::Slurper; File::Slurper->import('read_text', 'write_text'); # Update compile test { my $test = read_text('t/000_standard__compile.t', undef, 1); $test =~ s#all_pm_files_ok\(\)#all_pl_files_ok('blib/script/$script_name')# or die "Couldn't update compile test"; write_text('t/000_standard__compile.t', $test, undef, 1); } # Update critic test { my $test = read_text('t/000_standard__perl_critic.t', undef, 1); $test =~ s#all_critic_ok\("lib"\)#all_critic_ok("blib")# or die "Couldn't update critic test"; write_text('t/000_standard__perl_critic.t', $test, undef, 1); } } 1; grepmail-5.3111/private-lib/Module/Install/PRIVATE/Enable_Verbose_CPAN_Testing.pm000644 000765 000024 00000002245 13321275624 027747 0ustar00coppitstaff000000 000000 package Module::Install::PRIVATE::Enable_Verbose_CPAN_Testing; use strict; use warnings; use lib 'inc'; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.1.0/ =~ /(\d+)/g; our( $ORIG_TEST_VIA_HARNESS ); # --------------------------------------------------------------------------- sub enable_verbose_cpan_testing { my ($self, @args) = @_; # Tell Module::Install to include this, since we use it. $self->perl_version('5.005'); $self->include_deps('Module::Install::AutomatedTester', 0); # Avoid subroutine redefined errors if (!defined(&Module::Install::AutomatedTester::auto_tester)) { require Module::Install::AutomatedTester; } return unless Module::Install::AutomatedTester::auto_tester(); unless(defined $ORIG_TEST_VIA_HARNESS) { $ORIG_TEST_VIA_HARNESS = MY->can('test_via_harness'); no warnings 'redefine'; *MY::test_via_harness = \&_force_verbose; } } sub _force_verbose { my($self, $perl, $tests) = @_; my $command = MY->$ORIG_TEST_VIA_HARNESS($perl || '$(FULLPERLRUN)', $tests); $command =~ s/\$\(TEST_VERBOSE\)/1/; return $command; } 1; grepmail-5.3111/private-lib/Module/Install/PRIVATE/Update_Test_Version.pm000644 000765 000024 00000002133 13321551012 026504 0ustar00coppitstaff000000 000000 package Module::Install::PRIVATE::Update_Test_Version; use strict; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.10.0/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub Update_Test_Version { my $self = shift; my $file_with_version = shift; my $test_case_file = shift; $self->include_deps('File::Slurper', 0); require File::Slurper; File::Slurper->import('read_text', 'write_text'); open SOURCE, $file_with_version or die "Couldn't open grepmail file: $!"; my $found = 0; while (my $line = ) { if ($line =~ /^\$VERSION = (.*q\/(.*?)\/.*);/) { $found = 1; my $version = eval $1; my $test_case_code = read_text($test_case_file, undef, 1); $test_case_code =~ s/^grepmail .*$/grepmail $version/m; unlink $test_case_file; write_text("$test_case_file", $test_case_code, undef, 1); last; } } die "Couldn't find version line in $file_with_version" unless $found; close SOURCE; } 1; grepmail-5.3111/t/line_number.t000755 000765 000024 00000004523 12517202435 017004 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -n Handy t/mailboxes/mailarc-1.txt' => ['number_1','none'], "grepmail -n -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['number_1','none'], 'grepmail -n Handy t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['number_2','none'], "grepmail -n -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['number_2','none'], 'grepmail -n Handy t/mailboxes/mailarc-1-dos.txt' => ['number_1_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/help.t000755 000765 000024 00000003603 12517202377 015440 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail --help' => ['help','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/size.t000755 000765 000024 00000004520 12517202573 015457 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( "grepmail Handy -s $single_quote<=2000$single_quote t/mailboxes/mailarc-1.txt" => ['size_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote -s $single_quote<=2000$single_quote t/mailboxes/mailarc-1.txt" => ['size_handy','none'], 'grepmail -s 1300-1500 t/mailboxes/mailarc-1.txt' => ['all_luikeith','none'], "grepmail -s $single_quote>3000$single_quote t/mailboxes/mailarc-1.txt" => ['size_2','none'], 'grepmail -s 1211 t/mailboxes/mailarc-1.txt' => ['size_3','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/append_header.t000755 000765 000024 00000004664 12517202242 017266 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -m Handy t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['append_header','none'], "grepmail -m -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['append_header','none'], 'grepmail -mn Handy t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['number_append_header','none'], "grepmail -mn -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['number_append_header','none'], 'grepmail -m Handy t/mailboxes/mailarc-1-dos.txt' => ['append_header_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/invalid_mailbox.t000755 000765 000024 00000005233 13320454655 017653 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); use File::Copy; use File::Slurper qw(read_text); my $CAT = perl_with_inc() . qq{ -MTest::Utils -e catbin}; my %tests = ( "$CAT t/mailboxes/non-mailbox.txt.gz | grepmail pattern" => 'none', "$CAT t/mailboxes/non-mailbox.txt.gz | grepmail -E $single_quote\$email =~ /pattern/$single_quote" => 'none', ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my $stdout_file = shift; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected."); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr."); return; } my $real_stdout = catfile('t','results',$stdout_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Inspect_Stderr($test_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub Inspect_Stderr { my $filename = shift; my $stderr = read_text($filename, undef, 1); like($stderr, qr/Standard input is not a mailbox/, '"Standard input is not a mailbox" message') or diag("See $filename"); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; use Mail::Mbox::MessageParser; unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'gzip'}) { $skip{"$CAT t/mailboxes/non-mailbox.txt.gz | grepmail pattern"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; $skip{"$CAT t/mailboxes/non-mailbox.txt.gz | grepmail -E $single_quote\$email =~ /pattern/$single_quote"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; } return %skip; } grepmail-5.3111/t/header.t000755 000765 000024 00000004360 12517202366 015737 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -h Handy t/mailboxes/mailarc-1.txt' => ['header_handy','none'], 'grepmail -h "^From.*aarone" t/mailboxes/mailarc-1.txt' => ['header_aarone','none'], 'grepmail -hb Handy t/mailboxes/mailarc-1.txt' => ['header_body_handy','none'], 'grepmail -h Handy t/mailboxes/mailarc-1.txt' => ['header_handy','none'], 'grepmail -h Handy t/mailboxes/mailarc-1-dos.txt' => ['header_handy_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/count.t000755 000765 000024 00000004415 12517202334 015633 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -r . t/mailboxes/mailseparators.txt' => ['count_all','none'], "grepmail -r -E $single_quote\$email_body =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['count_handy','none'], 'grepmail -br Handy t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['count_handy','none'], 'grepmail -br Handy t/mailboxes/mailarc-1-dos.txt t/mailboxes/mailarc-2.txt' => ['count_handy_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stdout,$real_stdout); Do_Diff($test_stderr,$real_stderr); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/status.t000755 000765 000024 00000003641 12517202601 016023 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -j ro t/mailboxes/mailarc-1.txt' => ['ro_status','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/patterns000644 000765 000024 00000000015 12504145755 016077 0ustar00coppitstaff000000 000000 Handy buffer grepmail-5.3111/t/Test/000755 000765 000024 00000000000 13321551743 015233 5ustar00coppitstaff000000 000000 grepmail-5.3111/t/recursive.t000755 000765 000024 00000007075 13320022226 016510 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); use ExtUtils::Command; my %tests = ( "grepmail -Rq Handy $TEMPDIR/directory" => ['recursive','none'], "grepmail -Rq -E $single_quote\$email =~ /Handy/$single_quote $TEMPDIR/directory" => ['recursive','none'], "grepmail -Lq Handy $TEMPDIR/directory_with_links" => ['recursive2','none'], "grepmail -Rq Handy $TEMPDIR/directory_with_links" => ['recursive','none'], ); my %expected_errors = ( ); # Copy over the files so that there are no version control directories in our # search directory. I could use File::Copy, but it doesn't support globbing # and multiple-file copying. :( { my @old_argv = @ARGV; mkdir "$TEMPDIR/directory", 0700; @ARGV = ('t/mailboxes/directory/*txt*', "$TEMPDIR/directory"); cp(); mkdir "$TEMPDIR/directory_with_links", 0700; # Ignore the failed links. We'll let SetSkip deal with the test cases for # systems that don't support it. eval { symlink("$TEMPDIR/directory", "$TEMPDIR/directory_with_links/symlink"); mkdir "$TEMPDIR/directory_with_links/subdir", 0700; link("$TEMPDIR/directory/mailarc-2.txt", "$TEMPDIR/directory_with_links/subdir/link.txt"); }; @ARGV = @old_argv; } plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SymlinksAndLinksWork { return (-e 'directory_with_links/symlink/mailarc-1.txt') && (-s 'directory_with_links/symlink/mailarc-1.txt' == 64865) && (-e 'directory_with_links/subdir/link.txt') && (-s 'directory_with_links/subdir/link.txt' == 64865); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; unless ( SymlinksAndLinksWork() ) { $skip{"grepmail -Lq Handy $TEMPDIR/directory_with_links"} = 'Links or symbolic links are not supported on this platform'; $skip{"grepmail -Rq Handy $TEMPDIR/directory_with_links"} = 'Links or symbolic links are not supported on this platform'; } return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/ignore_signatures.t000755 000765 000024 00000006116 12517202407 020233 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -ibS Free t/mailboxes/mailarc-1.txt' => ['ignore_signatures','none'], "grepmail -S ${single_quote}So I got Unix$single_quote t/mailboxes/mailarc-1.txt" => ['none','none'], "grepmail -X $single_quote={75,}$single_quote -S ${single_quote}61 2 9844 5381$single_quote t/mailboxes/mailarc-1.txt" => ['none','none'], # Unimplemented "grepmail -iS -E $single_quote\$email_body =~ /Free/$single_quote t/mailboxes/mailarc-1.txt" => ['none','none'], # Unimplemented "grepmail -S $single_quote\$email =~ /So I got Unix/$single_quote t/mailboxes/mailarc-1.txt" => ['none','none'], # Unimplemented "grepmail -X $single_quote\={75,}$single_quote -S -E $single_quote\$email =~ /61 2 9844 5381/$single_quote t/mailboxes/mailarc-1.txt" => ['none','none'], 'grepmail -ibS Free t/mailboxes/mailarc-1-dos.txt' => ['ignore_signatures_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; $skip{"grepmail -iS -E $single_quote\$email_body =~ /Free/$single_quote t/mailboxes/mailarc-1.txt"} = 'unimplemented'; $skip{"grepmail -S $single_quote\$email =~ /So I got Unix/$single_quote t/mailboxes/mailarc-1.txt"} = 'unimplemented'; $skip{"grepmail -X $single_quote={75,}$single_quote -S -E $single_quote\$email =~ /61 2 9844 5381/$single_quote t/mailboxes/mailarc-1.txt"} = 'unimplemented'; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/body.t000755 000765 000024 00000004654 12517202744 015452 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -b mime t/mailboxes/mailarc-1.txt' => ['body_mime','none'], 'grepmail -b Handy t/mailboxes/mailarc-1.txt' => ['body_handy','none'], "grepmail -Y $single_quote.*$single_quote -b Handy t/mailboxes/mailarc-1.txt" => ['body_handy','none'], 'grepmail -b mime t/mailboxes/mailarc-1-dos.txt' => ['body_mime_dos','none'], 'grepmail -b "my$" t/mailboxes/mailarc-1.txt' => ['body_my','none'], 'grepmail -b "my$" t/mailboxes/mailarc-1-dos.txt' => ['body_my_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; $skip{"grepmail -Y $single_quote.*$single_quote -b Handy t/mailboxes/mailarc-1.txt"} = 'unimplemented'; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/speed.pl000755 000765 000024 00000017420 13320454760 015760 0ustar00coppitstaff000000 000000 #!/usr/bin/perl # These tests operate on a mail archive I found on the web at # http://el.www.media.mit.edu/groups/el/projects/handy-board/mailarc.txt # and then broke into pieces use strict; use warnings 'all'; use lib 't'; use Test::Utils; use Benchmark; use Benchmark::Timer; use FileHandle; use Test::ConfigureGrepmail; use File::Copy; use File::Spec; use File::Spec::Functions; use Config; use File::Slurper qw(read_text); my $path_to_perl = $Config{perlpath}; BEGIN { die "Need Benchmark::Timer 0.6 or higher" unless $Benchmark::Timer::VERSION >= 0.6; } my $MAILBOX_SIZE = 10_000_000; my $TEMP_MAILBOX = File::Spec::Functions::catfile($TEMPDIR, 'bigmailbox.txt'); my $SKIP = 5; my $MINIMUM = 10; my $CONFIDENCE = 99; my $ERROR = 1; my @IMPLEMENTATIONS_TO_TEST = ( 'Perl', 'Grep', 'Cache Init', 'Cache Use', ); my %TESTS = ( 'SIMPLE' => "grepmail library \$TEMP_MAILBOX", #'DATE' => "grepmail library -d \"before oct 15 1998\" \$TEMP_MAILBOX", 'COMPRESSED' => "grepmail library \$TEMP_MAILBOX", #'HEADER' => "grepmail -h library \$TEMP_MAILBOX", #'BODY' => "grepmail -b library \$TEMP_MAILBOX", #'BODY & HEADER' => "grepmail -bh library \$TEMP_MAILBOX", #'PIPE' => "cat \$TEMP_MAILBOX | grepmail library", ); my $filename = CreateInputFiles(); foreach my $label (keys %TESTS) { print "\n"; my $new_filename = $filename; $new_filename .= ".gz" if $label =~ /COMPRESS/; my $test = $TESTS{$label}; $test =~ s/\$TEMP_MAILBOX/$new_filename/g; print "Executing speed test \"$label\":\n$test\n\n"; my $data = CollectData($test); print "=========================================\n"; DoHeadToHeadComparison($data); print "=========================================\n"; DoImplementationsComparison($data); print "#########################################\n"; } # make clean will take care of it #END #{ # RemoveInputFile($TEMP_MAILBOX); #} ################################################################################ sub RemoveInputFile { my $filename = shift; unlink $filename; } ################################################################################ sub CreateInputFiles { my $filename = $TEMP_MAILBOX; my @mailboxes; my @letters = 'a'..'z'; unless(-e $filename && abs((-s $filename) - $MAILBOX_SIZE) <= $MAILBOX_SIZE*.1) { print "Making input file ($MAILBOX_SIZE bytes).\n"; my $data = read_text('t/mailboxes/mailarc-1.txt', undef, 1); open FILE, ">$filename"; binmode FILE; my $number = 0; while (-s $filename < $MAILBOX_SIZE) { print FILE $data, "\n"; $number++; # Also make an email with a 1MB attachment. print FILE<<"EOF"; From XXXXXXXX\@XXXXXXX.XXX.XXX.XXX Sat Apr 19 19:30:45 2003 Received: from XXXXXX.XXX.XXX.XXX (XXXXXX.XXX.XXX.XXX [##.##.#.##]) by XXX.XXXXXXXX.XXX id h3JNTvkA009295 envelope-from XXXXXXXX\@XXXXXXX.XXX.XXX.XXX for ; Sat, 19 Apr 2003 19:29:57 -0400 (EDT)8f/81N9n7q (envelope-from XXXXXXXX\@XXXXXXX.XXX.XXX.XXX) Date: Sat, 19 Apr 2003 19:29:50 -0400 (EDT) From: Xxxxxxx Xxxxxxxx To: "'Xxxxx Xxxxxx'" Subject: RE: FW: Xxxxxx--xxxxxx xxxxxxxx xxxxx xxxxxxx (xxx) Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="873612032-418625252-1050794990=:31078" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime\@docserver.cac.washington.edu for more info. --873612032-418625252-1050794990=:31078 Content-Type: TEXT/PLAIN; charset=US-ASCII I am not sure if the message below went through. I accidentally attached too big a file with it. Now it's nicely zipped. --873612032-418625252-1050794990=:31078 Content-Type: APPLICATION/x-gzip; name="testera_dft_4_mchaff.tar.gz" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="foo.tar.gz" EOF for (1 .. 1_000_000/75) { print FILE @letters[rand(26)] for 1..74; print FILE "\n"; } print FILE "--873612032-418625252-1050794990=:31078--\n\n"; } close FILE; } print "Making compressed input file.\n"; unlink "$filename.gz"; system "gzip -c --force --best $filename > $filename.gz"; return $filename; } ################################################################################ sub CollectData { my $test = shift; print "Collecting data...\n\n"; my %data; use IPC::Open3; use Symbol qw(gensym); open(NULL, ">", File::Spec->devnull); # To prevent a "used only once" warning my $foo = *NULL; copy('grepmail', catfile($TEMPDIR, 'grepmail')); copy('grepmail.old', catfile($TEMPDIR, 'grepmail.old')); my %settings = ( 'Perl' => [0,0], 'Grep' => [0,1], 'Cache Init' => [1,1], 'Cache Use' => [1,0], ); foreach my $old_or_new (qw(New Old)) { my $grepmail = catfile($TEMPDIR, 'grepmail'); $grepmail .= '.old' if $old_or_new eq 'Old'; Test::ConfigureGrepmail::Set_Cache_File($grepmail, catfile($TEMPDIR, 'cache')); foreach my $impl (@IMPLEMENTATIONS_TO_TEST) { my $label = "$old_or_new $impl"; my $new_test = $test; $new_test =~ s/\bgrepmail\b/$path_to_perl $grepmail/g; print "$impl ($old_or_new)\n"; Test::ConfigureGrepmail::Set_Caching_And_Grep($grepmail, @{$settings{$impl}}); my $t = new Benchmark::Timer(skip => $SKIP, minimum => $MINIMUM, confidence => $CONFIDENCE, error => $ERROR); # Need enough for the statistics to be valid my $count = 1; while ($t->need_more_samples($label)) { print "."; unlink catfile($TEMPDIR, 'cache') if $impl eq 'Cache Init'; $t->start($label); my $pid = open3(gensym, ">&NULL", ">&STDERR", $new_test); waitpid($pid, 0); $t->stop($label); $count++; } print "\n\n"; print $t->report($label); my $sum = 0; my %results = $t->data(); map { $sum += $_ } @{$results{$label}}; # Fake a benchmark object so we can compare later using Benchmark my $benchmark = new Benchmark; die "Benchmark object doesn't look right" unless @$benchmark == 6; # Assign our total to the CPU entry, since that what the module compares. @$benchmark = ( $sum, 0, 0, $sum, 0, scalar @{$results{$label}} ); $data{$label} = $benchmark; } } close NULL; return \%data; } ################################################################################ sub DoHeadToHeadComparison { my $data = shift; print "HEAD TO HEAD COMPARISON\n\n"; my @labels = grep { s/New // } keys %$data; my $first = 1; foreach my $label (@labels) { next unless exists $data->{"Old $label"} && exists $data->{"New $label"}; print "-----------------------------------------\n" unless $first; my %head_to_head = ("Old $label" => $data->{"Old $label"}, "New $label" => $data->{"New $label"}); Benchmark::cmpthese(\%head_to_head); $first = 0; } } ################################################################################ sub DoImplementationsComparison { my $data = shift; print "IMPLEMENTATION COMPARISON\n\n"; { my @old_labels = grep { /Old / } keys %$data; my %old; foreach my $label (@old_labels) { $old{$label} = $data->{$label}; } Benchmark::cmpthese(\%old); } print "-----------------------------------------\n"; { my @new_labels = grep { /New / } keys %$data; my %new; foreach my $label (@new_labels) { $new{$label} = $data->{$label}; } Benchmark::cmpthese(\%new); } } ################################################################################ grepmail-5.3111/t/not_match_uncompressed.t000755 000765 000024 00000006532 12517202524 021251 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -v Handy t/mailboxes/mailarc-1.txt' => ['not_handy','none'], 'grepmail -hbv Handy t/mailboxes/mailarc-1.txt' => ['not_header_body_handy','none'], 'grepmail -bv Handy t/mailboxes/mailarc-1.txt' => ['not_body_handy','none'], 'grepmail -hv Handy t/mailboxes/mailarc-1.txt' => ['not_header_handy','none'], "grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['not_handy','none'], "grepmail -v -E $single_quote\$email_header =~ /Handy/ && \$email_body =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['not_header_body_handy','none'], "grepmail -Y $single_quote.*$single_quote -bv Handy t/mailboxes/mailarc-1.txt" => ['not_header_body_handy','none'], "grepmail -Y $single_quote.*$single_quote -v Handy t/mailboxes/mailarc-1.txt" => ['not_header_handy','none'], "grepmail -v -E $single_quote\$email_body =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['not_body_handy','none'], "grepmail -v -E $single_quote\$email_header =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['not_header_handy','none'], # Unimplemented "grepmail -Y $single_quote.*$single_quote -bv Handy t/mailboxes/mailarc-1.txt" => ['none','none'], # Unimplemented "grepmail -Y $single_quote.*$single_quote -v Handy t/mailboxes/mailarc-1.txt" => ['none','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; $skip{"grepmail -Y $single_quote.*$single_quote -bv Handy t/mailboxes/mailarc-1.txt"} = 'unimplemented'; $skip{"grepmail -Y $single_quote.*$single_quote -v Handy t/mailboxes/mailarc-1.txt"} = 'unimplemented'; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/date.t000755 000765 000024 00000005444 12517202347 015427 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail Handy -d "before July 9 1998" t/mailboxes/mailarc-1.txt' => ['date_2','none'], 'grepmail -d "before July 15 1998" t/mailboxes/mailarc-1.txt' => ['date_1','none'], 'grepmail -d "after armageddon" Handy t/mailboxes/mailarc-1.txt' => ['none','invalid_date_1'], 'grepmail -d "before 7/15/1998" t/mailboxes/mailarc-2.txt' => ['date_3','none'], 'grepmail -d "" t/mailboxes/mailarc-2.txt' => ['none','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote -d \"before July 9 1998\" t/mailboxes/mailarc-1.txt" => ['date_2','none'], "grepmail -d \"after armageddon\" -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['none','invalid_date_1'], 'grepmail -d "Aug 1998" t/mailboxes/mailarc-1.txt' => ['date_august','none'], ); my %expected_errors = ( 'grepmail -d "after armageddon" Handy t/mailboxes/mailarc-1.txt' => 1, "grepmail -d \"after armageddon\" -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => 1, ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/cache.t000755 000765 000024 00000006263 12517202306 015550 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail Handy t/mailboxes/mailarc-1.txt' => ['all_handy','none'], 'grepmail Handy t/mailboxes/mailarc-1.txt.gz' => ['all_handy','none'], 'grepmail Handy t/mailboxes/mailarc-1.txt.bz2' => ['all_handy','none'], 'grepmail Handy t/mailboxes/mailarc-1.txt.lz' => ['all_handy','none'], 'grepmail Handy t/mailboxes/mailarc-1.txt.xz' => ['all_handy','none'], 'grepmail -e Handy t/mailboxes/mailarc-1.txt' => ['all_handy','none'], 'grepmail Handy t/mailboxes/mailarc-1-dos.txt' => ['all_handy_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); unlink catfile($TEMPDIR,'cache'); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'gzip'}) { $skip{'grepmail Handy t/mailboxes/mailarc-1.txt.gz'} = 'gzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'bzip2'}) { $skip{'grepmail Handy t/mailboxes/mailarc-1.txt.bz2'} = 'bzip2 support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'lzip'}) { $skip{'grepmail Handy t/mailboxes/mailarc-1.txt.lz'} = 'lzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'xz'}) { $skip{'grepmail Handy t/mailboxes/mailarc-1.txt.xz'} = 'xz support not enabled in Mail::Mbox::MessageParser'; } return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/complex_expression.t000755 000765 000024 00000006176 12517202322 020434 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( "grepmail -E $single_quote\$email_body =~ /mime/$single_quote t/mailboxes/mailarc-1.txt" => ['body_mime','none'], "grepmail -E $single_quote\$email_header =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['header_handy','none'], "grepmail -E $single_quote\$email_header =~ /^From.*aarone/$single_quote t/mailboxes/mailarc-1.txt" => ['header_aarone','none'], "grepmail -E $single_quote\$email_header =~ /Handy/ && \$email_body =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['header_body_handy','none'], "grepmail -E $single_quote\$email_body =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['body_handy','none'], "grepmail -E $single_quote\$email_header =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['header_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt" => ['all_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/ && \$email =~ /imagecraft/i$single_quote t/mailboxes/mailarc-1.txt" => ['all_handy_imagecraft','none'], "grepmail -E $single_quote\$email =~ /Handy/ && \$email_header =~ /Blank/$single_quote t/mailboxes/mailarc-1.txt" => ['all_handy_blank','none'], "grepmail -E $single_quote\$email =~ /Handy/ || \$email =~ /buffer/$single_quote t/mailboxes/mailarc-1.txt" => ['all_handy_buffer','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/no_patterns000644 000765 000024 00000000000 12504145755 016565 0ustar00coppitstaff000000 000000 grepmail-5.3111/t/received_date.t000755 000765 000024 00000003657 12517202555 017302 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -ad "before 7/15/1998" t/mailboxes/mailarc-1.txt' => ['date_1','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/auto_search.t000755 000765 000024 00000004077 12517202264 017006 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( "$set_env MAILDIR=t/mailboxes$command_separator grepmail Handy mailarc-1.txt" => ['all_handy','none'], "$set_env MAILDIR=t/mailboxes$command_separator grepmail -d \"before July 15 1998\" mailarc-1.txt" => ['date_1','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/match_words.t000755 000765 000024 00000003703 12517202476 017023 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( "grepmail -w ${single_quote}let$single_quote t/mailboxes/mailarc-1.txt" => ['match_word_let','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/pipe_compressed.t000755 000765 000024 00000010203 12517230360 017654 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my $CAT = perl_with_inc() . qq{ -MTest::Utils -e catbin}; my %tests = ( "$CAT t/mailboxes/mailarc-1.txt.gz | grepmail Handy" => ['all_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.bz2 | grepmail Handy" => ['all_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.lz | grepmail Handy" => ['all_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.xz | grepmail Handy" => ['all_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.gz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote" => ['not_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.bz2 | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote" => ['not_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.lz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote" => ['not_handy','none'], "$CAT t/mailboxes/mailarc-1.txt.xz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote" => ['not_handy','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'gzip'}) { $skip{"$CAT t/mailboxes/mailarc-1.txt.gz | grepmail Handy"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; $skip{"$CAT t/mailboxes/mailarc-1.txt.gz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'bzip2'}) { $skip{"$CAT t/mailboxes/mailarc-1.txt.bz2 | grepmail Handy"} = 'bzip2 support not enabled in Mail::Mbox::MessageParser'; $skip{"$CAT t/mailboxes/mailarc-1.txt.bz2 | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote"} = 'bzip2 support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'lzip'}) { $skip{"$CAT t/mailboxes/mailarc-1.txt.lz | grepmail Handy"} = 'lzip support not enabled in Mail::Mbox::MessageParser'; $skip{"$CAT t/mailboxes/mailarc-1.txt.lz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote"} = 'lzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'xz'}) { $skip{"$CAT t/mailboxes/mailarc-1.txt.xz | grepmail Handy"} = 'xz support not enabled in Mail::Mbox::MessageParser'; $skip{"$CAT t/mailboxes/mailarc-1.txt.xz | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote"} = 'xz support not enabled in Mail::Mbox::MessageParser'; } return %skip; } grepmail-5.3111/t/list.t000755 000765 000024 00000004656 12517202445 015470 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -l Handy t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['list_handy','none'], 'grepmail -e Handy -l t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt' => ['list_handy','none'], "grepmail -l -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['list_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote -l t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt" => ['list_handy','none'], 'grepmail -l Handy t/mailboxes/mailarc-1-dos.txt t/mailboxes/mailarc-2.txt' => ['list_handy_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/results/000755 000765 000024 00000000000 13321551743 016015 5ustar00coppitstaff000000 000000 grepmail-5.3111/t/pipe_uncompressed.t000755 000765 000024 00000004144 12517230366 020234 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my $CAT = perl_with_inc() . qq{ -MTest::Utils -e catbin}; my %tests = ( qq{$CAT t/mailboxes/mailarc-1.txt | grepmail -v Handy} => ['not_handy','none'], qq{$CAT t/mailboxes/mailarc-1.txt | grepmail -v -E $single_quote\$email =~ /Handy/$single_quote} => ['not_handy','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/mailboxes/000755 000765 000024 00000000000 13321551743 016277 5ustar00coppitstaff000000 000000 grepmail-5.3111/t/mime_attachments.t000755 000765 000024 00000003656 13316204673 020041 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -M Motors.c t/mailboxes/mailarc-1.txt' => ['mime_attachments','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/pattern_file.t000755 000765 000024 00000003774 12517202536 017172 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -f t/patterns t/mailboxes/mailarc-1.txt' => ['all_handy_buffer','none'], 'grepmail -f t/no_patterns t/mailboxes/mailarc-1.txt' => ['none','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/nonexistent_mailbox.t000755 000765 000024 00000006662 13320463300 020575 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); use File::Copy; use File::Slurper qw(read_binary write_binary); my %tests = ( 'grepmail pattern no_such_file' => ['none','no_such_file'], "grepmail -E $single_quote\$email =~ /pattern/$single_quote no_such_file" => ['none','no_such_file'], ); my %expected_errors = ( ); my %localization = ( "grepmail -E $single_quote\$email =~ /pattern/$single_quote no_such_file" => { 'stderr' => { 'search' => '[No such file or directory]', 'replace' => No_such_file_or_directory() }, }, 'grepmail pattern no_such_file' => { 'stderr' => { 'search' => '[No such file or directory]', 'replace' => No_such_file_or_directory() }, }, ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}, $localization{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $localization = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); print "$test 1>$test_stdout 2>$test_stderr\n"; system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $modified_stdout = "$TEMPDIR/$stdout_file"; my $modified_stderr = "$TEMPDIR/$stderr_file"; my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); if (defined $localization->{'stdout'}) { LocalizeTestOutput($localization->{'stdout'}, $real_stdout, $modified_stdout); } else { copy($real_stdout, $modified_stdout); } if (defined $localization->{'stderr'}) { LocalizeTestOutput($localization->{'stderr'}, $real_stderr, $modified_stderr) } else { copy($real_stderr, $modified_stderr); } # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$modified_stderr); Do_Diff($test_stdout,$modified_stdout); unlink $modified_stdout; unlink $modified_stderr; } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- sub LocalizeTestOutput { my $search_replace = shift; my $original_file = shift; my $new_file = shift; my $original = read_binary($original_file); my $new = $original; $new =~ s/\Q$search_replace->{'search'}\E/$search_replace->{'replace'}/gx; write_binary($new_file, $new); } # --------------------------------------------------------------------------- grepmail-5.3111/t/unique.t000755 000765 000024 00000005011 12517202610 015777 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail Handy -u t/mailboxes/mailarc-1.txt' => ['unique_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote -u t/mailboxes/mailarc-1.txt" => ['unique_handy','none'], "grepmail -i $single_quote\$email_body =~ /imagecraft/$single_quote -u t/mailboxes/mailarc-1.txt" => ['unique_body_imagecraft','none'], 'grepmail -u t/mailboxes/mailarc-1.txt' => ['unique_all_1','none'], 'grepmail -u t/mailboxes/mailarc-3.txt' => ['unique_all_2','none'], 'grepmail -bi imagecraft -u t/mailboxes/mailarc-1.txt' => ['unique_body','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; $skip{"grepmail -i $single_quote\$email_body =~ /imagecraft/$single_quote -u t/mailboxes/mailarc-1.txt"} = 'unimplemented'; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/date_manip.t000755 000765 000024 00000006415 12517202356 016612 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -d "before 1st Tuesday in July 1998" t/mailboxes/mailarc-1.txt' => ['date_manip','none'], 'grepmail -d "after armageddon" pattern t/mailboxes/mailarc-1.txt' => ['none','invalid_date_1'], "grepmail -d \"after armageddon\" -E $single_quote\$email =~ /pattern/$single_quote t/mailboxes/mailarc-1.txt" => ['none','invalid_date_1'], "grepmail -d \"1st Tuesday in July 1998\" . t/mailboxes/mailarc-1.txt" => ['sep_7_1998','none'], ); my %expected_errors = ( 'grepmail -d "after armageddon" pattern t/mailboxes/mailarc-1.txt' => 1, "grepmail -d \"after armageddon\" -E $single_quote\$email =~ /pattern/$single_quote t/mailboxes/mailarc-1.txt" => 1, ); plan tests => scalar (keys %tests) * 2 + 1; my %skip = SetSkip(\%tests); SKIP: { print "Checking Date::Manip::Date_TimeZone()\n"; skip("Date::Manip not installed",1) unless Module_Installed('Date::Manip'); # Date::Manip prior to 5.39 nukes the PATH. Save and restore it to avoid # problems. my $path = $ENV{PATH}; require Date::Manip; $ENV{PATH} = $path; if (eval 'Date::Manip::Date_TimeZone()') { ok(1); } else { print <[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; foreach my $test (keys %tests) { $skip{$test} = 'Date::Manip not installed' unless Module_Installed('Date::Manip'); } return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/match_compressed.t000755 000765 000024 00000005451 12517202456 020031 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail Handy t/mailboxes/mailarc-1.txt' => ['all_handy','none'], 'grepmail -e Handy t/mailboxes/mailarc-1.txt' => ['all_handy','none'], 'grepmail "From.*luikeith@egr.msu.edu" t/mailboxes/mailarc-1.txt' => ['all_luikeith','none'], 'grepmail Driving t/mailboxes/mailarc-1.txt' => ['all_driving','none'], 'grepmail Handy t/mailboxes/mailarc-1.txt.gz t/mailboxes/mailarc-2.txt' => ['two_handy','none'], "grepmail -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.gz t/mailboxes/mailarc-2.txt" => ['two_handy','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'gzip'}) { $skip{'grepmail Handy t/mailboxes/mailarc-1.txt.gz t/mailboxes/mailarc-2.txt'} = 'gzip support not enabled in Mail::Mbox::MessageParser'; $skip{"grepmail -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.gz t/mailboxes/mailarc-2.txt"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; } return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/not_match_compressed.t000755 000765 000024 00000010100 12517202516 020671 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( 'grepmail -v Handy t/mailboxes/mailarc-1.txt.gz' => ['not_handy','none'], 'grepmail -v Handy t/mailboxes/mailarc-1.txt.bz2' => ['not_handy','none'], 'grepmail -v Handy t/mailboxes/mailarc-1.txt.lz' => ['not_handy','none'], 'grepmail -v Handy t/mailboxes/mailarc-1.txt.xz' => ['not_handy','none'], "grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.gz" => ['not_handy','none'], "grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.bz2" => ['not_handy','none'], "grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.lz" => ['not_handy','none'], "grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.xz" => ['not_handy','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'gzip'}) { $skip{'grepmail -v Handy t/mailboxes/mailarc-1.txt.gz'} = 'gzip support not enabled in Mail::Mbox::MessageParser'; $skip{"grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.gz"} = 'gzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'bzip2'}) { $skip{'grepmail -v Handy t/mailboxes/mailarc-1.txt.bz2'} = 'bzip2 support not enabled in Mail::Mbox::MessageParser'; $skip{"grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.bz2"} = 'bzip2 support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'lzip'}) { $skip{'grepmail -v Handy t/mailboxes/mailarc-1.txt.lz'} = 'lzip support not enabled in Mail::Mbox::MessageParser'; $skip{"grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.lz"} = 'lzip support not enabled in Mail::Mbox::MessageParser'; } unless (defined $Mail::Mbox::MessageParser::Config{'programs'}{'xz'}) { $skip{'grepmail -v Handy t/mailboxes/mailarc-1.txt.xz'} = 'xz support not enabled in Mail::Mbox::MessageParser'; $skip{"grepmail -v -E $single_quote\$email =~ /Handy/$single_quote t/mailboxes/mailarc-1.txt.xz"} = 'xz support not enabled in Mail::Mbox::MessageParser'; } return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/match_headers.t000755 000765 000024 00000005035 12517202466 017277 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my %tests = ( "grepmail -Y $single_quote(^From:|^TO:)$single_quote Edsinger t/mailboxes/mailarc-1.txt" => ['header_edsinger','none'], "grepmail -Y $single_quote(?i)^x-mailer:$single_quote -i mozilla.4 t/mailboxes/mailarc-1.txt" => ['header_mozilla','none'], "grepmail -Y $single_quote.*$single_quote \"^From.*aarone\" t/mailboxes/mailarc-1.txt" => ['header_aarone','none'], "grepmail -Y $single_quote.*$single_quote Handy t/mailboxes/mailarc-1.txt" => ['header_handy','none'], "grepmail -Y $single_quote(^From:|^TO:)$single_quote Edsinger t/mailboxes/mailarc-1.txt" => ['header_edsinger','none'], "grepmail -Y $single_quote.*$single_quote Handy t/mailboxes/mailarc-1-dos.txt" => ['header_handy_dos','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/invalid_date.t000755 000765 000024 00000004053 12517202420 017120 0ustar00coppitstaff000000 000000 #!/usr/bin/perl use strict; use Test::More; use lib 't'; use Test::Utils; use File::Spec::Functions qw( :ALL ); my $today = ""; my ($day, $month, $year) = (localtime)[3,4,5]; $today = ($year+1900) . "/" . ($month+1) . "/$day"; my %tests = ( qq#grepmail -d "before $today" t/mailboxes/invalid_date.txt# => ['date_invalid','none'], ); my %expected_errors = ( ); plan tests => scalar (keys %tests) * 2; my %skip = SetSkip(\%tests); foreach my $test (sort keys %tests) { print "Running test:\n $test\n"; SKIP: { skip("$skip{$test}",2) if exists $skip{$test}; TestIt($test, $tests{$test}, $expected_errors{$test}); } } # --------------------------------------------------------------------------- sub TestIt { my $test = shift; my ($stdout_file,$stderr_file) = @{ shift @_ }; my $error_expected = shift; my $testname = [splitdir($0)]->[-1]; $testname =~ s#\.t##; my $perl = perl_with_inc(); $test =~ s#\bgrepmail\s#$perl blib/script/grepmail -C $TEMPDIR/cache #g; my $test_stdout = catfile($TEMPDIR,"${testname}_$stdout_file.stdout"); my $test_stderr = catfile($TEMPDIR,"${testname}_$stderr_file.stderr"); system "$test 1>$test_stdout 2>$test_stderr"; if (!$? && defined $error_expected) { ok(0,"Did not encounter an error executing the test when one was expected.\n\n"); return; } if ($? && !defined $error_expected) { ok(0, "Encountered an error executing the test when one was not expected.\n" . "See $test_stdout and $test_stderr.\n\n"); return; } my $real_stdout = catfile('t','results',$stdout_file); my $real_stderr = catfile('t','results',$stderr_file); # Compare STDERR first on the assumption that if STDOUT is different, STDERR # is too and contains something useful. Do_Diff($test_stderr,$real_stderr); Do_Diff($test_stdout,$real_stdout); } # --------------------------------------------------------------------------- sub SetSkip { my %tests = %{ shift @_ }; my %skip; return %skip; } # --------------------------------------------------------------------------- grepmail-5.3111/t/mailboxes/mailarc-1.txt.gz000644 000765 000024 00000044665 12504145755 021250 0ustar00coppitstaff000000 000000 ‹âyïBX~=@l9q5ìÈaF4ZxòAšS9t…9u#<˜Ã$,6Ceß<Øhš=Û´÷¬ƒ¿ÄþÑ~½m6.®/ªÆ3wÝ®m5­cB^CÄ„ŸpæÔ­–e-“°Hy%P*ZâæƒÝ´L»Ý2û Ó>:üˆøÈ2Ú+m³mî]¼;:´Ž‡Uxt£ ôn/î®I|×íZ–ÕnÏF*€Wáç%‚á `^—ð`wö:­–æ*½ó»êNúç½Ë»N¢Ÿ¡ðÇ2˜ª8”eŒY¶Ùh6Æ–à´Í#ÓÚã¿Ëüü„2o4¬Æ±ñl…`‹nZHð>|FßJ(ƒN©Ñ2 ÅXÖûÈÏ«æþQwÿ¬ÑCÒ§­Óns±ókã\D²£Åd­Ek¼A¹tà\ÅcO„pJXáUöׯU0¾û»ˆ\åwག B7šƒA7¸~(œݿÔ/„ëêw×ó´L«¤ÿ*¿Øö1ôáëÇŸ¡aZf³ îAû j\¸SYÿ+%¶iwª](zÃÐ%Á+Aß塸qh"¯3§l*,Ƹ¿I'êÀ ŠåV®ð ïG2 G¢¥Œd }G†([”uhÙÖªý—n·ä5~˜"SMs¯Âñ~T¿›Ïf$?G{3O¸þ18„2:‰Ãº×Í»('DUïùŽ"K8¸‘a,±ù(TŸÆkx+=OÕðCúôw$ ¤ô‘é졚J˜jàÉi1€éÞ’,NI)ˆ„wC7@xsj˜Îæõ<¸¢‰„PËÄMeb"& «%%œ•g€€iˆ×ê^Vªô`IyO_B¤+Ôeèîƒ2MÜ<7Œ2âC(áD‹ #ßa õ!BcE.B¢ ,ð“›ÀÏ®?T!íÄÕ05 ð‰AEhÐȱ ™ºö%iá»H ͘°ä½`,#BôÞ!éh Iâ™’± [@ŒF(Sd#C g } ˜t@=wë~uìE‡?ùQžuäÏBį­‰æF7 Ñ]…Áu F8ý Eo}ÎgL"¸u\Ѝ¥Á$Šf½½ÇÇÇŒ¾½ÿÒTC)Gù VÄc࢜} <áâÎ^¾ÄI†®=ϧà€qÁ0öö^,&ÅRêØ›=»Üµ7ù¶]æÜöFï¶KÝ»|LŠ¥ÌÁín—ºxù˜K™“Û½Ü.uóò1)–2G·7zº]êê‹c4Om›.'˜'Cå9®—ÔìÓ Ž"åÓôùžOˆĸÖÁÌ~绡i!öJ2e½€EëK„(+²L»8 ~1¾”¤g½Ëó,çfOÉá&ÿ¼9§hC9rq©pquwuÃü[Y[÷*•‰·]vß]ýHm¬í¼ÿcÿ®ûÛšYÛõMÿòî õkem?]^jxûYÛi¯w­Û²¶»«Ëžn;ÌÚnïº7wŸNßßáKhš¯®ÓV8Êšÿí}ÿŽé¶›9‹ÚÜ.ß_TáSþ9Õ»éwßýÜ¥‘û†­;öeºp}us'`}nŽÚǰ·ï®ïì}?lÃÙÕ…þ%¯Òæ–æÍï½Ø-íé †‚M­ô£"8´Ó,RKÄK†ì,§ìMÎÛy’³dÅ9ï)~º˜1­ËfÊ-°¶ç>“'ä>§ëw¯Ê“žÊ5Ê"Lo³ëPWØà¬þ¯opñžíé?Uæ´š7}“¬‰ ꓆3áH½­VÍ Õª '›Ã÷¢ƒ…H j(ÖÜ£JîŽÒZv™âƒÐ8Rà<fADJê“ ŽBú$ÇA)«GÙkÛNŒ·RprMŒUÿ;è/´¶M7´2akpÄ»íb@`(Ïñ-Ÿ½LlžÚÁpÕ2›#¥Û;ÑÙ±'P¤˜ôÂÜï‚]´W]K¢-vûP¢¡0etÀ3¤Ùb;¿ž;D0OuðÖ­ßI‡ÏäøÐ- ƒ2ή÷.ÌtÐfx—tÈ ÉžÒè¤ÐGº„¿‹Yµ¤CDªËÐHŒ É6x(¡©ˆ&†#<'ö¸ò!4×õ¿]/Tàk¦‘»9àä:×ó^êG×óУíðPpê‘Î ™LP3d‹‰¤t¦8v…ÏizÃnñ7ì‘D‘‚%ë³ß(‚ÔAI—oˆ óçOâW˜ö•>ær LaÇÇ/DKŽ„Ÿ@_B¬`Ò‡Ùo gÄÔ+bÞõ)¬æâùxÕã©ô‡g×BØ«“-!EPh¸:ÀlÑÇ ¨Ïhª‘D½6LKÖ›mvV³%_6Û«¶“O4…ñ¿'ÖñX×ÊÏÔA¥Ü³øSbÒ‘´¬(Æ‘SÌ„¡àwžÅ•`è"…Y3ì_Ž—u,ACYXë ¥r‚¤|`e,vXÛcnùy¶ÀŽÌ†<=…LO,³(Í"Âqâ)9µb"Œä}xïÎØ£<)¸ 0‰U’Ô†§¥U²tʸ‚ù*—Œ Ú\c8Œ”!ÎD:÷l•‹JL6ÆE9Xk¿º xkŸŒún:¶°`!ˆ'`o¢‘çu1\EÄá _Á #Š$8×Féø/üWzöØi–²Cœ4™“—»ß‚‚TÐ>†Pªô¡YˆÓÄâu”./‹0yL¦ 5"|{½UÐÉhÁ §á$f´ÆSx SiŽë”%®ä…ßNÆ9Ÿ0ULx¬FåÜÆY,³±ƒÍ6vÀt›%6ög¨OÞ-©GŒ(r”’¼E‹”ÑCa®^_Üjø3ºúYÒ\®&²º…ÜœbjA[™ºlËÖ‹´´ájf|ˤK\~ðBm·÷Ñ\ô…0^´î'D²²(¶H+=Éä±6 ¥‘,›.2š¾RÛ•Çä!Ý= ôV\A¸^z »#Sl•ÓY47´M$ò@#>ÐÉ6‰ç[7ZûúÈ­¨¼ÊVrú°&¡†ô”ØÅøÜs£â1'TÒ§åÓ/´ÐŸ‰ìÎÔ"°ùo£pTÅŽ5ÂöQ¡µx¦Û¶>æ/ÊÍ{}áHzàò«ŸÞ˜¸¢M%ù¼¬œñF’ö"MÓ,¾Ÿêƒ¯}Ë*[&bu6œ8çË:9&çXxRô¾~}þS¶L§ãÐ,¬‰KÐ¥ɹó†’8CÚ–µ~˜>ÝεZ‚áKžD0íÝ«M„s%êvúú[ `É™“ƒrSV´LPz¤ý¤(=X*IIÊÐ5ù€xm‡¢}[› ¥Oâ¯øåKL‹ç¶ëžrY×ûËÚ79jBLçÖë¡,”‚=A”|bÿgùuLþ_ûˆìŸwð×J>}þ_¢O“hãÉår=É>Á⪠6Èk)F-–(< O^hð5h µ OÀ•;À/§ ëàpÑÓÉÔUHepÅa]]–ż=ÍÓ—­Å§\XAda¬¼aôƒŒÌÁ<Ö7©îpíÇ÷·¡aušÍŽÕü¸¿Ýl´ÚÖ1!¯!âìNoFAéýíGL•šRfôWÊ?ضi·ͦeî·þø%î;$Ô²‡Û/q/3buZíN«¹éwJ9T<å¯A!å‡&®IMûc•Ä[ÆÓÈ$"ù‡æÁý¥÷!ÜÐß#û¾šÞC¦·ô½Å;܉Ñd,ßßî6N›çG¦Ý8° ¦•^ÜfTÖ*.[ãJ.nïܹ˜ENæpjˆo^-Ûêë’ûØMÓjQ÷ü:öÛëúû_ ®ìY–µwˆ«­5w²×‰(¿dÍ÷…ƒxq9Rr4œ^».\ŠTþÒ-êiìE.ÕíMÝÏrxŒËÜ˜Ž§ç';õÂc·Ïκg­V¯ÑÛIîò‘ ¯˜jyÓ)îEÿ¢úD.\Ö×ú¦WºßÊ@îMøMßM¯Ò o2WÑmS5-ö¹¾¦“Ž2C¥E}µÐ¬‡K¾›¬o½¦‹ß(¹òËWùF­¡ö#ù¨!ÀäŽ&w²ªîÐà8 ê£ÜeÍ1<¡hÈÂЙ’ä…n2K0té)‡6îõ½{¾OèJyÿúº*ÆÔNã(#4£3SÆ#×Èr­ÉDz³Qìi£ç_ }w“„q‰NHUB:*ÀB\(‘~á5ú±Aâ^ Pñ5Dr —W‰IÄ Ýße•ÐÞ-¶Aúû͆ÞK„ ù ¦v‰Ü<ÐocðÏ9ðf½†èèaVÞ:l5ú ®øRž.£î,±e›p–=}ÿæMïæÓmÿß{Tˆ¤¯À$Ûèc<ËFeèÒï'$u3ç™v3íÒ0¡7tµŽÈ^*a5µ˜%¡áB ™LJú X÷*ÂNï¼·“ަY”ÏA”žT¨%H!S²#™”‘!MŽ2Êš&º€Ãe=Ëädá )šÏÒßB(ˆ/'ïuø—ùA“ÛyoQ®¨ä¤„ޤ¾bP¯ÓD€(½CO±çA®ŠÃL'aVIÔ%¡Í4¹,.ÃÙ}¼å:Æ81ÕüDüs¤Ï#ÊÝ #nÏÎþ›½'mNIö³õ+4Þ]mdIº§Ç\Ʋ v#|1»á„ 2 ©%Ñ6Žýñ/3K|Ìö̇KŒ›¡TªÊʪʫ2³ú2{e´R(±B#U¨öY™™*k…e̪ꤩ±ÿû3sfb2 ‚®ÁB‹EÂZèØojt*€ºÒp< §—#ÂŒ®™èü¿:‘)J>a2Xè.Hqû9w?s¬Id”°tA  ƒÈ‘7’õ%|* " ø!sCº­šåáLáykxÔªê÷ÇçõNdœPzÍ‹®Ò‹7¯úývoñ×F#D9ÚZ ¼è,„—bOH÷nàA3xª°Q„~£®¶ïë-˜ ÌCxÆ:Œñ¸¥}ļLv|Z'¤fRé0hM.âo:v Çûôl/.\?2@Š3£9æi’é8”¦'kd®LðÇû7zØ \¿]oݳ4 ¾@ÌJ1Ôl‰].‚fæôW@¼@cWSdcÄæ´ÔÉH(­¥%v‚ýÆ·é\gåCp²ˆ*-Ðê°gh HöÐ`:<­ÒCÏî òŠAg;“ì( b;¤`Dm1Œ‡Ç:ñÒþwÌFÕ1‚’ÍËÈ­ºë©jtPH¾ý "BGB'÷X/Y3Çqð-°s¿Ä°íE› E‹•LGL¤‘¤FEÂbwy¸;ÿïóسãÉÓ@¾öPO‹ák³Óhë!ïí_ÓL€‘‘•}Ÿ­ Vu†$ Šh¸?O@ÞögˆèÔ,-N€ù¡m¢ç¯Iæ‘\½³&˜Ÿ ±lžÍáå¿@*_­ð?áüÂùÏÎašWŒÿµ˜Îr k毊æþÿÙœdÌDþsó1a’D?/Žøpµ` Öqv¨ƒ…ïöÀ2 ªP®H’gŽýšEp\ô;|·®ôîél„C9ž,ö!¡[w’xøá/ðb¯0âqÌLDf ;°kÛIÚŠ8E²z6´™™þÄa#gXÆxxÌ3¶@Üp,5nSÇŒnë2jŽA‹:‹‚|D®÷ÒPÇíU°Ém›"kßÃO›À5FN_i5ŒA¼F—½ÎqþB¡½GÐaéÀN½Ÿ;£Å̬ý ëf6z¶‘™u3±°$Œgë öoã~ÀÄ<ñžÎ~Ìg+ø$­½þ·L5¢²km­uÂíxOâÜÚ˵T½¾¶c4ûº]ÇÅÇQoÄ sW' “©Yù0ßCdn f¡ãWõ‰ÅF€á_;ÐÙ.>ߥ£¸¹¦€æW€O4¤°upÑoóXÒVUþ☯÷ûw0>A“e?o‚™¿ô,PŃeïáiú ž$E…´§„exŽï<¬+œ.|Ä…C˜+ ¼îñ¶QIQ/ò•J©š—Þã=€ißw¸Ÿ—îýç%{ÿ™©ÞZ¢÷Ÿ”æý§%ywŠwž»™ÀËØÜnþãôÃŒïhFóRØÄTФHäòºÁhöÔŸ3£Ò>·³C‘qcnÌ5Ûò<ÃgLÆ%“ÛcçûØs²{#6²‰ÉwaøÐQhhk¥Œ`äi†P©V¥wPÎ5xe¼?¥x¸…#ä¾#íùÍ—«å ì¼”½ž`µ4ïój“el²P&ÅuŒPw¡7a 'íó >]´ÇçRø‘eeIœ³Ì›12^$ëÃÖª6Zu¡P¯¶›•ãÕUµr‰TJ¹+j²T“BFr‹æd+»ktquò_6®Ó¯€w¶Ì#ÓØX!sGÉq„ñ¦ã¹Kñúí$”4þ3¯ls|keñý¥Éñ–&¬ c"˜öXXøË®A[¤®#yÕC¯!9‰kôo.i ðÖÍ#éX½“¤€7¥àí:È‚¥²T’ÊŲ Š±:’Å#Ûœ;Âp~¢K[±A‡r)Œe’Äÿ( "RAÌLsÒ|z¬9,ÃÓ¶ ‘`L’Æ=±¥(2ê[DÒL¼!Ÿ§U ·ªá šZàØGu Ô…-€ú•¥^E—ë_@½ŠÕbi3õb lrMÏXxËø\¶àw©* Upÿ;Z&¥Ò£e ¢—*¯I·iäç~—äª •Q(3÷Ûµ1ª]W>@:(èK4–f Fi²zXˆ/§Z%‘’‹¬;°æ ixðp%õšþÈ(ˆöü. ,£Ú—¯{Ð •©S‘ÿ$m¢¿(Ç’£q¦÷•Ôë~‘-–oxõVU–¶v$Gm·¥²X.…¨£LŸ±Ãð¦–ñR,Ö2̤ 3Ɉ-m%žm%>¦ô1½˜¿˜ÑyJTŠÿeÛžKSâŸÐ؈âkîÇûü6¢ü¦´Þ½:(—õþ r;n\\õZõþݯÏqÜ{çᾡéŒéþ°$ß‹L©É(À… ­Ê@ ›­vtŠŠ%< òB垀$h˜Ï3ˆ¸mmy´Aûvð&Åî¶J5Þ:89Síàz*·ƒÒ|öé»,Õñî” ï¶ EQ& S˜.h ã ©n©æR³¬RðT‡`ñ™”H˜ó„Ÿ|“V+ó(ŒšËè Õa|¹rÒÎѼ¼ú§Ÿòˆ/*"Ðð$u?uÆÅŒ³®j 9ò `,©Ì<Çïçïÿó¯Ð&”Ý[ «·Q9s=Ì^¨27žlÚvÌ€v@_Ð ¾ÌÔÚ°*lÁÀCá“¿ –ü9ž‚´ u|÷i¯úl¯j°Wañ²yý×ý~þ_÷Ÿx¾"WøKͰ,ƒ?ÝU”µÏå)eÿT–@5«VŠE¾T¨¤ qÌüõþ:Ž7rì}¾'¨Â°ÏË⡼ÏׯÔA¿~®Ô£޵çL{ ¥ÚûÙóñþÚm«j½Ó>ðŒŠ,‡Ž#H#tç9ñ!5Ùejô 8¨ž¢}$³“@ŒµUy©R+UkrlÂC¯—ü¥L€[4–G¥;Oš¡„ÿï :lùHzÞÊÆßÏËTàCÅ¢\þŒpá½<)ŽA·‘iššLâu´Î§U©äBeŸþ²mM~E¾˜be30ì|¿…¦ªô/„úŸ[)6|Ës€y„×@–JBI(FqQ«£!q¬r@ÿf$›ê•e±Êb[±ahŽ«²;-‹\f 4ÇR<É|.[Ú1i~϶Œ=B:ü ’œWµWoêY #NS©Ê.N8’„m LG±Z+HkÓÁ†‘ Œ}‡t kc‹nÚ¬ ”f"ô– ?!8omÍ8‹µÂ›VO U­¢uw”ík¬Æe,[ão€£yè5ò¾o!ßÁv·cwyJbZÕɺ†”÷3‰o},"îÌn‚’r`C÷_ÔøULpõQóån$vìÆAnoaœkS) ŠoÖMdʤj¶ÎëOp 3ÿ(ªUN¥ƒ5-/@d‹~ü>ðóJiÕx1úHWÈšʬॊ#à‘hÒ|xÈX(6Í(¸è¼i≘/÷º$ð=гñQê˜,ÑÉr’’ßm¬ë¢PŠRÍ}Îïñu{ œtŸl¡¾Áô»&I"ß Ýsž|rÛà¸Öà߬°æ.tô¬˜è‹årÞ#§:~„·ðcô.âÁ"Õy³…FÐ(R ½˜`Pd®åÌfûÜÝñÍÀ`5OM‘…òÂJ¾SƯ;“Ñ gƒlymn ‡Û*rr¯q_<÷:f´c 4õH›¹M™ ü¬Ý±,–0B¶$ýf±\*l85Š ØhÈžËüBx ¨müØ+"Þm¼¸ô‡N½Š¨MÊòkvw.:¤ŠÀì“Ðhb6s€Ê (Á¥ˆ¸˜eħfWóbµ ד˜gIÂÕMðÀ¥ÍøÄ!Ì—ÂÈÁÜ:|.\"™b2µHå &”f_Løz)ƒÊœj¹PýÌí¬¥ÉÀQj…Ud¥âz7Ô•Vê†×2“µñ U€/›ù×äÆèM#$j©{–fç£ôbÛ™9è @›ëývÊ9ª H[‘˜§Øù„V3Y–«RĤ34=UÅêÑ“©‹’0ž9º‰t×Á×UÆziÙ¦ÐP…‚P- ØFA”e\žx©µ$×ñúEødõõMež4æËóºÒKxוš§¬èwjêr5™„m8Šîaæ¾òyåŸHê§äéæãq ;lÁàŠw Ì)úŠ"Éwg >âÝÃxòÆ_à&'fþ¡„ò¾‹î²Ô§ ŸYܰÍÔÒ±ic¶ê¤ ƒÌ­í¥xõ.¾§N(}6E2¸–íSX-ºLƒêjÓQ« nN@Ç}sôvÎµÍø3ý…ç/»üÐísMQÒõf÷BÝœ±k$Ð)šb›DãŠÂáúîXè*€˜£y1§×)zӲϔ?Œ˜™ßf%Ô60I`•?ÆŽŒ0ê¸Åùû¼)Œbdl|xd‰az‰¯<]”ÂÎÖð/:8Å,õè¶Ž"Ä æ¹ŽÆó©Ž}ϸx,ÀuBD¬à!´t¸mƒNë•fhO8ìæ–‚¶-˜rÃ\Õüvóo< Î£ææ°Â¢É‹5ZK¹’¤CsÜF_'# eÝ› k_¸L^h^^þ1Pd.ìf‡}ò#d¯ “«·ó «ÈÍnßü¾°ÊÔ©ëAo€ï³«wa6ßLè²öQ¦ÆN€·‡<#=“yë¨"?S 8¼:—MJ6À µ%8Þøý§è™ÁÇß_iá¶QÔ><byÓ#ÿ!9L%C‹æe' NF.õçË@=K¥ÏØù>öŒÄJ¤ÌeiQKðœ‚>·V\ô.–OÝLXæÃñÐ! ž ÈDc,È{xTñ`¢„-æé§i¼Xú{Q+qÌ™¾°fú¤ôÃëÙe)öÝâÙΡªH¹w5Xâü…MÛíø9Á!Õ´03J!|Àù ýѳ·xJ½Íf9@w)\ ¶³D• »9Äb’;tšG,ƒa‚|@$K>5ÅúÅnOX·($ˆ#\˘ÎB; ¦ìòù“H`ö ÌòÅéQ<bÄR¥¢å7L¢mj›O4!4¹PwhH…ÿ”½E‹>당+¿‘Êc-ÊŸš¢6ÓjY<,2ZÝŠˆôÆóŽ;_:ãëÎÄ5– ø«;†üì剨ŸLÇúMuªÝ ÝáÍ7WéôgÃù±¤Ÿ|:UéN9}~,k7£É¨3û¡[õïçOâXiÖÿƣÖ9^*'Åm¡÷CŸôÛ<l?›u‘zˮڛ÷:Æ‹Á _†ø~ìÙÝ›îËÝôÛ3ÔÿWÆÍ¡Õ+Ë»Á©Ý_-¹a«ý4TÞZ#lhª´ú³nAyVä;qøÒ Ëz3ì¤+Ïw/=«{c¼pwÇ3¥¥OçWã~«·ýåp(]ù Ë_†/Ç\W>mwo®ð‡¥´Æó»ÇS­½¾œÎºóoÏÝÎÕ¸;8]*ÇPgp<íÊÊó àâUÜ~>+/wƒ64Ò›„eãîÜX§Óîcc¦<ú½ óNžL8Ãjø£“ëÅðºú¢Ë%ûF«JóôÁ¶N¡wö" èî¿áwk8íÚÊÀþ@P»P¨<² V„»òÝR9l}{£yÕ6ÁÝÍlqÖ¬»­[¿G`ãBy´›’ s:1æÇÁð¶?3ìîø¬#¹zçÙ5äëG€lj,§ã3«ÒÃ÷8½S] —åðv•{³ÛBßÕo®Æ—j]ê¶ÝófCÝž.6•søàîöôÇè¦4MUxî¶êOƒ–O=('°ºìÙ@掚u§«NivãɘϣΣL%X· ]–~Œn{†n)îE¸\õÛž?¼¹~:k]=uÛOTNc6NN]ÝîÏÏš§ª.Ùãm§h ž;Ò‹Þ¹žÍ1•s€ %€#­±5Ho’ÙóB±x]»m6¼­;½ §™€Vÿ:³¹Ò;J'ðGivÕzð°ì ®Üt]è9-ógtž'¦ û»Sz0dœ‘éj'ÍF•ËÌþ½«mNIÒŸ»~…¶£o¯;¶Í‰×žO6lðÛ`sq7!„µbã÷Û/3ëE lw;z#níY¼n!©²*³²2«2ŸìŸ´¼=­¯N/ôHËðˉ)€íÖû'ítÒÙ¢€Iâ<Fqu;Û ?Ÿð²ˆLŒ«ìêøáµÓÎuû¤ÝiŽcüÝülð›mÝx¢·äÿS롌êÎÖc½Úº¾è4®¶TLÖAÎõ“ßt ×Õ¬3ª(×S  ^k¤'í{ÖwQ_c_:0í@Wù÷ô¢Zƒ$JRŠpɽ6ÛãþäbÄn'ÕoÖ:³<#q,‰‰P–}õ”Y!eõ±óþëO<ÝêVAo_–'}³a¹w0 ÷qå_žôðáKù¿×%9«Ê¦ýè]b+¥™ìcoÒñzµÆøÖF 0îíŠzaDH@ cX‹`òôÛîʯÙ(êE )=þ’ÎdP)»ƒnzÕ»(õÑ1Åþ)õ¤Rñ¼á±èˆÊÏí$€Öë£Ý×›£Pˆ/”š©l+C¼9.®…¿ê0Y˜=ÉŒ@^§¬»Ñ.à§7¹ØKÁ–xF(ˆ©Ü]­ƒ&ix Yz½Ö»·§Pøh€—[ƒ•óo%—)¹V£Ø»Ö­®?Òu¡M)¥ZÂÉ¿Íûã¡ø€ÕZ>ëu[sËY¯Ö) à9ügIðþ³Íáß3ú[ügI€ü— à6e|PwŒvc®F5v]é¯Xk°ßÖ¬o‚IQE¾¦½(âƒÓò`6mÍ{¶Ãê ÕkÌ)¥Ô÷JA°_¬£$ËÛ„ô¦ €òCcµfÿ¦ìÙ‚Z¹Üä·G¼á &µm\oÍ¶Û ÜÙ®µŽ*¼ëëøu]õÃÖ:C4­À Å›c­Ò€¬ãd»§ïÏù“3ë2"ž[Bà=Í{¶‹ùOð~-yÏv1ÿIÞ‹•”Å_óÖ7FL©càyIÚ!Ío#üûþôNðýØ»ÄÁe·†G#¼gòG¼zh›© §áKÔ0{¦"ØRÃ1M‚­_Ü´AÆ[ó37³¼žݾy1²nš£ËZñq@+iœ ,*«çëRÜ>IRÂlS^c/Û`Í&gØNÖ<–v²f“3;ÍÇk®¢¬Ùä ûÞ¯³—°&Ú:rƒIvXÝ .FïòxÔ®F·—åÀê®F½Zuyk\·¦-(Æ[Úb…+¯ ûkgwbdoNöÈË"Ú+Kš† U3Ú”íÁÚ\MØî·ïÐe›Ò‡fEÛ(@?Šk°j×½Êñ†Ifv‘%ôÑ}j ÙC©àj•¼Õ½õ­›ÆؤߢM .oýüê£ãGTS4Á¤dhS^vê :߬nÇ“"BúæJõ1ŽÝM;ìI{3jn°§Ø³O˰}öæ.y–â|ÑÍ.A¶=X4êà*nþ­Q\€'ç `ðœKÜ(¦ÑŸ@ÙïÕ¼)øÕ:ÌÀP =ÏŒÚVUq–`>$-·›ëóæd·£Kn\{îÁ}È^2—#ÝS r{݇G0^g=w<³½âÝíM{ -£S6úãJ5¯š:þ}¶žYµÎ7f­Ëk”ªnkF¼v#Rµ¹%Ùœ¸¼¬oÚ3¾ÝQ)ßõÎc߀ Õ‚Û¶ŠX„¯£—NK¶gPžT ì9,Ijý{Y5’;4Â0…ÿ¿Ñ[ÏÞV!h+Ëó,Ûùº;þ|š×AꞟŠb° …-y ‚53_ôŸr¬ç óWé’ÅárvÆMí ÿãŽk¼RDÞ„O.õ#( íR ©zF<ÚvGò_ ƒÍ÷¤…‡Â%‡Âc¢yW‡)ÚkgÌWÇÕL?]!‰ÜÌŽ°çÝË›ÖüNëò¾hÿL»ÃgžþÔB¼<™T>‘|†là¹DÞȧs™¢™M¥³E©µ‹‹Öâ0ì]]eFRGñè'‡ˆfàÚÌ÷ü9¢Ó.½Åcn]›Š»»ÓãI/täG/ø«©(8 i†t À`s—ÃÊ0ª±0XÚ"‡ià"ò !=FÁR=~l“³™]‘è2êè³æÏ™µðà<£ÅƒÔ;qzèŸe¥qøM4i‡ >t9›ù‚¬PÅ$ t¬ÉkV›ÙáB“§dW•V…iJü|M:ÇhñŽט¬ €h Ö:ÐÞS)aßÅ£FÂÙÕO¼@¾ïÕ0}§æü‘[s*(S~Ò;ˆÒ)ã€Ïˆ“M`Wüh™[qi[€(¤Ø•uÇO˨ö°H¸5%ˆ

EuLµKw2ó\ÊF¼$€'ô*Rã\RB²µH×Uw E‰¢‹ñR‘:±Ö}Jk¼Pr1”§ìiÆ]ÈÞ5 u˜õ#9@®¥æŒR•BLè™PöA`J"ÖUŸ r¥‚¨WhW$£pá½&Â8¨çÆ51¨‰ª%~à ,TjC€,AT É£¦„ÄÓV)‚,"„>/miï1e佯QW˜H&]ÏÄðS ’Ç•„AoN€ Š©W@¿¼MôçwœH0 )Æ‹Õ,ˆ£†ôqrhˆHÿ:3\¹£PSbór8„y Æ ¥¹c»K;]kCÇô-˜Su5ÇaäE* ×A4”è2)Æ¢Fc"ßVƒÑ {ÄüÊWþ0ÆRš) Øæ~Ô8`]¡ dŒe0 ÒÑ~ù߉x8’tÌØû.^ÁI—­dl˜5DÈÀ çyx~¾Xb!‚5-ÇÐ+çëwãwî¦ÑË/a¾¬Oà!Á„Ò¢ç„ ë¢RX!¶°7<€lΗÿþÙ¤kîi—¼Y‚´É}Ýì,wJË‘¦™ZÚ#ýçd¬€W(“Õ¤ö¹*)Øé)lÿqëJÌKÈþ€—p†Y+fáÐ<[}HIç¾d÷”‹8 “/a»³œ`ú½á#œQ^HÁü•½K F#±þoÚcü'Ê·ý-o˜ºÝàLûðûë2°0ãIÀZMÖ4LÚ%†MR©ñÜ3[ÿŒt*“É•¿:îÆEP…{—Z,&KÐJ@DjàìJÿ8kݨP§¸VzÖ€—Áf Ê©Øîß¹dž „Ž´B,5áÆ£Ô'iLq“°à;ü8òir(Ó`9c³%_#-Pž3ËvAÓˆ,(XÓ¸:à&ªÔk#wˆ&=*—¹¨lÆêÜÌâ¸ó<ˆRÄjé;•BåzëI…Þ™-þ퇴ÖÕ ô¡…éŠZÏ™û¾Aä3úÉß­eL©¿+Êùˡͩ<²ÀTÐ-•)!¨heö’÷„½H¨Œ,¼(j¾ÓjÞ‡n“ÿÒT¡64g.Ï[¥vªvò¤Lf""ñU3´ßBv)o©Ë-f>ºç œ09„îQÔÆNò)xD0OD0²Ò @Ÿ£‰HÖ»”wÁnPC…9¢h¡ÞÀ=`Ù8¡7CLP‘‘Óó ®‹Á ã·Ê¥žò9O(ê?òÞý úˆW¯ÉðZ@,tf7¿6>ýÊÓ}D(fyóQó9¦s’5Â2æI>È'2—€SÊSBì/¬Å.É.£(xDyñ—d· M8\râÜ"¿‰¤yºá\ÑÜRBŸp›; xeJWÄ šßÍ‘S•saÎøl µbÀK$l š¦Õ°¢¬‡Î-ePðùëå;ŒÞÄåùßÌè•é–¡‰óY+yCíTÙ&‘$Ë÷oð›¼v*Röˆ*­šV_0‰±Ë—mÌ! Ô2pOè ž€)Sä´™óÓúiZ_5"Lp– "”AÁ÷b E œ ”V àMr˪N0v} çÉš¿S¥”`ËÂKæ/ÙlõÑaØO³çÍórè—->£ÿO™%õ€H§‘ç{ܬCà-#𖃔Jbi¨¡=×í;±/ÂKEt\7 :¨SxÍ=˜u)íÈ!ó¸/‚Ó^3aêÇï8ÌøAÆñòŽ’F…_Ÿ <ÿžxnhióKZÿ9ÐÓz>k(èi#bWKvº3-Ávæßàwʶ•™?÷ýÅ×ÝßQZ\óÇõ”‘Õ¿ß»iÍÙ¼!bN’½›í>”ºß½!HßhŸ6/„nZ.eÊ~$ŒÇ6ÌM´†žË¾¯†Îóû»XÿÖܧõ¸#6Û³b²Û™ÎIXí­qH†ì!Ž€Wüý‰góÇASSz*« < ˜‰—63Ù”®ç‹¹bN'^Oaù¤ÍÁO@º‹ëÒYå¼ÙT)¼ÇˬÚí„It:¢DûhŸbH­[½Q èñ% Æn5®" 7:ŠéVùÇ?´ïBÕŽÀÒ$qW‹3Y…ç9"mWÅœRÐ$N)æ¬{ ZB'ëÍ#¾o5ˆviòùªObÆmV"†›¥ê„IÜ9ÏRF,÷ÙDF¿0Œ£˜©„ Ã+~Ç­â{aî«á:Ò=¢îy|yb–D²ØDîuaVÑŽ·%_…O(Pô€uÜ –b¿AtwìÍòýò©´ÈÂ$æÖœR.qýÁýÒ ³w&E›!2 ‡ËQöŽÚÇ„»’Ï´ÏÞí1ÌVû 3'4Ì¢ÖÅϳÆÜˆ5öîÝ»íÝÅ„—`™:Nh3ûZŽÝ’´ÓyChHh :…“ð¯¯X%F!S|&N¬ú—ÌS‹œ›% Š{J@ „ìÔ tª3³¿²w[Tëy¤Z„í;ÓõBQO÷Ž]´>äsÃL®8Ð?äÌaº³_y—~¨ØÃ)0hÚÙÒ…»¼%è ¸ðÕÍS“`É— ܤ|IUÜ®p¤z¼X]ˆM¾å9¼1B¤½`¹aïÔzã¾(ãðtЭ‰…(¶KOœ/tæ{ü0£âr™TÞHi=—Êàý@»ïáFíÜÇel •ב‡ñëó³cÄ Ÿb·NðY¹q]Q’w࿬„¥`{.2‘êE/%Ø\OÔ¡)£Ú˜:aöqBˆT°ªšëË>%+؜ˊRêðGÈPD2’c_PË>IQÒ0u‚¢«@,*hꟹhä°¦K©JÕ†Dz„» ²ÃÍOÜNE&ÀÙ’ -zú³ÚGœùAà‚)ú;¾ƒº <¡½C/*ÙÏ(Í:ÉLð¢8 ÿzíÝD@윩?Ë,n×f _Œ¤‚ »µwöîN'hït*“~åÝ@'ª`¤¥òŽ­‰è=H•ºžÉ ò¶s†õÁ)8¶]°õy}¨¿–òŽYïwØ÷ߣ¸“\dŸ$ B˜þwÕàX\›ªÀ¨˜^.„8NÇ | BF[\rÛ–{Ñ~;•ŸaT~Fî´rLJ îY<~‹×>5y¨<;T”Ðè\$Üg-çKŽ>öáÊÈý] —ýöËÄ lúõç·SßÏ|zAx™ÜçŽîñÚ·-ÜÈOb%(~1â+ÁnÅAø›‡Ú+9œ‡¯åq¾†Ëyøš>çáËÎè€GœÏÃWô>“ÝOÑzð7c>ÚXäÁg-ìH,I,²©ð).®îwŽ@¸°êŸÕàÍó;¨JUù¤¼ø§nÝ¡ôõœa™”lóë 7«"óÔY0¤#ÙÇSP¿½×âÿý ?hc~ø¿¿ß¯„ªî 4¥«• óŒÞBû'V£p'_]‹Ðº‰CŸŸ™‡s¹pf3hgÕbW‚}-}P|„¶Lk¸Ç¸Ä”– ,Orï ^¢^èó“ÞÍg´AŽ +£“S–Ïàß ÃppPS` “ .–vÀ7¶]/`¨Ûð(Ú\Stì8’ îã´à’Žù|Í‚•5›‰CiмD ª|ô=ùN4¡™kîÞ}ï`¤÷UH›LeàÛÖ\â›Ï0 ™r<…æýÍÐ%§ `Æ l¸E²e80иœŠ§ÁO\ Dª ô6z˜bƒ¢ es0µ¼ûE<¾;+i}+ßmGº‰$‹rueknÀh4ÕÑ3îâ.ú4–ZK~X¼'Àú) $Ïâ§?äŒÞ:¥•ù«™¸„Y¨þÜÅsþ× Œ\Óp ÁÄGjúwøWta/”CT*ÖZ°–“ ñ¤XŒožÓÄEd~yL5&:'ÎbìË|Y;Æs§w‚+ÿhfÈ<K}ŠaêÀJ¡ãc/|1\ó£û0XnY €²árjsô|Ð"”CE«:~‡Í­» èaFDÛb"!<È‘ÌâlHáfµîJ ,Ù ?¤Õß,-¤mj£‰BéLT>ˆc±«{Pã7ÀÙ‰üÓæMbs< Ýò&˜I¨(lƒ‰Hy¾IƒR‚l›Ç{X¡ÀÏŸ/ýa¿•ª¯ö¿W{+ãJˆç÷¸ÄÅwEþK­“®ã8XFûoPlö­VŸ‚û°X.ÖrVZË­ÿߌÉÁËX ¬:sÃé Æ}Ä=>Ú§Šk;7\¸Ùø’õ Ô:%ÁùÅUµ8 îu‚øË·lÜ)KþJRË7x¤ï[AÓ:9‡›ë%ù@£ÑÖÇ×x_ó[°Õø^ÊSuR ÝÎ#¡»ìÑŽRtüPm{Øå ¤)Îp¨Éö°Ï¹;´kEĨDlY»Rþ Æ,Xßlc‹”¯Û“b€cÔ?éx±Ök^ošÜg?b’ª[ÓûÖ¯u†ðYö̶ãÒ:Ú—ªüÛîÄ!y寮âÿÉTÙ&PR-ê$_@¿¹ªNý¼²ÒÏ/Wé&|XóDÏoŽYƒçWõ yugœÕW­ÊjÝ<*ŘXé€Õ«­æUÚäýõjß ïäv¿ëýš÷Øë¶îBÚµjÚ6€ýˆ¾(Z©÷Ê×iÎr¬-™¯µÎuöh{®ú-V™öî­.¼Ðèè½IõqP‹—ÝÎàÅÈ©Få«]tZ$¬íoðâ©N/µ{7íÇ~­h²ÓÚÃ}b®×wpRpרtd×ËW8&à ޲jÇô¤ŒèŽÃ¾ÙÑOOèúŒEZç"b—ƒ“Æ}¿Zt›¶GSçH4ÒÅ íußxÞN=½wYšCƒߘ-X µª òÕ'hõjqA‚ìW}¡.;뛫½/[[ÝÁÿµvmˉã@ô]ÿ2U\25ñ#W<™@llã7ÀY ±Xn_¿­nÉH`;lÕ>P)I¶NŸ>§•‡V ó. Aþ1l¾£*MjÑŠ{lë6ÛlNc±ÝÎ8û·‘»<~tÛü·m.Î"qÛÃ8³ Lt¾uV¸ýÈæ¢;"¶/w /@ÕÀвi4½Ñ â‘d\&׬’Y8äSÑV³ñ„½•t3Ðá‰ʱy=,ì©{;•Nt[é]òw ²KJoš³+ȃåð³¶tì??§á3ßĵY§µÈdØÊè_D›ÿ#ZCëd•~€ B}ä…䜤4üÅa£u+Õ#†=Y{ÑhÂãö$y÷œ1Q>Ë2±dŸ“âvÕ|`b®¬Ø tMU`j¨dƒU`7ÓàÀ®ƒ<Ënïéư(ˆ§‰jîÞÆ6ùØç5',‰ÀÌ#]»’w€¤$üÅí£j@ቭtæÕŽoäy4Yµ½^„Æ ß·Ž'Øþ‡ÄÕ „$ì{k°) ¦•Ž“~×­ËHæcÈ| ñ/a  †›ô€¼•-ù@þ‡iðœªD[jÜšÛ¾¦K5‡c'ÖkwŸºõÁxr²™ß÷]ïsŸ9ç]&ªüËE¯üMÍÝ0­XËßìN–±»:> oH;©Fþ9ÿýj~¦îò’SlǤˆRP,V`Áo¬OÜáÐMŽxsSsÈ#%Á²µõÀ†´²{B÷²‰¸£"Jn¯=:0ƒ ^¯é´è„'XhÐix⨰¢í>@Zy¶ÃYÔ­CŽSv3 `RS2ð%OÍàd Sª@鴬гk}ñæµGÿ *l®4NÌgåùˆ"’\ª,Rà–¬Püö]¿ç»‚¯Ì ì˜Û2sP/éÍí+bÒm¯>,XJ`ù@Õ)R’é9IÊÚ?hŒ·Ê :n¬xSÝ‹JwQ£¸ý$ú»Ü e÷÷*LY¨¨wP‰'i{„Œq‘[¬ÄX›3Ûçóη¼3 a:éÔé®*™«ä•$r^ÀÝê|$ì¿`’C¢Çb±¬á˜( ~CxÅ—ù—¿'’¾îÒ/ÁáW®,ž×W¼<Ý´v0ç(è¡·±§yãÍ‚'K[øðêáaKbˆ… Œõ9žE¯ów k~;>Oƒ±%ËøL.(ç—aqAý¯ÅK¼‹ÛDëeNT<£wV¸]6‚§âtOkp÷lþ¹'Ð%Y)²W#y_E*ÝíÏD A¹ÉÍŠÿ¬å¤RóåxN…í×#¯N¥»¹wí#·OoS;©3ª¬ HúlnOR†ÕŸˆ\0y–Xýý&¢·”¹ä7•¤t‹W¾Û*[P5ó¿l»mé6G‹n]Ãɽ”3½£8^u‹AX_Zϯ²›¿Ìï Ïw>·û?Gýt.=¬ VâT0žpSãv¿ÝvŽg§—b` pl‹™£T¿iUPƒùÈ3öÍ?ü`ÿÞaýgrepmail-5.3111/t/mailboxes/mailarc-3.txt000644 000765 000024 00000200463 12504145755 020621 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 WETDST Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 MEST Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com From someone2@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com2> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available 2 Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/mailboxes/non-mailbox.txt.gz000755 000765 000024 00000040773 12504145755 021724 0ustar00coppitstaff000000 000000 ‹'¤=non-mailbox.txt´[ñ[ÚHóÿÝ¿bD{$P{wï÷=<«VÑòœ‚/P¯wµå dœ!›f©'ÞßþÎÌnB@´ôû¼µO•lvgg>;3;3»l¬o'*ÚîyÁv("Ê“µ5qëøP_D_B¹ ›;°y¿û²°yXx(®þxØÙƒ d Q^0„$pEJލ‘ðýµµ F";~Þ¼ªµÚõfö¡øSåß;Å=zfÞƒNÔ ҌƎ_‚áß^XtK›¿2‚~|Ut†ôä`›CïVH,ÃÄw"_ÂH(åÉœÀÅæ8‰ñH*‚ÆÒƒ#™¸?Â>'"º«@=ÇWi©$ e+½P¸Ð—c¦‰iJÕ÷<ð‚0‰Kœ—–õÆŒQtÝ )Ѩ˜îï‘Ç" •8qn=Že"–KO‡}~ª ¢¥íYÓ¶ //Q49@j®@)†%IÊBЗZ¤ \FEŒàñÛ£ÆY­­eÐZJ*ä Ö†ìœ}é"Š \l¼^ãÂh["Jgwp&¡…^&=ßëùת²uvynW -ˆ¦`2™Tdˆ¯Y[Xaè—}=¤2ŠÇ>³ÿtwf¬!Q'ªø-B[Lbm4åQ Ê=ü&YÖ«^¾…‘s+´íŽŠï` GÚ#ë}Z± ’{‹ [$#"ƒú7’m‡„¥ÉÄGµì÷“ˆa("‡‰WF |gH¼!¹ð¦oK€*yRZ¿Â€ 6jtP=éÞá ¡,±ýic%}×S…õg(<7–VÛ•A1FÛC9DS¶ÖŸgke’š‡™¬ë+ȺYšÀõUˆÒ¨gˆwG˜>)>“ȤÍCÖ¬g²õB­ml™ÕY.³î¾ ¬PO. M‘нþŒØ9º3y¿B7•\/üÓk´·†ƒ¿™B=±L«q;£›ãWãû]3ì9ÊåF‰3Ø×ZðÓ¶!ûu=_—”“o§¾Ì>¡/«éÉWœêRÐW]ÉG´ —zàz}JŠ0üŒ|ã¡)År=½çp¨“­T#}Þ‹GcLV¾‰Ï‰‡þ\ÙÙùñ—a†œ`˜ë`nñybÁ b.²‰™ÆÔlb\ŒùŽ{ŽÙ&déõ‹1¦©˜u=Wu1 À6tÎDŒªÕvìšÊ7úñ>ÅLå-Ró…~>v¢Rôòÿögm-tú7”â^`ªX­žJåG¦|9i1{3j_(yä¦@fÜ®ÖÛG°O¤àä.pÎ%+èÞÚaíýe³ÕÑ]fÏÝæoº “R%â.çfÎÙåš@†S6Ïø6ÏëŽÚÙã§Óúy­‹©ÝÉ95R’6Ð/Ú#žÐô«5Nf­ÚÑI÷Í»ÓÓZ‹ŠEMùÅ[l®µº—GN­Õhã+k­ø©Ó¬aÿõ@ÑúdYÍÈÃŒÓñËöÕB®ƒ˜>uäô¸?}ÓïÛSë}¹p¶.¦G!æåØÅ¿³Êº³}`—;Ò®ÚÅÒ>m5/º'Gµ‹f#?É…ÎÙËç˜V§—‘è W}Q­lY%ÁÍ´—ø7SÊYíiGVá"ñc/dìú^èq‘Ó²©eåX<äxÚ”ÆÚÓej·«Ó×ôlëç×·>|²*/òß;å_>âàK©bkìXøGDöÁ4°§r0À$%Æ)\û€¸¶½s1–ÁtlÝÁÔùKF®K{$I?œž×Û«]k]MÃH"`Z‡Ÿ¤5Á¤z*{YÂúœOU(1Kƹ$ÊÚ³¸Š2í©ëŠÇ¡=ý‘œŽ½(’ÑTáä·r¤¦$#vÀ|ƒÝ©XŒíé‘厽À¢´Þ‰ùÅÅÅYkšÄÒ ÔÙÊoWÖ«Fôå®ù´e|xqøú:†>ýjܲ®­ÊÖµ]Áø/·žG¨“­9¥ùÖex~xV]Z¼ !«!ÕˆZ=ÂÒ>Py°|¼U [†Ø&‹8ÝdäÈÐUÒ˹µ{ÄŽl•º#vƒhjä ÈÀ¢åçûíÑkã&vù!ç ç `™+xø.v·]Eãâ“/åC{Meæ’Žß¾küÖm×ÿ$Î_íàO†Kê— xGŽŽkšô zÉ`@É@5† îa^ =€ÙÒ|GÅܱ‚ƒuñvÐYú¸1AJ(#Llù´“ík45ì)”„"·lÀ9ŠÂRÑ\*v¢˜¼=T=Ô|œ7›¿uO›­n£ö¾ÓÕζŠí“¹}k~)þñö'2…kÅåm‹Ólí/„ÀS¹5<á_×¹S¦ƒuð>|ª~| 6dct({c‘õªBõÚ½víûÝÒ«‡%áo‰¢[µvÇÆìB&‘Ö=°^îü¼³csõ¥Œ2ßaT‘#z­^òßGå??Þ¿*ýøSøð²üñàÚ½ÿ院Ô3Ú›Û_ÆC?ßó³ÑÌPª94l(ƒ/‚a<²6wéágžø=á JaAk­wMÀ¤ 2ð"eL9Z« “à2š-)QþMˆ•”ª€Þ M¨€Š[-•HC³ÚÞÜ1Üêû‰+\CæBÇ>… ?“J¡ŸêÊA—öt¤¼O%hü<'p‰Y)£”È ì½«ÈÉ"… üÛ×Û-À<7)0M÷ï´Åæ×Á‡O×ÁÇ­ë`ksÛË@8e1ç5y}& cú”l(Fý`äЮé%F)… Ž÷ímÓƒ;µvKf¦’6Gîó -ïÄsiýр݇|Dx˜¥®Ànà{7#à ‰CÞHjïAEb&7–‘HM×èT ÍjOM)M= ŽfõŠÐÓA™bm¤:5Å[ ð}šˆ’€€jÒ•Çžw†µL=ëI]wΩóŒmö<©Ê:šgÔ•yæJøaÁ’P×Ç .Ìtw¨±È<ØË;Ù>Êëx|z•óvõ4R:ô„ï‰[¦ÉäZ§Ç ÐK¥6D+©ø¨ÇgKcZŸ_vèà†ŠótxáË`X1~XguÑ3x\tßÏ‚ŸøEcó¸ÿ›Îbû¯zÇiGÛwJË+ú=ã^’&oÝèC˜$Џ¿ÆçŽÖãÝ ç›¹5_öÑÞ6·gzzbiÑ&•ßÉm~so,:odóÛ“~ÏÔ–¾yÖxÈ|è·ð•˜›oA'Ísö:%ýØ;ï?Â5í;”h%Ëö½ôß0rŸÁBø[ùÙK°à]/-Õ{Îÿ1çKü® ö@¡EC”•vG˜u›ƒîªm¦Ñbæ’³81§|…ë€sœÂžéÝ'K:7ªÈcŠÔŠÉÆ84Ãt44så†VÞ•SÃQe?ö0K¸ñUÀ‡îu:“£Mi€ù ¦ÁãÖñ::%n/[õF‡ÀÈòØ“&ή[vMÖû[ýÒ´¼Ò-ÇÍF§ÞxG庥1õ“nySÃE®qËϺåèS`Ýç_º¥Ù0›ì>ü_Jç䨣Gý;¥Óù½VkPË/ߥR±Í$“Xé£_0•¥}9äò ŸFVpÿÇ=%z“c,wÑÛë£]Ú‘VÑ 1‚ˆ¡ÐóÑuP࢚øâÅEvttbMê¦{±Še”Ò-‰ê?÷Å“âC1–>ý/K‡]~‰ñŸfaµ¥B}+iK)7óšš·vm®…“Ú›wgU=YÍb€”£ï–·\2¸½a>œ!¦¨ãA21btÃÀd*Tÿ9 ܶff9ef˜óò¥—*ªY犓ÈGùN=ŸÊUÊ¢ý)RÍØœ¨¨`#Àq§u^>¦°wÆáˆ®šðmlAJbÆw¹&¸ñ|_¸é¥ ª0™Yº¨hÝŒô>'7ÅËúejP|ÉœíÉ`nŒ¯Þ¾»ÔoÞ:Á0 u#:݈;w_àDºù?ïê¦ý? j2·µkgWº­-†Ù} ¸õ¤ÏŸt/´ø Ý«#¢1ï3M›=Ôï¢èû”hP¹­(¼K#$™ÔZ8Ð9x¤ï! õ©×XˆÑ`D–Gq`Eßµ ?4ðÎ_[Ò×^è‚FTŒžô]ÜìΰøÇ¤ÆzV]'2…3¼ ×í~Øù¨]±~o^>”_[‡]›Ã¢ÅW{Ú´rªlm.[»l€­õN](aÞqÑRH(ûct9Á\uÂW„rA*¸Š×\=rù4HëýÔñŠm$÷ã«¢Y}×U—·-:' €´.cJñ¹ëò ×ÇÐèR !¢âË*wbDçË¡]wJ_©'Šœ;PtU…ÒK"ZÂØÖQÄä¬]±BhEÂJßú¡öÐ\‰¼þan™°ADª„ÿo†Åè*—ZGeMoŇ´<Üsi·ØÇ³æ±á <=†ÀûÊ\ÕpÙjžµŽ.àk½7Ø_¶šÇµvŽZgï.jN›T×⢉Aé0¢ˆ€ô¼ëDC¾=¥(;q·’5*ë_¡JéãT÷l¸‰Ðáêuæã„Ì“¸NìP±<éÇfëcŸTY{|NGvÛÑY ˜³ ÎLXcÑ7P²¯íÚ;"èŠôâå>ëD®¾vg S “X~N$Ý)H%Ô´ÂÀG(m¢‡øŽdcYÉÏÓ÷h°©7»ÅiÞSÝ 8+ŠKô”–9$MCm³Oa 8ZrÆÙqÏŠ36$¥‹_•ôe$qáÕ j”µ‰XS*+(—)ò+¥U4½“h^Œ_Îæ¥ŽyÒ;´™ýbû“¦„¹úCn*R‰[R™®Ô@˜ƒæp |†ôà|ˆ …íŒAAü o¡ .\Á{øì”ïÅFŠÜLñm:n{‹ˆ«›c‡÷2ÖáÍî§ìÄßK†ÚQ K°4>A9¥1s#ä(ôÃ?˜*ZÖå=· Ø,ªµ€Ó_ž0åvY¾r`„«ÞÿQ(]³X¶CwùøÈ„“®@µÉRëPbÜ×ó0g½Ó÷Ž3#R¡èëëëi¹SW•2WN4ôueÌÐ…ÎÐõ”šÅGŠâB%éKŠd Tô·‚2(Qþ¾I+Œ!="|—–b³YóÓéb6ßLg@‘ŒªF)S'-Èǧ)7§ªž"cîê‘æv½Ìçïô,Z2€óeÄyTûásEnzH«[kKÆáæöa¾éc!;™@æéb·ârÆœ¸ôIú¸¡ãH¶°`öM‚#m`ŒšÞº8M«d%HØÜ`ñv(¦Ñ¸ï~¤ šÜ<_h{ Ì6h}j–Ey\[4:誜ΪŠ,œ>7àPÕ1ÛùNP9­ ä rI!¡È CLc’á‘i†eæj¥"iŸ´ÊÉ€Xð8>€é4·Såž’"õýðCv65CôW*ÆO§³7ð4ÚëÏ¡Í?ÙÇù`3cÉ鉣¿VŽi\2Nñš É¡ë_ÔmËTÿAÙij˜Õ*òú6æ™Ñ]Lߨ˜‘‹i±8l'ÁÊ3¦RÆï3YrZS¬Sm™Î6‰Õ‰§˜ûx1\ä/»È[ÊT͈¬<ýÄ$KTóá±¢kòø«.¤fìt)ýn©~fZì1³ñTž÷¼š­/Q2n=§e¹ÇD»¯Õ,ï!-æ¢ä9ÿg¶ù?d’wé¹àÎU%_,Üêg+žqoúš#ÏW³y÷f§K‚ï«[Q($Ý㚌p󕳪(”Gº<ÐÑfJ+.êêY%/w=Ð;~§=¡åÖmñ&ÈJîÍlE6S±eéTþ”KÇ1Í“)uªV/H‰½â¼R›„5ß#g§N¡4Åy5¦å “_WòW$ys+P„ÔqéŸFÑ´ÃpÅìøò¨QÉt 2 ËH:âxlW—¹åƒ—Is94Cw›7œfš#NCî|¸¡Ã·Å€C‹›Æ3:Þþd:on/F›öŒ©K® †Âuá몓 žßéí¼ië»íuEaiQ'+ÏW„f§†Ñåç7i6z¥ÝL5»Ã[˜{}œ¯”ÑÆi±š¡2çNïIÉ„ê;¡píj!_8™¯WiÒsæ’SËjÕpðßöžý­ëÊŸwþбL—Öè¦M‚ Äì Ò$5ßH`jICf$lyÿö=Ïû˜¶Cšnw¿n,¤û<÷ÜsÏûØ7"¾mJ£^}_k-Ò¾""—Äks±-…ýàu«Ã¶êµ^JK/³Í´g5n½²~'’o¥»¥MöÐS»ì/á·* pLÁÙ¶QÍ->Rtõ1 ]Ü€Œò)Êwз¤Í0h[z½] ö—ôÑL Æäû´LܸvêÒ‹êY-ÂÆ‰ó2ÁÕVRÃY½æHª¾|0#ÛWÄBR¼3†‹¢æ¤…>…y2˜ñ«§•…ñ`Í&ô²O”Kâü¦”5† 0ÖÂZÈ`šå)©Œ’ã»$üÇŒÜéâ¿E6ìmâÐZë©äxEá’L÷QçÉÓúTåÈZ…¹}Å TWµLå±ü+‡l34.‘ðYq)#·èçÒ KÏ#xõj:êÅ8bÈÃèIJ&õ¡B=jÄTô´/Ž¯æÆ“éõvÓÉÛÜÒrݵœeû¨ú$Ûa:aÃïx’˲« ÿà,Q!Ô,H‹s5BU«áƒ ˆ)GŸmd¨ÂoÐŒš©¢‚rßvŠ^}TEÀ¿¢›^„ˆü‹{tJ'ºxägïù`o÷Z9åb‚Ò¿á&(LÿæJ–U~¤ìm.ëJýËê^Î] (·ÚWT¾–”-ä¬ÊØu_~¼üîÏ«_x_tñ„ÁØ—F°ª“]rˆEKåh„ÑF# ÐS"Y̬»¨ãiûgÊŒ 90A…v/Ñ ¹¾Cîè_÷1Fce…<š¯¼kØ —©Ã²«EgªòÓò{Å'\—¯@¢í> Ù§kŸ]8϶íš"^‡ŽÙN¼)´_ª»=ú4ºaHÒˆFw¤%ÿîPà€¯›Zf(vuc¿…‹ ŽÓNtñóüïóþÏëóéÏÍ¥n‰ûG>w!èR–*13AÎGx?8ºt¨†ÑZ´705ƒñ–µ°3%¶åeôPMVøA‹±ÿU¥_JÙ~†±\Š<+(@Pþ\¥á`õT8JɪKwÐ{9a¤c”õžNÜÊá×ÛìÈch/íÝ|Ýjlü'j <\âQZ’n„àr(;eê“ëîd65 Ä ™'|£ÔËvjz›9î<íA©=*2Í5gï^Ts<ªà“¿ÿ4ÀY 8r¸©J J\Ü%è¢UnX-.f“A nþo‰„ÃÁï5ú÷@  ¾wá%{º7Zpj¨G¬`8ýîÐÂ{zͳ]Ï“ðp˜l6MPrä. 8ªP _&§ž·•V‰ooÜëÙ«ð2 ÞíxN,â»äß^{"ƒQV$ÑÝõ}·ZJî·½÷‹¶éºíŠn¯Îí–½VÙ4“j¶­ã{{ÀU–%,4®Aï.„˜>øïc⑟¬)ßWõÔº  ±˜ÏõÂGë€üƒ„<0)þío¿ ë—ãÍ CŸ“gÇ<º =¢et‘Âf]ü°ï~€5u—›Ö´|O/IΗE5Üá»K¿œ½WI{èBý^(†$¥/ËÎàÂÒ?°|çùµ¼õ¹ ßCLÃ*bÔl’bÞ5Ê_‡q•(²OiËŠ– ;¢Îh+ÆÄ ’3…n 8ü1úñS=«hi ÄïÅ%<1­¥´Ø!oløðœÄãÇq—€S%çËíe æQMð°n‚Ðp|t—;J ´•> 9Ç½ÑØP{uB n’+üÉß—k™Öå“ü†D\[e‡UœÉ:”D\äÛ–+ªÔ;Vñü#VA{¯]†òåeÔÚLn›‚%³úI.Ê{U±ˆs:@-+¶½»‰ÕãìÞNAå±K‡týjûÊ:_VöAI‡µXÄó0…ÄõÝê’Þ"¯2áÍ ×¶ â׳ Ì¥šŽ†J]šhÔ3§ui¡âã§¡º0AôVÕ‘¡œp˜…”p}à¶è“Ç7yœL/³!*Ø;ºº€dªfŸ2ŒrÎ)%0ÄŸ5&#ÆL"™ùË„’ÆâkÀCãZ³·ˆ#ê4ñ8|ƒáþؽf)Ò¹Ä yÀõÙÈóôa®ZϺ’Y’¥µïpéP½3%<Ø=:<89;Ü=Ã(抦ëŽðf}ž` ÷`Þ³ ó"9\{ (†q*ŠG–ìðÞá1| äš‚GmC$¬ogÜ¥"åÕ1ιWþðsÁNÐ q£¹Œ‹.û£{˜ ¹¯0ª²Ë%Ä—<2Ù?ª) †-4D)Õ;mØ~C¾[”ù+;7£øwAÿGªñowGD ó!mtÑæ%? æ¯u𥰈HþȰN°~•­Æ±Ï1¶¬Dx¿}}Ú®jü}àû ª‹+:Œ’8º jÂîÿIhpÿ#8¿ØÓ“*¨2Ûr Øb31g7»S䜇[dö]åÓ–q*Gù† äDé±c1µ¬9òt†±š’<8ÇG…ª·äMâ>_Ü! p«¦§ƒÙ6APë¡`öP!Üh¯&)ØNL}b€)áºâTå.ÿVpI”­Éác€H:έç&«Ä3ÍNÁ=šíµ/üáÆ³Õ/JÚm'3’‹Óœ{$Êò¡aÊyÜ–?\‰æCª 0Üw Ä„>‰u‹'ŽêUïB Z6ɤ6NÑåƒecñ$£j@.ÏSò¢ÄËxg—¿§ôpmôëé7Ûy|>¥ï{Ë-)i Â`ýxGÉ I¯a¨ "G1üp<ëc¥Æº2ü“ùˆSžd½e¹Z†0Þ‚$ÖÊÑ€¸šñÍñE_]"ë§æPݺ´m[-9`SPu÷»‰”héqèÁ„®¹¨kúj2+8Ì€€8¿p9ŒðÛIúŽ`ïCàU’·°ñQ¦¸gƒr÷¸09* àºzôñ¼»>§Œ€§E7c@Áca¼Þxšs9ɹžá\þÁ|“Ô½|Ä̽M;÷©O2J~i§ákk³SÔ$ºQ‚ú 7”øÖxt‘ôvI§HU(#,&‹7ºaçÓö Í3 =”X©íŒ³%GJÞ*ïbT^¶ÔݯÿÔ¾$&ÔŽ`Et‡aÞ&”é)6ûæçÄM¥Æ¹9‚‚.ðu–ÉMDzö¼s+ʽË,õ˜äÆp<ƒÏ£8§$ n¬­2 wÝPûãû+•šÌÆý$?SßïnÛßÏ÷%kºU1j±Ç=ÉWyBRQΖ{Y.”ýCb9HlÑ Í#HB{ ûŽžGÂPC5Ô‘f¸ ‹Ð’ÌBœXH´³Ù‰’2%*ÛýPiºæFÎ$[±ü…'ƒ#š”.˜ÔE¦[M£ÛƒÂš²?ó¶ÀK‹ª³A!S5?òmóòe <Øó¥>n’eDÐ>ŒÑ÷KvZ¯ëŽìœtÍ­%I£ÿR²T?ê±Å·€¿.CÓ¥ÓN€¯2è26cª£zsõv&ù+xµËïcq­IΈò.Ýk&ú–’d/šÌ‰¼ièNŸ¤¹ÆzkZÜŽÔDÈg‘â%1)%ˆÄ˜iOõ™ÂJê“æP_Ê!U¶Rªw/4¯[hùÚ?yr›Ó‚X,‹ô‘Ùqkáýjy¤Hn±#ÝÚ[2cùí ›nmÏ„Øû˜ÖÄX–G•`–úÕ¿ÿUo› h˜ºÌÐK'q fï8ËÎÏ1ò®š3OV}Ì›tÄYSõ÷ïáØºã’ëoÝø”Î%cn¶Q…D¥‘ØÀ\µ {@"EßßÛßTœÙæ`q4[îS¬„y+ËûÙ§ýè1øÇŬƋŒÔUí“›+L…½ÙGŒó›gÑf¯½ú±ñz¥Ù˜GœÉ³Ùì¦Å¸$¬Ï(½ŒJ\¿@uõšöVÛfÝk³nPÇ$S‹hwOñÈ:Dïtâ hýI('Šéd„˜Â÷Uæ§P3ZŠÉôŽà"¥$Jœ~)™àƒhn½fÚ-£Ìé$‚¼µyúW³²Óýn"€w¬æf³[\ÔkDt“÷B*î¥GìÂ’Å€q‚÷Ý››Ýyù…í3CáŒá¤ÿÄTHi6sHàR¸_µ×^ÿ² ý8ì^¿÷éÌíåúÀV–WO­%yµ$ÈÞŸÏ‹¸Páµ_x1N‹'Ñæ#¬Û7ÀÒÇ_œÔo|éqÝ×OfËïÍ;.C•GZ’oÜõ´Ã`õAöVL-“KîÔü¸Ú‚<À&2ðL_ç–uÌ—[ÄDSµÄÏ:¼WF ì:’ YŽ˜@º0b1 •I—f%'žSà¯3ˆÜúãw&­êëpãÕˆøÍëð)üõ¹‚äxgëèÅËÞÂëgs™t³ñ'_-ÓxYžÛy=2 ÿg«ò4àV¬‚¦ÚÀ™Ë‹j±÷1ª½(õHIw™—ëa=î2ìí 5½}•ðŽ¤Ô“îxÓÅ[Küzí ¨uÎÙ5Q¿74$@þF¸W`I•,¼Ë¯„…þi<¯vŒÙ^¬× ³ÖOèè߉\ÖÚ0áÌX+Ñ-Ù–Ò‚óÞLgÕ~MèåF‚S 2óyðÔ‰ÛôKmJm.KmX"4­•‡ò{E¥¡Ã’¼é0ÌÌNœq®Ë™>DzT +dë¥I¡ •%|à I•‹ñ©¢¦3Æÿ-qؤë$gó$Ûïgï¶&C’A÷¦ P—mº¿,ú/#Vè Ä2E“§†NøD¢"UÉ£2ZÐh” ïÔߨ¨J´eQÒgØŠœEçhxÃÒº]3æÂñýáëF÷«–}̪“¼¯@Ô’‹6×öIÑŒuBùTˆa¨Õ<òôârŠá«ƒD#Å¿†¬§1>ð(þU’»pÞ^³É îø(’ò¯CJþ¯w7wä[,G›C¦X~2è°„Æå#ïUà{ê§åÌ—ß?T^ëB€xk=œT#Q‡ ÀJ#Ù²$´‰RBRÿôrµM†œÕÇ9T6䳤nЬ…Þw1àô0i'ççɤútªµÜÅ~SMÃKcšTwï/c¢<}l& o¬Rþ %ÛŸæi2<›fg£,ÆÔI1=?“¼ØÆøõŒRÍw~ˆ–ìò¨4DU'5sÚ{ÃÞi±ò”Jx=intÇi5‹‰3XP¶Ô˜×f6Iš% àL4M|:ì¹ýµæÃ*¡¶Ybg(ø}Â~Õ¯p›àÕëío&I¤°#\‚ú”œR½¤e]ÔÌy<H&‡‚³¨š †=t–î$~±ßú‰_”øžØlà*prÝÍë8O©ö»MMŨæ7OÎÆcRÖMv/*Z·‡å¿Â³ƒ»†K†z–‡TEƒ<¡rÕΛ7ϦЩY`9I£Á/Ø‘× °þ]TϺè¾´ÍÉŠlâJZ_÷Hoõæö×ãM]ž™³ÍzžâÂYE‰H—bBDó$æ©L’~q¾qòuƒXXJ¶ÀÚnKZ¥wýµ£¬Õ‚žsõ#…w,TGô tÇæ\ð•8¥ðQijé% ¢·ˆ[H6çß;á‘æžÂ"8)E‚ b¦ñÁcæ‚l¢}0n©lCòL²·#_¡^1V¡N.Žº¸ ëtg뎘´Ÿ ª2c§åh©>DCE,‚ûÖP¥Lxf:+Í¥:§’%׫¤¾÷=;W\RL~ÝEÌ/ säQ¯¶K@Qó_åü­~û×Eòoüýž>ç3­œ?éòu;N¢Ã’cÐ-çªAamM‹T“‰zõƃKæ~æ¾;ê{Tåë¹umš=þévv= _dŒçRi€ýºaor‚`ðŠz¶xQÒ£vUòÛ}–¥/\Ùõ[Î[¼&l[» üá“Wc›¢þ½‡ú~ß8ñ`B6S¢¢·Bæ±ðs[+Ô‰g¤¾]ÿF'ɯ?rW*\Ç‚˜$Äż 5eGq”‹ŒÂ3ëÒXv¹Û-¼`F7^Q/FýuawWÿ»º°Fý .gÜÀ»bz0­%õc¯.¶Ô‡¬sr›Õy„ȲˆJuõÀ÷¤C2ö¹–ËÀcÌ|!AÑÓm ?ƭќͭ€ ¥[¡Ln*í(J»[6VŽãa+Ò(ÿÉXj5¾ð99 ÇgRWa m÷oÚø/ý A ÎI„Õé¤Ù-…—é²(”Ê ñØ5Òw$Ù4E{'Ï ˆ)@ŒëІ/â<9ŸÌì«@ƒóž‹Gò›³¥±ˆœÔ,ù Cl£°>KœåЃõ†ëô¯ˆ÷¾oï›ÍôÂ:/ZÿòaóÕÍÖð¤ßŒ/¥ÓPÙŒÇÄvÆY^TKDH†À~I*/O®Œu>{iÞ_Å ø`ø`@4nßuÏAÙzÿYxxð«³ÿ±Ù¿€]ý1~]àêÝÃTŠXF‘Çá ˜”T\’ÜBotj¡ªKÇ#*«É"2ý,ûXõ!ŒVý…\Aû V‚ƺѭpœÄ“ÇÇjTÕh”,…,{D :#-µÅ«ØÒ/š²à½PNa‘±G ½p÷&ø‘žjû‹©Üb8™ „qZX7OM¬»/ÂÏ××5ßž, WNpí“ÆHôŒÝú5[`ö4ÄÉ  nÂ1V3êS<ã r h3MHëÚ ¿N0î07ÖÝ@4·8d²ª·¢x7»¡áÞ¹ä©l)VÙÖ}¨5 YYO¿8-V(H”Ì­FîózˆMÛQ³ÚFôŽŸ?Á%U¬·nñ3ÄCUºÃ%^³®êî!Ó|Ë7:Jr~{r®.:ÜQèݾ8æÌM_&AL-MŽ-´d 2m‚Ð1§6[;mtÜ0-,*Ù$}¿ssµïÊŠyjxºL€ž W„;ôšçÌY~]óÚA=+ì½Æ­ëáÀªÚ@¹Ò¦0dåp<9Éh†9ûÈ‚÷ %4‚X R2Ý÷Ä›ú ôHwô«Vk2Ó›³ñi’=ž†[=²Q:¬ÞGÕÃÔGÓC&è9ŸMø\¦TG íZtaÄ®qNö§tKvî»c¾žØ^6c‹á:Ï”µ2 {xˆ}x|®ÌÌÁcʹ,¦nx ¼Po¸íиd³óê¶9Óx¾Æ‡–¹íúc‹?Ÿ„ŽG51/j’´Ðþî*P¡'ËŽàQÀ¡>s6·¼iç×î--ÀóœvÀµÈsº¢ú©@¦¦lïK34J:œ:[&Ó/ÉK,—Ƥo«ÒŸèí{G×Lt»ïoݶV]žÖž ¢jï*½ ažÙ3Á-o5˜³ŒÞ<ï[ƒ—‚"­å?ËžöÔÎj]áu¡œ/Œb즘x†’¿I9ɃX’-‘'vémW¼žÛk²”á×mùò)Œ´ò§UøßÂÍðõºïÀ Ùõ[ +46øM Y3 N$útçp÷‹€þìÙú,¯Úm¼Ÿ¯áCܾ½{ù2ó£Ù5~SŸ"~²4‰w½¿j÷O“wWùü{.ej7˜âáv‚ë´1;XÞ6½!\moáîžâîÚ)ÛxMñUûûð©ÉöÒ«ävû!|Ê¢ªó­Œê:Q°åF¸ ‰Õ®ÚCøÿ3¨íÄ(÷Œî˜¡ì±WWILŽŒñä& É®n–sYT1ª "'>Åé_qdü ¯qvÅõð–à^ëñ8¦ z&¯H{Ø¡ /…jl¹R6'º†ßmÆë"pÊ`ŠEfZTo‡ƒÖ7pÛ/2þ ¸«7ò'ö+ñnv¨Oáß‚cªìÍ“XâPpÌ&[ñÕ×ãØ­;œäP’hY6:㯦·À‰6¥yà8g¤aÝRÄjô3ÁiVƒ§6Mª´Š&F‘µì\,væhKƒI›ççâI‚¨f•…*Ž$®Ï˜)Œ$í|Æa¼Ò ¤æå ûI}`TŠºo‰ÓÃOÅû\ç3‡ã˜ÊqÑcë.p¸›åƒÄ ’ìut;2: w¢Œb'6CüÜ/?ìªj¾÷²:£½„Ѭ(/åÇMêÃퟥ“¸ GªÛÔH&˜\údc¼!ô¤’·3J!ômºC`¨OÖ”´ÜÉg²‘?Ù>Lö‚#ðmaã'V»R®·!hÄN€x£ÐÐÄI´ñoË(Ó›@ÄY›d‚Õ°E„´»éõíªÆx¶÷SÞ¸YÊŠ–*pHãåêo„¿OÔMœÃX*h0!4 ‚v”nžëÜ!þ—µ;&z¨Ê7‹tI”0y¸O¤hgˆ©$Z#ž•e­Q'<8<Ùé…ÄðϸÂ1.üêUD !ðð¨.hÊ)!¨˜²»èï´øFýQ&gdÆq’qª £ù>·kµkÜ) U†ãa[]¹ë C \ßšÓý[¨&=e·‘#àSe š'+DMùVåécé)‹—×a_ .ÝõëÿXu#ðV€x8 "–„ÃZZvçúÁ›KÛ2 T¥¶aܮʻŸ˜D‚E\¹¢Ù4CB7 úÝSÌŒiúòàHR–²ëy\ôD—Ỉbr¨zRzÁQ¸›0½Ñá"{ÀÒ²A[†<äfo’¦ƒd9~TfE‹ž«ü9-IúBOаñãÉ!†‹L͘!•}M§3®á4~Œ¢Ã<f(µ››ÑQ‚Ò~:Éæ/Tšr}ßÞleWÉ/*>º‰Úܸ¹ÙlcL`«p,ËڔȮxõ‡è66‘Ü)Ã!IOEçžÛÙ=:Ü?ÛÞÚÙ?<à}ÑÆPõãï+lD?Fø„|Û_-èͿ᧠8û^g%‚—çͼ?½™à׿ü$ë…ûzÖÐ2½JIWç6",èJÙÓ©#dp\æÞÖWWW™kæ·ú}o0ú]¨íÂQ‰¿¸Éf|ª˜‚]5þÊœî?–¸Y0/0û}NÝ‚+¶âÌéªY³Öè;â˜Æ¨Ïo11~üâá<ï±æ»÷§îZ÷Ö•à"Œ³W‘ø¼»¾Ú•i1Š˜ttðf`æ cü#ë;ååP à/©^ÃÃ«ÝæÐH.Ï›©A™Î†µëã‰ÉãAUüÕA2-ñHn/46ÈUH¦QÝeKvGTEùy Ø¥ÅÎÔ(m¢ÏóÛE†sû«®8q{¹‘… …£‘cõ ozõ‰ÔeÃIrSÚJ`·âDwë>Ä*`ÄÃÇI@sUøÛ¸á›ÓuVx>î+A°KAZ ùBå2…Ì7é(›6ŒYÏÑ©'‚¹ §)ŒcÇєsC`«00ôÞæ¨AŠÔxëÊ'Æ»‰• %jÖþ!\ŽP ˜ZôšËáøæK~,tFwçe¡Õ]Á}Sþ¾òÀ苵ŒŽ3œ¼j»{ô¤ù*ê½§pÓ7´>ª«³"F{J†5¶ñ1†—€¼Ã®US@¥•°‘2úà‚èöÇÎgð;FoQ‚FÜC@²1 L~Ó¡yHÆRªOɱt˜à?[WÉ[hp³¿p,Þ<˜‡(½wõ×dm¼Ls4çÓW¼O³1À†Q,ƒ(*R¹1ôLšÎÕT-°†GÀ°Žåþ¶wtx€fQ¶[–m«6P8¬ªÂ ˆó™˜sÓÕF_¥é(Ž—ÜpÏ…5Ü:.¥£u‡5óûüåÖ·'/Ð wá-ººJ¡~:Ä?¿П,¿Øh…—ÓéU¯Ûµßu­ÏÎN¸õõña$£q´Ì>n‘>à~é¦Æåø ˜ß™QßCõâ$™Fl¶U‘äƒè³&¼ðç¼rÛ0|Ùi…ÇêÔ¡ú¥]"¿dnɯâPäx7 D°:Ú}ñùú:B`0›ÿ à ÌÓ5ègrepmail-5.3111/t/mailboxes/mailarc-2.txt000644 000765 000024 00000027250 12504145755 020621 0ustar00coppitstaff000000 000000 From jrh@jack.securepipe.com Tue Jan 13 03:19:47 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA08834; Tue, 13 Jan 1998 03:19:47 -0500 Received: from splat.securepipe.com (splat.securepipe.com [169.207.51.74]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA00703 for ; Tue, 13 Jan 1998 02:15:36 -0500 (EST) Message-Id: <199801130715.CAA00703@aleve.media.mit.edu> Received: (qmail 7615 invoked from network); 13 Jan 1998 07:23:07 -0000 Received: from jack.securepipe.com (network-user@169.207.51.75) by splat.securepipe.com with SMTP; 13 Jan 1998 07:23:07 -0000 X-Mailer: exmh version 2.0zeta 7/24/97 From: Joshua Heling To: handyboard@media.mit.edu Subject: questions re: unix version of IC Reply-To: Joshua Heling Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Jan 1998 01:23:12 -0600 Sender: jrh@jack.securepipe.com Hi - I'm a handy-board/ic newbie, so please excuse this question if it's answers seem obvious. After two weeks of writing code in DOS/Windows (yuck), I downloaded the ic-2.860beta source code, which compiled without significant trouble in linux (redhat 5). The version is, of course, a bit different from that which came with the handy-board (from Gleason Rsch, was version 2.851). My question is, can I just copy the library files that came from Gleason Rsch. into the lib directory on the unix ic installation (it seems that I can, I just want to be sure)? Are there any other issues I should be aware of (w.r.t. the beta, or using ic from unix, end-of-line conventions on library files, etc.). I'm not particularly concerned with being able to download the pcode in unix - I do have DOS easily available... BTW, thanks to all that have contributed to this really neat project - this is my first exposure to robotics, and it's been great fun so far. ----- Begin Included Message ----- From owner-laser@ns1.qsl.net Thu May 1 09:58:06 1997 X-Authentication-Warning: ns1.qsl.net: majordom set sender to owner-laser@qsl.net using -f From: "Guy Hamblen" To: "Laser" Subject: [LASER] Which Circuit for OPT210? Date: Thu, 1 May 1997 12:53:29 -0400 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-laser@qsl.net Reply-To: "Guy Hamblen" Content-Length: 1037 Thanks everyone for sourcing information on this device. I've got several in hand, feedback resistors are in the mail. Now can I get existing OPT1210 user experience re: the following questions: 1) I assume (dangerous I know...) that the easiest circuit (per the Burr-Brown App Notes) is the Fig. 3 "Single Power Supply Operation"? 2) Is 12v operation recommended? 3) If 12v operation, did you use a 5.6v zener or lower value? 4) Did you use electrolytics to bypass to ground pins 1 & 8? 5) Did you build this circuit in a shielded box? 6) Does the on-board opamp provide sufficient output to drive a set of headphones or did you add another opamp gain circuit? If so what low noise device? Any highpass filter circuits? Is there any need for a bandpass filter circuit to get rid of audio highs? I am using a 3" PVC with a focusing lens (f/4") - - how did you mechanically place the OPT210 so the focused light source falls on the photodiode? My approach would be trial-versus-error.... Thanks in advance....Guy N7UN/2 ----- End Included Message ----- - Joshua -------- Joshua Heling jrh@securepipe.com SecurePipe Communications, Inc. From fredm@ml.media.mit.edu Tue Jan 13 10:41:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA21129; Tue, 13 Jan 1998 10:41:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA22423 for ; Tue, 13 Jan 1998 09:10:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ml.media.mit.edu (8.8.7/8.8.7) with SMTP id JAA26699; Tue, 13 Jan 1998 09:10:37 -0500 (EST) Message-Id: <199801131410.JAA26699@ml.media.mit.edu> X-Authentication-Warning: ml.media.mit.edu: localhost [127.0.0.1] didn't use HELO protocol To: Joshua Heling Cc: handyboard@media.mit.edu Subject: Re: questions re: unix version of IC In-Reply-To: Your message of "Tue, 13 Jan 98 01:23:12 CST." <199801130715.CAA00703@aleve.media.mit.edu> Date: Tue, 13 Jan 98 09:10:37 -0500 From: "Fred G. Martin" X-Mts: smtp Joshua - There should be no problems using the Gleason Research libraries (or any of the libraries that are on the web site). There are no differences between version 2.851 and 2.860 from the point of view of the libraries. There is a pre-compiled version for Linux. See ftp://cher.media.mit.edu/pub/projects/interactive-c/unix/ Fred In your message you said: > Hi - > > I'm a handy-board/ic newbie, so please excuse this question if it's answers > seem obvious. After two weeks of writing code in DOS/Windows (yuck), I > downloaded the ic-2.860beta source code, which compiled without significant > trouble in linux (redhat 5). The version is, of course, a bit different from > that which came with the handy-board (from Gleason Rsch, was version 2.851). > > My question is, can I just copy the library files that came from Gleason Rsch . > into the lib directory on the unix ic installation (it seems that I can, I > just want to be sure)? Are there any other issues I should be aware of > (w.r.t. the beta, or using ic from unix, end-of-line conventions on library > files, etc.). I'm not particularly concerned with being able to download the > pcode in unix - I do have DOS easily available... > > BTW, thanks to all that have contributed to this really neat project - this i s > my first exposure to robotics, and it's been great fun so far. > > > - Joshua > > -------- > Joshua Heling jrh@securepipe.com > SecurePipe Communications, Inc. > > > From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU From fredm@ml.media.mit.edu Thu Jan 1 10:20:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA28944; Thu, 1 Jan 1998 10:20:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA23720 for ; Thu, 1 Jan 1998 09:41:01 -0500 (EST) Received: (from fredm@localhost) by ml.media.mit.edu (8.8.7/8.8.7) id JAA32741 for handyboard; Thu, 1 Jan 1998 09:41:01 -0500 (EST) From: Fred G Martin Message-Id: <199801011441.JAA32741@ml.media.mit.edu> To: handyboard@media.mit.edu Subject: Re: Digital outputs. Thanks David for a nice explanation of how to add I/O using shift registers. Let us not all forget that the HB does have two uncommitted digital output ASIDE from the four SPI pins: PA7 (a bidirectional pin which is marked as digital input #9) and PA5 (a timer output pin which is marked as TO3 on the expansion header). It would seem silly to disconnect a motor driver signal when these two signals are available. Fred grepmail-5.3111/t/mailboxes/invalid_date.txt000644 000765 000024 00000000731 12504145755 021470 0ustar00coppitstaff000000 000000 From joe.user@example.com Mon May 23 17:52:55 2005 Return-Path: X-Original-To: joe.user@example.com Delivered-To: joe.user@example.com Received: by smtp.example.com (Postfix, from userid 1026) id AF04B83C601; Mon, 23 May 2005 17:52:55 -0400 (EDT) To: joe.user@example.com Subject: test Message-Id: <20050523215255.AF04B83C601@smtp.example.com> Date: Mon, 11 May 2005 17:52:54 dR From: joe.user@example.com (Joe User) Mon May 23 17:52:55 EDT 2005 grepmail-5.3111/t/mailboxes/mailarc-1-dos.txt000644 000765 000024 00000201715 12504145755 021403 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/mailboxes/mailarc-1.txt000644 000765 000024 00000176541 12504145755 020630 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/mailboxes/mailarc-1.txt.xz000644 000765 000024 00000042034 12504157377 021260 0ustar00coppitstaff000000 000000 ý7zXZæÖ´F!ÏXÌàý`CÜ]#‰æöàÉ©÷óÓ0]f¼YÎËòàÌ”¯¸¸dÞ«z…Ìá"®ïÓpªpkJÇh½*òÉq"߀‹ëi"ÎlAT±ž_{×ÁEq~þx˜Æ5åRªó©JõŠcÂ%û+—v¶ë éþæšxÖ ŠnŽÿÏcˆC[™Â¨MkÆ&ó)a•º[Æ|ä8;ðÅÖú¦ýª§ÃcqQõó9°tÑtf u3 Èžvœg ÀŠ~×^4À¾^Xy÷ëÒÙ_;ÄŒ„ÌÂÜùžÖÝFã¡+=ˆÏhñȇżëq"P›É'Óà×¹~&5ßÕæ»9·'Ú|·æ‚ 3ö¼8õm‚&õ—)*‘t®V±³ }õŠ_ìk~Qú¿Þ2ª:~ „bpÂÕiOü¤Qšm¢|åj‹1>×;šN‡½ï©Â€žcÀª@€º ˜§ÂͰ‡K#å!ñfÎjCüg8Ô)§Á‡pð°*1»ËJ“ü䱜6éªô(b"šâ/ã/‹Ð$¾ÖÓåRÎê—`0e¤ ÞSRðaœKƒ~62›G÷uXÁªÖác~Ƀ_ù!5$[à!JåV *ÃÒ¾G*&0°9šMrÀP1¿2õ8¶ÕCMáp’t8SºôŒ™-òá½É"ícÍ š;‰‘‘ôºˆW,{)zÙº5°¿ßÇwƒ„D#:?Z)â^Á oÙy\wá;UŽ/ÿ4ßø%û.¦£Ä ²ìuH³Z&C~·ö€{6]ªN_ ˜ƒK`e[ƒe°¯©‹QŸýÔã<ÈBp@_ÂÓ5Þ×3x·_$ÃÓ§8^®@Ïå8é•][[œ;u–‡ƒ¦Eb>61AE€³`ÆòèSÂ× *D¬.ân#”Ôˆ)&V ¸Îëð°»æÑ0rNÈe~Ô8ÊL¸ç„*æ7AW§`,¡Œ Ò…¹xd‡Í¤ùy=‹¿ß1èšúS:ósÃdûs”2ŽDs°~ºVžçÆ™á4¨s&‰Kׯ¤\XþÞRˆ˜dóÏ|^R_ô˜Næ±¾Õ›_»·¢§ˆTõZ§‹à$àú‰¿ŸcÊÀr˜™\‘N¦ùYÿ™rt© ýÆ*@éÎòä—“P¤À-è[ tª¾Í¬Žì)ßAýé%›4x|€yf[¡N•ò.hgÜžÔ‡Æm7lœ&^ƒ½oÀ ýxtì)¢žåa[ëç-k¬úñÒäËëîIö–Ñt W‰0>º-­ARg€* 7 gøŽ,IËÔ´7ŠX°»ÄºÓ³žÅõå´aDeüÇS"¡n“ÙB/\‹*lIŒT§v²Ô§ZØ&k ‰7˜7;ãÎEðPVŠÍ¯ML±B6etäòü—–­±~¨ÿÑA´ïrxí?xÙgTZU(ˆK1mñfð"¹ zÜ·’¦¿EÖKÿæZû!#Zñ ¿SÁ£ªP?âsÝÌ ÷¡ 5¡ŽÇˆ>uñ{&3³Aì÷®>àˆbî7BcK*/6±¬h€¿çå²<Üþ#oݱUÃRï#Ï/+]í4‘¥»¦¹ò^¬ŽR¥ycÖ†ÇWÂñ@|¿ˆ… Ï$kžIíhÊÓ.]ʺæ=!í)š%«3‚!UM’¥;Únû¥ÓK2¤˜Í߉ú­ia~mÌÖ©.mØÌ?I\:¯«!l žtÄÈÞƒXµ¨b>Ï “!óטƒ¯:«‹¼—êÈI]lG_M̽ÔH•OJÐå§<Àš'ÁõG‰q÷è]¼ë¹ TÉ»®“º“éÊ4˜)ÂRÇ  Íð<߈(9|>§/Z<{¿¦¨0öE‹+”÷«àâ‰X Ê´ .´ÁD³·ô¾!šBÈÅ$7©©5óÃfÆ‚†4xìŸ]Î7ð{AíR¦ûHmLâÕz Üê±±Y>‘%G,‰ ˆv+€åÓpûóQðÎÅaÒ½¹•+V ìÉÊîæToµ“–bÆê]!]7¶ q%û §D€we :¯9di| ³>ƒ)©«xqH M” µá:㜘W{émˬ‘Õ ÇjäØ0À€ ~vÓjÁÄÖ—@¥•‘©0ÅY”]v6sl5gjM\qê™Ç3¶•¥Õ GÉèk¶âǼ®:‰7Ý™ÎÑ}3I "5æø½Ž>ãœ$SÄ«Å\¬zìzào|Ôä CäÐVæ¹}[=kŠ#õ ?¬¹ŠÏ8šÜúB]tjzó!„à—ÜøãÑÑÌE©f¹hÜîR½ÐTñˆ×M>ÅÕRVâ÷¼h oox¨¾˜Ø-.(7ŠÜ?q)šÞÅ3â?¼ëóÛ-éÍà K4˜÷˜Ÿ2hÆÁ~dbm á–üÎöéS®N.S+ý©“ЉzÓØKÎ:(dy<ˆRŸúzF>'"täûZ0a@ŽûÑ!.[õ¶.‚|]póðDŇçGs½ ~]Žs¶åA͸| W&œ^ ý&r80D7ÙxÉ€oJ|ù¬¢ZQÑwTqm‹Ùmž×U¼Â¢lð Öªä†Ûõóe­ÁŒ 9|YiKüc…Ã:Ÿ*¤G\ƒºyõ†3‚.|¢®2G§#+üú+퉎ÐÚÄí{VÔVÄ ö冗=¡^ÛþB·zí·¦¥OÔ ˆRNà‹þEe «O¨„BÂh7ËYöö5›·F„úãBzìw\#Œ‚õß91‰:s¯â­¬ßîvTC'¶G™ð­â(kû(i*ÙŠ;+<–53ü›¨<µ>ôE<"Œxªø€÷» ßï÷I‘ášvžqW!’ÉEÂäW žû‡Ái8nMÀ ·‹ÐœÇ ãDf¾`#BáSYÐ&¬qrÄ@ò¨\Š;e•õb ½^Æ—hKv„Í©ïúٮ˾WRʪvMÈ·¶ã\·ê@‘Zµ >–GÅV:ï¯)€ÒýêON·º·g«#Ûâo.R?©Œ">.4Y^[3V]î_©@iš:úŠŒO‡®‚¸5„h™ÖØ–òl9¸´¦R@tÔ9_£¯ Kp bæ*¥PšølÐP0PýìÝo‹Jâ ÖŠô-(ØUM$‰ŸO’¹Ô£ì»÷ 2Žþt‚T…ÒÎôìòQãír‹9ÝŒøE€IhnÓ׿WÄïMØD|C²‡ÖÅôèU³¼Ö¬¯«ËI2—”êøËw7‚½«D”q={qó(qýPí¤I¬C(¥ép0îu†ÞŸœÝAÛ’Ÿ'l}&žM—¯ŒK¿‹Vˆ´!„ŒÎG‰ cÇCs‘å¬hàé7Èz)ôÔÑO¡ ó³¨9(Ò]Õ')]“Yó‡Í*†¤‘o\ H5F…›=EÀ±Ìt)‹ ¯mà fEäï²[`¢Œ™¿!ûi=ÒªËkñŠçÚýS‚̉°ˆ!3™.s±,­_äÇø·êÈW{x-3Yô+vëiРbºª†cÑF,2Õ¼ûôÌtS¸'ó>¼« Ùü¬œ&?¹ köaø£åúCÊŠô…mwµ{nF¶&<;šq'o6h@õ«G³‡VÒ1•õÿ+te…87j{”/šflF7ËA ü3ÜfãnlŽ‘ãE]Ò«`Ð>%»Npmq•¾1»íéê¬^˜§téÿhʾ«¹ÂѬ«lêððéè¤ÒÁ5x`qr7ªýpïr÷¢Ì·ûðZÉ¡Ü"ëý^@žPáÝ®:ykØF4º~ Å ú@°ŸÙÿ”þÛÚL…’qƒÓÅj³çôŒ"STfoŒÔë¯`j¿—žÒ™Ä æÆ×P9"™ûòÔu7I{v¢;OõÚöq»b:ˆxîR°côW¯•(rv gg9kæ²ÙT·jä&ÄŒQ¦ZòPAÄ_ûfÚ™úÈûùÿ‰'A¦òþŃЈJC^ÎÐL;IPÁá»±¡²­pù­¸TÆæ’>^_Q®ù"ã‰^K4_œÍ¬Ë1ˆ«0 ÀPÂpÛ{*WL.pŽ’ÓˆGÇÔnÙÁ_ŒH'Òî‹@4'>´s zûvuðZÔ[¡˜†€ŸúzÃÈa:_ ¬ª×æÄ’ ÚHÙÕäpØyxÒà!‰V18Á8Id;'‰‘æK3öÒ-\+9œ¼2sŒºúÀ¸×ü ÆaÜA±‡¾L;kVÊ™€¹"¶àAŸMmŽ/;©õzýÛܼ0ĦÕVntI”{a;Ñ+p¶ç³:Ù“b\Auoõ⣽×<ÃFXgŽæo“eÕÌál¯üš;Çšýã’jLABÅÜ·3‰Þ\†¸ÏràìVÃ.¼úgDi„džZjú.+{Òž­0«Õ¶•‰`ºs¬ëœ¡:¸  ”±™î¤KâmH:>0~‚ç,d|”ÁÓ+µWnhÊëWÖ†I¶Ò¯„|ÜÈ5º=ﲪ«z–q™»Ú>€Eàœ»Tþüƒ|{’¬Ì<ŒíD?{AŠ9¢Næé†#*iÆ‚%É_¡€ˆÚUä8waTå'¤+èS-!šŒ|ô9Õ=Å'˜A•¢K°66¥ÏL‡S§ª¡¬z!ããØ¨årlµk ÑJáZ7Gé¼7±-!À¿fÇ 8 Ñ¥UUð©:QÖÇÔA¨c¸dÚI‘™IÂoþþÂÔáI¢™1ô}'p–Mlä÷m!$¢…ìÞŒ7Lsi°¤_çÉtƒç½öü/(õ_"$³ý÷¬øÏ¨û1Ä`(\*±¾øÞY££Nï€ÖõÑTpc Ò2ˆ1Ü”*0–PGÿÄïtˆþŸ@Žwû4Vœ>uâoæfØ·‰¤{Q;ç&7u¡Ö/çàÒ"q³þvþg”þÎ@qÖéFʲ:Òð†òK,{G*:·Æèˆà"¥z\jŠ~T0÷ÚcÆ"ê_`O¿-qeدÉ;M"h%]ª¸âÂÌöhŒ\õ!££Œ•ty`±x׸öª4ÖgVéƒV¹Ñuö¿²C °)qnõ[mµ…–DÊ‘œBz–U!'—½½´SÜæ†(¹ý{ÿ„Ð[ŽùO­£ID?HÐàKìšYi¬ïvU­?uíX“Øÿ¿úyµCÄ}ð¨x¸Ð3Œ|à0†d°U¶Üö°ãÈ¡é@ QÓ„…“9\U*”bv[Vœb²QÕ«¦ ­ÎДHìA' ƒ¥VÉ^j¦¥¹i\°ÇùÈ2LÞmÂaPô"¤Ãؾ”^|ŽÆ¬P t6þóQׄíI}íd¶ã•±n¹*\°nŠ¡0̺¦ còënÑ+[­Å䊌@ßtRã9¨6êxÀzT ‘-dã¬YÒKGY=Ѐõ²9…õcÜ ÄZ›´|â0ÿM»r TW½„}ðŒ&|/Šw‡”]uRô*ü¤A ¥U€cs>@)Q¹sU'“nسíW`ÿCùqïZÄgx4q’”Xƒ¸ï0Þ:Òl/F‘ÚBa9–° ÖÖøöåB‚v))ibx}Ëö ø£¼V›?`°i8MÓqò½µ6'Ø wˆï†Õ­x+nnFCŠÆ*‡_ÜGwÂļº–oõ§n0×5±R·ÙÚ"î",àjv(±c2ßÚâÜÔé&ûŸ.Ö”ðŽ£‚¦>œŽ;úOÛo>Ôu™E!ñ’ŸßåwD#ns°Í|^†jYT9]ÝuEW´í¨@|Z¸õà§q~’ÊÉm½_¥¬Ð`Újàu9r+eÚN«K{*ý¤– }~ùeœ¢µ6…ÿ¨í]>ÐôœQüí"J”[-ªu+Ÿ¸Œ"£f"ב—-<‹øÝ4'¬ 3—œJ…Š«&¾'jä~âÛËZaeð¿!!²Y|“ðKÁØi¯åŠš9SnNH­pgt@Jò°k#t¾!':̤&3þ‡HÛôlÈÑ]Âötï&=#ñ„n)ó˜y/î”/)f;@v†Ä…û­#Ii!"gÂ0¨— "={‚ã×¾…_Âùf+ eó›Å\#?žcŒ+à§ ¦ZÔ$õgÝØ{=ÞÒC€÷®¡„ÁÈL¨$cP‘G†Úá=m¨ôt@CxQ#ONñù\›Euj‚k§HžJ#dB¨U“wGOp¥ì-ÿûbÙ±ø²Ÿþ8'¦ñÜ- ‘tÅÈf—ö—/’Ï|ò•ÞÇàa¶ S:K;—Œr¤ñGó¦B5#àŽÓZ’€ŸOŸbÍáõ.BŸÿÍ~Âß?\WÒ—ÙêêœßI“iä7^~¼Æÿ.:n‡Ve ª”EoÜõ1 K ^“ëÛ_ɯ%ò™OèZѤCú?®Ó7éž6 û%¤½JÅÉ…®Â Ä•u¤Þ#»I¼±™Æ!Â9ù\á*P]*±ZöÌ|´" Q{Ùëý{-cí‡ÓóÅ®<^Î*4HÏ 8ö@æí­˜Ø¡Ë}ˆhNÔ.HŠ‚pd‚%ó‘X‘.±ôé}…­Z ·6U!7¯v€)c7”`íɲIÁ…2vN“Ø Ãë‰uè3ŠPñ’زž”ðëhæB©¶ enHü"ø'Ö3^bjbÂè‡}ýªó¦(dzÐÚ€Óæ± yCáóZ«xú{÷G8U@#zÆXlå-}ýuð7Ê×çehÌC¨0T¤¾®¨3k`[øS37Õ¬9ö Öu½Ç.:úU‚wY ˆÎÊ™ÛÍ¥ÓÁÂéíÕ3j÷ï˜^#:OýŽšfžÏû.lWç B×(6!]b½uÏ;zŸjÛÇ … 2á\YUAËóÉ!µÙ{­c‡ýº_ ¡Šúrz¦òcÕ.»Â¶¾ o’84ÿJl CsEq¸)j;‡¯ÔèÝÀ:NM£éçTp1{Sï¢.ש`bxËYØ?.m!Q—ªb†‚AùçFƒG|{–´O¼ËzH~4,ù`çê Â· Jyš¾S踙œh›‹ô›\“ ƒghŸLÔ :ñSÿ«ˆè%H@i½š"4ðç^ÞߊŒ$¬Ô:Ns‚O‘QJß½¥-éÉ™8;œö1»þ@ ?ͺ7Ÿ^¹†·ÄæW½iT­;ñó¾Fˆæ±x¦«/7¤«sdgS+·´÷›@YŸè<íýÚ×û üPÏ;šš4÷‰{ðW?Î%fûFž>·8šl/‡(eŒ8É‚(owb=\5ªx æÊ'æ©hx}:b½änÙ€ð~QÃü¹‘õ ÂãÅçQÑiýÈ3!…ÅëæÏ³' }¨Eb2Ò‚è´Òr¼¿¿wspÕï(W~ôT_]CÿàŠn‚$Ewñ%›ˆæ“É¿…‹]Œ·‚O1U•uFÿ¬žä#² 1UÞRFæ9X¦Í=cW£²`Í—\E,* ÞÍ©Ï0*W5écõÏ+¾kܪ©*n¾ ûСɼ}P<œ¡Yt-ÊQÓÍtu–Ÿ$5`þU±¾úP*¦±áO8WŒá‘÷° Ibo~SUÄÔ»Ëu×_h ±¢+ì'åâôbŸ’X£WE TÒH‚‡=ÉBÇÌ}úasÉ|=L¢Íugpc7_™+vpÅÆ Pv¿›‘„Hƒ]ŽÕ5ÇŽ÷ùQûÕ¢ÚCäÔ‘©d²?m ûp3V#Ê«xõ® þ„R=Ñ~žÂ¦lc)fÊq½1ðœŸXk¬ž&i¿¿ SÓ öÓx’ƒ>ßmÁ-kwÏ,0ÝŸÍióÀr¢E(õ]Vº~ÐÀ~÷ÌÏ ¯ñ` LšFKmo¨•`×Sív #Nl=о R¬\=í|¢î•Ó©E¡»L² ˆîÓbNY‚p¾³PK'®L˜€É¡<bkS!à¯í3É­ö/Z§a´Ãàåk-/ìÿåá¤% ˆµIï^nH𥯗ƒšzôáŠ)W{1y“ š.^¤F˜·ILðC©?‰ä,…Þìò?ïS"™Qªì˜ö '÷™—·ugØXB$–¥¦\mS.T~mºB¬PÂë6ÔøyÉvÓÓœi–pf¡ ™›XÒ »ÄµÂÞ™¼üIúá¡á§¯Ñ”`ùʪwÉ&píÂ^aŠ8í¼<0[ vŠðØ8™Ï7èóؼL'ÎÇ×\çü $<§«•¿ã©È™$ó¡Ò-³™%=2]ÙЪ³iC Ó%`•Áä¥K NÌÝÝ—AýÄ«ƒ±f \nô"Léf‡Îß=Þ/å]ú3Ý,6HÃm GËJ iàr¼È}x’)}æ,³BLµ•*P'Yã^ å²w}Q“Ë=G$:…ÑýºO™ŽUÈüHª×7°U1L¸V’kZð‹ bè¸ek“æI]²ØžézÌO[%í  âë[èDšA/«óo¿s£2-W ½R V)FJ>)¡¬‡”²Èÿ›Y¾s$×åº[]v¦û`žÚr²#^rQD±òúÙ˜{Aé¬O¶ã1˜DZ¦8¡w‡5ÊeßÓ~‰?»W±bœX—¢nv±š¿ÔRIóMZ‘­_‡kEÆ’—ÀÆÈL&l èÌ—å,P?¼ÈϳAqݤï*ÎØhÀ¯PÊ\™™§‡ýÃLk£~ÞºI2¼•Õà1Ï’·ù‹_çÀ,¥ŸY›;Äx mŽ\:ßÀFsî&xeÚtòŸš:¯Ó7Ç*Åå›…•ÓÇŠ)- ½Ä–C†‰Õƒ±ÉÎ9¸¼ ìyÅPvÛQ¿•\tf†o@èùIf”¤ËÒuÕ‰ ;fÁœÚÊ¿é.¢îÅcJ$œs¶’y'â¤^z7½S"6Ák‰àlº5úàçà{‘‘ª}i½lU|bë¿c“å›êgê– Ë2ÄmDŽˆÜÍ÷¨ÆéÕ´$sD§R[]ËdØœ¯D‡D¤ùÍ‹*õKÜ|šò¼ø*ÊñRk‰–À_×m¥ÉÌIBYâ¡°Åš½8(ËJ#ÆòA¬L Q~§íùbëçë‹ñ/=Œ3:¤~„o÷Ã9)ª¶§æ:_¬j‰¡és;®äoP±‰‚‡~ŒînŸG(w?ª Ì*qÏ ¸¹êˆµ(T‡*5aû8­§Ç´ø&-‘¢½ìÞ^+àPÁð›)KåÔ‘¦°í~kDÕýwç(J×q„.G0l{R…<Ͳu–|xSÜ;fËžzúôm?»×ÆÙÔìXØ*g\B€.c´‡¯”9Šöªº§AÓšK¢B HèQ‚€f=ŒýáÇÛ¹êj áè9‰ dè:8³à°_qÓö+¦ˆ§[Ôæ%ʉeÆŽ0[Šù5†ÖŸƒ)±û0Ë®ž?«ÈËí,EU­èñ- ¥© /ò·’±Ä‹à»(ÈŠèèž¾P.PÈ Ä$¨Z‹ œ–ù¾w˜.DÔ[³ÄØÂ­8¥Æún¼Ê±÷D¥ì†Eìz Ç𢀧‰!ÿÒ`„B‰”7rIz•Â}Y`­‹àÎxgT~ˆWÀE11Ën2”s¤“ð4ßúqÀ |”p‹C#=ÑϤL+ŸèÜc+`-\¾»Cº¿ÄÊ(ýZ1Lœ2dæcÏgh¹…¬@â˜A…BØócX¦‰¼P€U¥1àÉ)qŽÇâ„Çé.ú¡J¬áÈœº·e×e¼2¶Eؾ°ßȬyÿ×Zmþõj»¬{<$L‹ü>0Ï(½WZÄY|™^¡u‘Iü59QŽù¶0Ïn;ég¬˜ÅìŠWZHFÀ¨*“”¿«ê2àXÖ®&ü>¨½bM뙫‚Ä*‘ø¹¦pÿ"2Тñ:,J`*ä)‰ ÆÕ»Å‘IBÒjáŸñ/e¸x?Á™²?›Làú¤ÝDnjY_B·2eþþÓ³- )%QÍUÙq7@ä¦ÞÜú¼Ý)â¤ôǰrèr1ì8¹½ïѪÂùQÜ?tÖIäÍr¨–Ü5n:4’.Lq/¶LUÎÑ}ïv&ýY(+*ØOç€M6‹ÔœŽU—Ñì¬Y%¯yÂïæV,›u4“Àoö†fv­•!ÀŒ,)É®‰ŠÀ"q§Ø›4-f õ†zyÑ %À0ökzŽTàḚ̂6ì½ÂòØŒòw¹¿¾¤dRÞ^¢‘˜ì§ŽÈ¥‹§2¥%Ðwˆmc55ÔǶ°•ÑGW.“'çˆ2â-ÿ¤XÌO®eš¹1Œ;v)Xpg¡Ñ¹õ¸±Ç¨”¹Œ!„kâÄÄÕYsÔ‰â$Å"©µÝÅ26h&Õ^'WNZÊrû©ÝÍž²äã†ü~CiO–…0Éò’(ÕœPýX)^cŽ=¨n¨H‰2¿6Yåß´n;íë¡ûyïr€’4íóÜø:q×<¿êó–.Øì–|GyU›"ÔLÖ…C8oŠzÕXÆòÀ8ñ±>D!â¿uÓ®<üÀ5E[4†,½2+0? ¼àV«ØÈ?ÑÃÏcCè¹<ư҅SœDcù‹}T0·Ðì–~‰¸0!AG¥}Úúé˜VžÄ¸Ø›/hÁGjµ³çÚØ ªœ|å)­@\®‘B< ÷´+\muBqTÍçYÀ,¦Ö³I¼œì"}ÖÿEd!¾”²´úìjöç2wÓüá‘£/×p½+ý-Å$@¢:ßx0“‰èy]Ÿr *:Ñ:*‚Âb{!z 5·dâ*[÷ˆ]©vq’yˆsnÐ$Ú“,TI¾Õßf¿Œ…ï¨J;¼u‰0̓EêÓÜ÷iEíŽ=ãâüoS&Òð;ëð¶Ù‹™DŸ\q Ü\Â/¢Ê’2{s‘˜ I;btyA÷±ÿŸØ#“†ú¬_yÙ[_ÅÒãſ͎iÓCÓÞFÝÔ 5Wš‹3‡®jPþ/ ¥êr@`$Þ? › ‹`Î>þ8F„³Ò­ÿñ¤î :ÚÓK @—íó îÊ:Šþ!”R_íQPÊû6 –9H¹#¹ò‹{ÙDÝcé öî•ÓÙ’6Â9 ê'\¬¦ÒÕ±PòGJ8¨cñÊ}ãƒáZókÇD~biïo!Ѓ=l׺šwùÜ1‘ɃÌÍOv´‘’}ˆë!Äïqj-¯5ËKE‹2y˜œ„X$e¹v9Vˆd9Û^O39ÿ›j8SÐ-¾x«&ú(F„`⿊€SÇDöcÀôKd¯×ƒ¿¥YvI§>%`v¶L¥ 86«¿&&ZŒ'R>¬f{÷6CŸ #u¹[/'±­$« JÙ/®T™ÃVlónšz^ ñ‚Rj1à’-&Ó%DŽq#ØÍY£[z–êZÏÒƒÞÜkc€›¡ZÌ[J;èﶸnéÃ]ÿý¶ú[§_줵ømÈ<o“ôP„½ç‚G{ËÃ+&øÑ»»öLÅùŒjB,M>ê¡1›®Ëh}àx;Ü*n µq¼D;ÕÚÄ;NþÁþÃÕž6“°¾ç¨µt”ñ˜ é¯õì½¹z@VTþ²ëwnt+ȵ4 EN<¶Î†Û‹19{3½¶Ø;•ùˆ¬(°RûÒd ß4ˆ °¿¿*×n£AÅsJp#õJ«I –4‡§ˆ§Ÿûà]ÊG ä² }eí˜ÝŒ‚Ô:z=©S¤-—À÷5°ÆþYy·jh#­á-/Á+Ï‹o9uĶ2œÑب R&“^h2SàµuØù= r²pD„d¢#~8R)À„žÑ•E¤Áë›?ļaFJã‘Y?L̦a'R®ŒÚep@‘€a>t’,˜¹[ôEÉJÓò‚£9¹·qTà:üÏMGذTÇ8Ø\µ@d´¸]g5K*ójRIÈi{•Ÿžþ’íŒÉQ„—í @ÑŠ·Þè.ûµQdMÚÓ=¯Õê¥lg±–$C'Y4 Jmµ[àï©—cZ´:SåÞ…)?Ô‹Èß]^‰píË„ßøÚd´RÃñ²»ó%“,°À‘© ¯ájiASí,†²ô°”’«0)¸\Oˆîãx³BîYo& ê6!(šÅ’ËÊé[@½þìÖÑ mDS ®Hg `7Òßìër_ŠÜ8„‡³z±/ÐX}"ádNÜ[)Ó"`”SƒøìùÉ­ê;ìm¡‚A~ ¡©ZSÔ5Ö4';üQâ`)ÿŒ-™©Z÷‡úíoÜàíàî"ð—ï÷Ó-šï­@Sp¢ëó]G!}¾l!峩ÿÛ×ni€±à?Ÿ;ä!†ž¢ ™g÷ì<´9cK7-|­@2ÝÀ¯ñÿ†¢SL×wV)w?ì1HÆsò»—¢d&TÑåŠLxfOÍOŠ Êkæë´Cn }OÂ÷e·9W‘¢yèX$ˆ[oŒ:4)&ÁÀ‹Nó™Aìê‚k E¥šnÐ=ßÜÿ2áVû¶Ðñ>ôƒÜ_©û³æÄçÃ\ºa&̼h DiZ5®`èLÚ) „xíhd:~4àÇ!Y,žÁìkµÖAgm4ô;š­ßqzê×ÊgÜqr¿ª çZ¢;hIäpÜ’å5 û õ)%>ÕgË]® n¾Ó S¬¤DDAñjRIchl@h§Ø@Rcìž#à¾pÍ 2ë÷Š*úñéŸ êмÿ& ~¡x–™£ùkc+~ƒIb{ëdþÆF¾ªq§»÷o•N›–ž¦K^ö‘Ó¹ž^CuÁ¨evöLF¥ÂþX€äó#‰Y&RjÆLqÀ1öÿ®y“[ ÿ@6ø¹æC°n ×u6kî M®(Óží¬ݧc f%&V¹±ý=‚"¬g窶 Þèk²÷šê ·ÁÂ^ÿHyaÞýÑôê]¼÷ 1H^Å,+ù«˜¸al‰m˜•"Z¢VâÀ1~eö£î² ³òÃn;${Ôõ¡âå3cØ}@˰–2ÿ o]êÖßH4ᓟ=A`ájq•×Ë¡ÇógóGÌ8þ…§cðEåxû^ .®ÊFŸÖ€gበÔðà•òïˆ=CŒ´ãç—GÙ—¨aI"Dt1 ):µø)‡£zÄ?Ú·Àì/y‘/ S…9ÅŽM×)"ökU [qÀFÑkµ‘´¶…¼—¨Á&£”¹)ì^ùž„ ÉßÒ(²B.ØG­¤g“¶þòŽžo¼Rb1ž{Ö ]«!ë\Œ+‚‹è=FÀ+þ0?Úo3fÆÚ™Ïõoôò"_»0á­DÛ¸žxô³¬“ŠXdÈþÆ›ú·¢Ÿ¶Þü~Øy'N„8«=b4–_nû6ýëƒ ÷©®?ð¡‘›NÒm¹ô#à³ÀU¦ÏOð»˜oï+]ÂÌŸ7$7L•ÙS’3ëEEQÅòOã"'2$ëµ )ŠðÄns\W ·¦¢‚%1üå/±åå.63OÓÊ0.ØžÌy;g_·‘¿½äßÑÎsƒæ>œý8Y««(ËAZäÃóXȼoíU§F,…I25³/ï=’7ÄýëPµM\ܦ/×êÀºn„'0Ñ¢³=Ï÷/î0¤Ü4¯á‹ÜrÖN󤑚1‚;âÊeKVV>6'Ë[ºûÄ®ÙtÞA3ýjÒZòsxîs aŽ£^á lÿ=:Š`³¢‡íG¨ln_éªÒƘ[óÇá•úŸÓa”:ˆÌfÇpý‚ªÛžf-¼/XØ+L–ïŠJÆòŽ«ì$‹=C½(ÖØÈµl,ô÷!{×ÍÖÏÜ®I€>ªÂ‘âë „jÆ]ú«·ò€ùmBaNùkån^žðýkk°8Æ„Ûæn”¨?¼˜†üô¢ =x=ü:<ÈÏlãù˜æ vh隺mX&ˆ{hÃÝo&uº'$}EL[®•äš54ïÕ΀y¨iR+»Ù.ØÃ|X×ËŸi·Ú†p/õÀ4Cm¤Ýw¹ñb¯5S|)‰ià*³=YÝáUŸã5šèpÊ©ãà >™‘ I„d\ž'UË~,‰#!F甇åõt´ZÎãš¹h]î4Èhcg{”ña5Põ+IQEp)}ù‰©½xRç§C/²„ìRW/"PáN >'5‹þ±Ÿú©GF°lmÉ|m°k«[‡Ø¤79–aDÄý€ $m˜ÎcÔ•-O¡¾(ë˜6•°2ˆ¹/94ìºôPŒýE²&I¹QèGF‘]?Ö_·z,“Ù©Xøš§úô^ÉÉ]F¬á$«©•Fîg›µXÈDÆz .¿~ǺÍÖ~ñu¶Wã6Ų·û!ƒ©”ûR@«lfîaÉë!ªòHÜݱ®“Yus;Ç:ðRò’”I¢A$N(8ˆ¿Âí±eí¼œ®¼yQ\]ýU-»Kï¨ïÅRä™ìï’»°óF²þü*“…¨ä­\˜èÉŠH­’©Œc1x)ñ99e°3Û0£ãªÒ&ÄØ&‚™ˆ„Âò˜ÔãΣ·â•8—:UGø¬FÉ2L›“T¤X4™©#¤ ž@pzâ5¸´œ jrw‘ÿ•Â[/ÒˆRG× j…ÆÈ“JC,·¬4‡ñMÛò‡Çϳ‹kÚ/^B;¡ û¬¡P˜…)Äþ×g?|’ß~Ût(ͱå3ô‚ÃŒ>úkèÑ–g©B<#ûÁ¸±¬Q¬êžeµ¶¯™°i›¶TAÓ™°ŽHôÉu)ßKc6óÉÛËcΈ7rI›sœ.fYˆ¹`É3ꔲ¨Ó¥]j E\yͪÛìÏ\q.)Ñ"ÔÇñù‚¹«‰ÛaŠÆ¥žÅà7$³Äµ Lj]Wh2‘[ìg4ß¾–\WØ©Ênà ªèÿM€³/÷»»mÆ›÷qäÓš{ß /_MYUšnÓW+9¨’Údð(œY«> Ûœ&"IKªÆ0Å:Úo×”@.Çõ¿m°K\&ý…ÿZBÞ¥N§çà|óÙ5ù´FÖÅúãé¥Þešû+>:± M¸ÿ;ÚZC/ýHCY¤Ë´}m¢¥¥,´‡“åË.þLÌœ@±pïbn¥=ýé"¦?ב´åe¶ÖîH#ýL˜÷„E[ ¦/CÊ“!“þ<¹ÓÈœ‘W0!ÔËí—fRâ•ý3?€9"«Ž€ÆÚ¡"ZÔ.0Ú —3´7ýö¼¬¾Çhäè}E%¿Õ8À BG|³fa™Ë¢I m}i€& ŠÕXÉ&süùß#}|õ #Š™Ž)Пq85‰Ukü–ËãŸh¯>Xm¶ÓVq_G쯪o#wS:{£j »P·ÍŒ¶reðNPå%Tä–Jbr«{³æîÈëe°„US&øBæG“*›ªIÚ/øà>> “”¡KW'¦mÙãùX-PÑšÿ-ÛÎŽ,¿o¹ÉBË|xÀ žfÅ-v B#qwFÛ}WYá´ËQÉ•´‚"×ÖS,xÝì¢)ÓØù$´vÔ…6ÒäOë;µÂtòù®¥ýßm\ˆökÖýáçá`ƒ~ "-;AÇ×—ÈpðBßRQ,…YŸìçŽý-ObÙvŽ óXÁ–»(Êòo=ÈÓ+åB§~ò£ÙݯW°Û°äýúK?òóŸ)\vð*&o/G¦ZG5õ5‘NÿEõ⣃ñ @ö,úw)¾UwÃQþÙÌ»W¡R™õùÑ7ɾ =ycz .³¶J¬»*É^»%™\ÚÒ!O”Èž&@u²oÏZ>ÁòM£%¬—JTPú¸»ëHvv†7g#šé_Yƒô„¹ÔÓ½p‰Ó­RVÅdÄC íÍâ~§F¤FUöá9†TObOY¬›ièÔÖ¬kl%Í]Qßh>×àv»Ì-ª;²>íƒTŸƒÒc€“¶ó©¶<$% #Úá¿Ü½ùü ò£6ðö"¨b¦ða©:6 ù %²¿‹æ]iëW>š¯lêdí”ÇOÉèÁ¸D«º™à]l›+ÉX0ƒyb 8rA#vNÖîEtÀÿM£=½>ÅâÝ`|œnVaëøF€@0eP³g쪙‘8Í=ný¶¿í@…Ž‘'šÙÉvê@–…Ù .§[¿ìš’%>ã™eÕ,Ë”fþøQz7£ÿQ¬ßº°Žþ¾Vm)ÿ7Eªx-÷‡fŒå4ÐJZÿ•Ñ;?ôã³ó‹åâòÏb*yw!Ëfxi‡ˆ¾7P#ª^ˆí)ÓE.OÅÞv¯R ƒE+¬XÉé2Å:L'éœKÁ‘€&¨Qƒ™„A ² øàÊÓíŽ0%ßüjÜo/ÑS%·²C» ò*vñÇç =ÆG‡•Ç(¨¸-k5„VieZ…R°¹Ã.ü c×]zv"\ì@ëvá>˜¯³ ÕØy5莧søKHî G>©ði¸4™\=•s+è¶= \‹ôNü%ƒsþùr¿XºÂíJǃL+‘ M²7[õ¡-æ²ûí«¥8»¤ Û’Þ­P߯Dgµ—¯d¬Û]Üê BiîeÜUeåà×H9vvÑ_•æÆ*]ˆÚðK«¯\6ET¾CƲƱ.L 3aêšþŸÊ2Q*Eð’bÍÓ¬ +ùîÖˆ"ØL̨+DŽÁ+tíl<­'ºZm¸JâÞ ^ÃBâó³ÞÇ:]ÙÎö¹>… Û°WaGÔ¢º²—A‚«çY0àJÙ.¹²þ‰týEuB®ÄBæµü^|Dt¾C)=*Ï »úèWŸq‹¬É¸z×.ýy4T›ü­– V1^¬úîއ;G©¢#܉þi¤Ö4’à†Z¢2Ý$>°I¾ªSEà°……Žˆ[xg)€`Ïî|Rad#O½í0ö üЊÃ}ʰ]lIЄ՚\{•Ñг{»ï4êÖ©¢[}•B Ùš:Søcä ƒ8æi%¼0îýJÂüþ•Žây¥'ØüæøõÌ(³sÊìØí;‰hὂZzh1‡”Ûùã®™Äþ©¶µþ±«ßA=„Œ§ézÇuvbað!D¸Å7ÓéáT®µÜO}½ÌÛ.ÏÔ:oÙa½/wöÇ RÉŽ1,í2Ã(%Ô”/æ5‚š·eUŽèϽKp­SÈy&²5tL™ôl±¬þkS±Ô’@3M{xØð†þ³AÓäwb|^7œ1è3WÆ»R0r‚`»1ÒÚòÛïh’×SÓ+õCg €kÛ*÷â<ªë‰ä¾¯T›y@è4ÌFõã¬áÕ3ˆ¾¾7µYzà÷²ÐÌøláàFÁ?ߺ8ïœÉ2hÁë "!Ð ø±ý2)Ñäâ6Z«ª€Ïòpm þ)lr8º²´¯IéºxT“g5c?g°mDE½‘ßø‡›å ¡j¨µeÿ÷‹½‰¹ž|:+8¨ÀtÐyÓcwƒ»QÕ-WÄÙïƒ6ƒÂ$Ì?ãÄÆy2ÞÕô]Z"¦ño“vÄ>¯·ôûÈÚ¢Ú Ð˜­¯˜#{6!³{“ ÎÀàÌZ!îÅÌrádgZR’ÉoŽ0dêf£`TœSG®¼GÃÚånaDÝoè+Û‰Û‹ß,û’õÁ~D¦èUSÐ Öá Ã.G7GîMLƒf¾q›i{‚fç{–m˜&ê­ã&}O`j != lÜч.)Î(KYà‰cƒœsž6}æ/èï§Î³¤LiîœA¢Ë˜7ì÷.8|K$§çbB®í¾þßÒùkLÛUþÞ²ÕsŠYÁa\&]¢½ÙÐ¥ÃI‘ĺp'Ü€?é9+“_,­9ƒseß®]>Iô؃á¾Ú.®ðAÅèá÷£ˆ4‹ %çqPW¼]­»Ÿ ׫OÕ娿GuãˆhÑüh|\ßV8‹©¶ájÈæÎf~<•Òš6ÆÈ%ö Æ|æÿ[”#m‹©Là • ‡úàçÍCÒœÀ6'„13гô½ÓÑSbAèâE d×ç ª/“z©sÂÒ¸ ç.;[d™J°QßåAÀá¯@`¹µ"èØòñLM¤×3RÔ›N‹dïGˆ /±œÿþV2x1‘@#7"ÿ>~š×ÆŒ<¦ý<ÚyÁt§ŽO>++¦ž¢ƒù>Õî*û µCPg9²Ýó$DX×Þ½ZøåIž×YŸë¾¿>x·Á7×;Uó òã4’=oùF†Ÿ’0.<˜+Õ›KÏFtîx×kÁ‰Pžg††±Ï‹DÔ™dí}Ãþ¶Ó6-çoÍÚ±`Y DÞ%ßðcñ)þb›R¬COB¼‹Lß»¡Þ Ò¦aõß䢣ÐOvÅCK)Wæù6ä\j>;xNèŒq*å;U 0}„ó¡s;@Ã}™¸íI …àzÎb©>Öq8¡žtX-ƒ+"›•{¢|¹H·tÄÙôì ëMå«ßv¿eƒ2‘¸/=0œiaãÓ(ÒIG«³#ðÂ^¹áX†M²­ë¶‹Í"ë»Kª×?¶Sõ`œÜfØ÷ª3ª2ÌÀâ"]Þ/ðV#HSydÔúc¢Êr†K¼hrîd.F_Qì$x*ŽpþLÎcŠ rÀÕW@óÕ½Ù7š/ûÅ;Ý¡GáA¦oü)ŒÑñÙ<6¸D1NöGTVbaêȲµR‘ !ñDö)aÎ=:*9FS…ÂÛm¬¶*ßz¡k-ò¨LÛ÷ÞHè<ÙÝìØP?@å3—jļB….Z9ðZÄ”œÔõ8è@¬>Á ‹ }þñ̪-¯ÐeeÐà*Uo#ïÒ¸L[•R„VÚ(ÒG6Î_sÁ0®]CÏÈ>YÖÊ¿¸š¦<Üu*“}s!­¸ Cßr9nŸL€¨›dé1N ë‚ZrPчê`ût2üŽÕféºjV˜ã¶}(ÿùÌ!:4` )Öúº,íx,—ò(ÿº/z3q-:æfoŸÓï­OV[TÚ˜S,™•97V™è®GéØÛpUæÃÁ䓱œë£PÅÀäØé#…VÓÛøWñò­Ì¨ ³˜{°y¨S· ¡Äk­·l{…g—$ïyZ ÈŒä0¥¦–•dÛXfϨU¦·‰G œWÅN<ɳ<åט]€–aÆâ L£‰(°Æ!dýÁM¯Cë(—ÀÅS{ü$uÒ=Ïk{º0±ã¢sÏëç liËØ*â¶oö}?äŠ%¯“4¾n‡È¾ÆeMÃÄi¨õ/¯#Tz H¨0 Ö}fn4yβ›_€ËÈ7“d«õåçZvÅ3¨ñ–íñœƒÿëªïD«ì^>ïA *G"Ó‡"ÂŒ9QfA¥«QÍÝ2ÀJ‹ˆC}âé)Œb?{­¢‹*Õ€éae6 elþ«u-'F¦t'¦ôNóý|ˆŠŒ†,dìU§¤ÌsKø[€È¾ÖLÂEÇŒÌÛùòTù^äŠLj.{Zýˆ0' ÛUþûË{+‘ëOÆ} ] æà«û*^ÎÉÿ‚M£soô$Ü,ùÐzî_åa³·2œ¥ns‚  ŠIëÑžUÿë¶fGRwM©ßÚ˜X¹®ºÙ¤MájÏ£î“r9¼-¯·±‰Š`qæý€îç~)Ò-ƒü„â9À¨4²÷—/RýmŠGÒ>K ´˜;ná‡wS,/kgƒ+KÄ"çJÚJ?E‚f?Ð ï›òÀÙø‡áúT¦”^±ÄgûYZgrepmail-5.3111/t/mailboxes/directory/000755 000765 000024 00000000000 13321551743 020303 5ustar00coppitstaff000000 000000 grepmail-5.3111/t/mailboxes/mailseparators.txt000644 000765 000024 00000013563 12504145755 022102 0ustar00coppitstaff000000 000000 From xxx8x@ares.cs.Virginia.EDU Thu Sep 13 12:30:05 2001 -0400 Return-Path: Received: from cobra.cs.Virginia.EDU (cobra.cs.Virginia.EDU [128.143.137.16]) by ares.cs.Virginia.EDU (8.9.2/8.9.2/UVACS-2000040300) with ESMTP id MAA13111 for ; Thu, 13 Sep 2001 12:30:05 -0400 (EDT) Received: from localhost (bmb5v@localhost) by cobra.cs.Virginia.EDU (8.9.2/8.9.2) with ESMTP id MAA07898 for ; Thu, 13 Sep 2001 12:30:05 -0400 (EDT) X-Authentication-Warning: cobra.cs.Virginia.EDU: xxx8x owned process doing -bs Date: Thu, 13 Sep 2001 12:30:05 -0400 (EDT) From: David Coppit To: Subject: Debugging Compiled Libraries Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: RO X-Status: X-Keywords: X-UID: 193 xxxxx x xxxxxxx x xxxxxx xxxxxxx xxx x xxx xx xxx xxx xxxxxxxx, xx xxxxx xxxxxx xx xxxx xxxxxxx xxx xxxx xxxx xx xxxxxxx. x'x xxxxxx xx xxxxxxx x xxxxx xxxxxxxx xx x xxxxx xxxxx xxxxx xxx xxxxxxx xxx xxx xxxxxxx xxxx xx xx xxxx xx xx xxx xxxxxxx x xxx'x xxx xx xx xxx xx x xxxxxx xxxxx xxxx xx xxxxxxxxx xxxxx xxxxx. xxx xxxxx? xxxxx xxxx xxxx xxxxx xxx xxxxx xxxxxxxxxxxxxxx, xx xxxxx (xxx) xxx-xxxx xxxxx@xxxxxxxx.xxx From david@coppit.org Sat Sep 1 20:58 EDT 2001 Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by ares.cs.Virginia.EDU (8.9.2/8.9.2/UVACS-2000040300) with SMTP id UAA25603 for ; Sat, 1 Sep 2001 20:58:43 -0400 (EDT) Received: from ares.cs.virginia.edu by mail.virginia.edu id aa21233; 1 Sep 2001 20:58 EDT Received: from mamba.cs.Virginia.EDU (mamba.cs.Virginia.EDU [128.143.137.15]) by ares.cs.Virginia.EDU (8.9.2/8.9.2/UVACS-2000040300) with ESMTP id UAA25598; Sat, 1 Sep 2001 20:58:40 -0400 (EDT) Received: from localhost (dwc3q@localhost) by mamba.cs.Virginia.EDU (8.9.2/8.9.2) with ESMTP id UAA17581; Sat, 1 Sep 2001 20:58:38 -0400 (EDT) X-Authentication-Warning: mamba.cs.Virginia.EDU: dwc3q owned process doing -bs Date: Sat, 1 Sep 2001 20:58:38 -0400 (EDT) From: David Coppit X-X-Sender: To: Foo Bar cc: foobar@coppit.org MMDF-Warning: Parse error in original version of preceding line at mail.virginia.edu Subject: Re: To Make an Appointment for assignment checking In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Length: 846 Status: RO X-Status: X-Keywords: X-UID: 25 xx xxx, x xxx xxxx, xxxxxx xx xxxxx: > xx xxx xxxxxx xx xxx xxxx xxxxx, xxx xxxx xxxxx xx xxx xxxxx. > xx xxxx xxxxxxxx xxx xxxxxxxxxxx xx xxxxxxx xxxxxx xxx > xxx xxxxxxx xxx xxxx xxxxxxxx. x xxxxxxx xxxxxxxxxx, xxx xx xxxxx xxxx. xxx xxxx xxxxxxxxx xx xxxx x xxxx xx xxx xxx xxx xxxxxxxxx. xxx xxx xxxx xx xxxx xx xxxxxxx xxxxxxxx xx xxx'x xxxx. xxxx xxx xxx xxxxx xxxx xxxx xxx xx xxxxx. x xxxx xxx (xxxxxxxxxxx) xxxxxxxxx xx xxx xxxxx. xxx'xx xxxx xx xxx xxxx xxxxx xxx xxxx xxxx xx xx xxxxxxxx xx. xxxxx _________________________________________________________________________ xxxxx xxxxxx - xx.x. xxxxxxxxx xxxxx@xxxxxx.xxx xxx xxxxxxxxxx xx xxxxxxxx xxxx://xxxxxx.xxx/ "xxx," xxxx xxxxxx, "xxxxxx xxx xxxxx." xxxxx xxx x xxxx xxxxxxx. "x xxxxxxx," xxxx xxxx, "xxxx xxxx'x xxx xx xxxxx xxxxxxxxxxx xxxxxxxx." From owner-cs650-discussion-fall01@virginia.edu Fri Sep 28 13:34 EDT 2001 Received: from mail.virginia.edu (mail.Virginia.EDU [128.143.2.9]) by ares.cs.Virginia.EDU (8.9.2/8.9.2/UVACS-2000040300) with SMTP id NAA04122; Fri, 28 Sep 2001 13:34:07 -0400 (EDT) Received: from Virginia.EDU by mail.virginia.edu id ab08855; 28 Sep 2001 13:33 EDT Received: from ares.cs.virginia.edu by mail.virginia.edu id ab08851; 28 Sep 2001 13:33 EDT Received: from cobra.cs.Virginia.EDU (cobra.cs.Virginia.EDU [128.143.137.16]) by ares.cs.Virginia.EDU (8.9.2/8.9.2/UVACS-2000040300) with ESMTP id NAA04110; Fri, 28 Sep 2001 13:33:57 -0400 (EDT) Received: from localhost (dwc3q@localhost) by cobra.cs.Virginia.EDU (8.9.2/8.9.2) with ESMTP id NAA01261; Fri, 28 Sep 2001 13:33:57 -0400 (EDT) X-Authentication-Warning: cobra.cs.Virginia.EDU: dwc3q owned process doing -bs Date: Fri, 28 Sep 2001 13:33:57 -0400 (EDT) From: David Coppit X-X-Sender: To: Foo Bar cc: cs650-discussion-fall01@virginia.edu MMDF-Warning: Parse error in original version of preceding line at mail.virginia.edu Subject: Re: where is document In-Reply-To: <023b01c14839$b2f57110$30438f80@cs.virginia.edu> Message-ID: MIME-Version: 1.0 Precedence: bulk Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Length: 840 Status: RO X-Status: X-Keywords: X-UID: 331 xx xxx, xx xxx xxxx, xxxxxxx xxxxx xxxxx: > xx xxx xxxxxxxxxx xxxx, xx xxxx 'xxxx xx xxxxxxxxx xxx xxxxxxxxx xx > xxxxxxx x.x xx xxx xxxxxxxxxxx xxxxxxxxxxxxx, xxxxxxxx xxxxx xx > xxxx...'. xxx xxxxx xx xxx xxxxxxxxxxxxx. xx'x xxxxxx xxxxxxxxx xxxx > xxxx ' xxxxxxxxxxx xxxxxxxxxxxxx' xxxxx. xxxxx xxx xxxx xx > xxxxxxxxxxxxxx. xxx xxxxxx xxxx xx xxx xxx? xxxxxx. xxxx xxx xxxxx xxxx xx xxx xxx. xxx xx-xxxxxxxxxxx xxxxxxxxxxxxx xx xx xxx xx-xxxxxxxxxxx xxxxxxxxxxxx xxxx xxx xxxxxxxx xxxx xx.xxx. xxxxx _________________________________________________________________________ xxxxx xxxxxx - xx.x. xxxxxxxxx xxxxx@xxxxxx.xxx xxx xxxxxxxxxx xx xxxxxxxx xxxx://xxxxxx.xxx/ "xxx," xxxx xxxxxx, "xxxxxx xxx xxxxx." xxxxx xxx x xxxx xxxxxxx. "x xxxxxxx," xxxx xxxx, "xxxx xxxx'x xxx xx xxxxx xxxxxxxxxxx xxxxxxxx." grepmail-5.3111/t/mailboxes/mailarc-1.txt.bz2000644 000765 000024 00000045376 12504145755 021325 0ustar00coppitstaff000000 000000 BZh91AY&SY’õ G.Éÿ€öõÿÿÿÿÿÿÿ¿ÿÿÿ`Zž#]O0ú4ñßW5wß{{W^¹F6µ£y»©:ͺ(è]÷ÛØùóª÷ß7=¼÷›|>ô÷Ûo=£ï}^töç}xs3[·v.­eöïmö÷¾r;sÕÜw¯xw¶óÕkÝïä;@çÞÇmí`×#ªÛí—¯nßW{ßm|ùö÷¾ëÛ½v^«'UÞáè½ÎÞ÷.›ºžú}öŸ¾†ÜóÖ—¯¬Ø÷öÁ¨ø¾ë»Þg^æ½b9õ÷}÷»Ô÷zôÓT^¶¹==ö÷¾Õ}îÕ—k”e÷qÑ|ûÞ< Û·«¯¾ŽžûÞï»Ü{Û{í!ëCç>›îóÛW»oN^Þ¾ùîôw $ 4ÐdÂL™2`˜L&¦Š©©áªz‡¨<§åMM JÈMF©újx2Mê›H‘£i2 h4Ð4 B'¡4Òi”žIí)ú§¨ÌSɦ§¦¦=Fi3Sz(ÈК I¥6MLSShSy‰©å3Õ2= §‰=Fjhi 2F€‰B `&Qˆ CÄ©æ“Éè§©èi©€¦zL“F Fƒ È "A2 €F€Ñ4hdb§´ ¢žÉ&Ôiêh ¹íÜûùC° ºÿHTÝa"!ÖR‚Ü© À pK_¾]³s ÏeV°bAµ(HX€Ÿ³ÚŽ&|_ë@ĸþíü½³ó””ó¹Q ¶{Ø`¶?ý^@ ~¯2ç·ÊÆø;àCÎ#ÏzeJAƒ/Òð°þ¹/ž£ù¦é"‹óÿgèKsïàÒÔ‘PáÌ1xs·ýÿ¡©Ý0KMa`ó.IÉþlûþˆ¨C^¨þŸ‘eÈŠÅÎòG¦>ùë;ÞêmÕOì~Oú!so&ùL‹÷gÈCô8y¤‚œØîvð­ørÿýíPìÆåês–ªy1õz±î•>¶Ž¦×“ì»õüý´©-ÖtÐëc.`¦¦aF ØÂyNØæ“ÚíúV&59×[¡©aN Xâ'£,+oüêz«à©Òáó69ß©(V&ÓCk?›ž~luŒ’Œ•sË‚“†‘í” “š¤Uc2`ñ˜˜ž©îž§Àoyçt߸S¦3©ÒU^a´wYÎDÖªa§§›´ý’m¸'aœaàq‘œgyÛ%ì•xyíf,àÉ“GˆþLÉ„zسÌq¡«L‰¯A²áì '1ÿÊbÕÎräǶô¥ÐlTBã¹w„2j’3Žïæƒû}³Y-cz¦¢§wÕÑEÌbç6Ùüî„SHpCÜDsûƒÖÙ‘’íĽ,Ì~÷Ðç‰ÇùÖ}ü¬~®GÄxîeɹF‰IŸ÷ܰ¥£7ÚÒª½;xègŠ.vc#oƒ‚ý©hîbÆØƒ?ö¶ÃÖèšf§†Xýç³×ýeÿ³VÓOýŸº£FAg9òÐgþ®€Ê3o”£šj¸ª—ˆå`Ñ&ì·M™aMÅPǤJcAƒF Îi55<]¾±¦ÓÜ9ŽÉ‘Q†œîœyÙ†Ê0^‘X™›eoyx¼rËô½p¦M¿bz«¿Y¤t$§õ2›çéšBßï¯%ù_MX…¨~æ=EOŠ,r9^½Þ¨eŠé£‘ý_ý%é“Þ_¤oðΓ„8ÕôߎþïxÏzt9S?ô±•WnÍ Çk×1ãô{gÜgÑÐOyg _~Ò¿gÛ-ÎwìZRÇ[oŠü[÷|ÐçáÄ´¥øÒ]âÏÓ;§šøëËk7ò©¥¿›è"M%Ï•²VžÁ‹‚GÞMü£9(”L.…è4‰ê" ¿ˆ ÷!ÓÍ_ŒùËVúwÅ–§ið¬Ì>QßÑê}y[xÍæ BS& É³a8&ëŽ Ø›NÃÌ.ÍÂe}Üœ+Ø·¬>áIÀ`ÀòaýŽ;çŒØnd«pe1ã}2©?ÌÝ(ßpx »@T¥'5±¬(_$ê¯î­Ô1î ŸFâ²cûµdç?ÖÐñü³"—I…µ‘¹3C»{UqOìþDËÀac`ñ£ô~©Ý¼ZZ‹LÕ40öwú)í~£ñ0E«a¹0ä0DØzÙÙG3k«¡Nãç&M"Ÿ"Îbê§AŽÀÞcµbÏÖ«uY96ÛMFáãÂiI3¹RuîeöZ&vÓ«£ Á³~.NŠ Þ4¡sÇO¨¡ÿp›0qöŽß×Â’ìÐ\‘ï†á쟜BŠ'»Ð}ǢϙžKx?sóÏ^1 Ä-M§>õ=;*j{ºÌ«çcdÜÕ…-3Õ9ô:#²8&ñZz…ñOjáùñ³æÕ¹xðO±›~Ï—o¬rŽ»B›¥+{¼ËåCbñÎìcÜËÜ”Ó:zðŠ=C·ôgÒ3ö?€Ï/(O€Òmì[ƒÈkÓn~µÑÆ º¯¿6~®6­®œŠÌí­¤ÚÜípfv¡ðdL]·€=Õñd Ih•ù?>‡G4d資°kbØÖûÔ2lµ%íþúÛè=Àp;Uè.¾z3Ù˜çX<¾sæç‡K»š+D_oi" ÖÈèkkÜâ«$ÅÈ1oy»ìÐÂñŸiè;{^»%™+°æ×'x>È€|}IKaYVÁÛ,è,î7º‡-Ÿ \çŠeû É’( téÈX·ÓwDî·Ÿä.}™–²Ld_Þùwl§6þ ¹Ò‡^‚Y2º¾)vÏ&HO¸×ˆd DæØõì s%…æfŠ<¾ñ×l塇ƒ¢xeŸ~Y§Ác»%e0d4ÉMCCˆ Æ,åG9¨µn¾pµ†$fÜUßÅ\\0FS¡‘‰­ §°¿ÃÉlá–^e_¢§Ößšopçnã¶=)^/¶‚×[Éús öBÄ?@ÐÛÌ…©œ*z³½ÂÙóŠfJØ©¹SãNëšð¦åSÀ¿Ú1=º¼}ÖúÒ±^ÀŸucËGb÷¬‹‘LjÍTÛÀáMÔï>¤Ñââei m¹ é+èŽLö¦ÀŸŸy`Ž¢”`iºBÿy„.¹JôJù çÁ‰b¶+Ñëé­×´ãʧ6çcOŸã}¨f@FÈF6:ûÂúÄüy}ª©t¸£N4³È‹‘7˱ÜË<ß=ëvg+Ù¼‰U.§&»“p;3¡†¹Ë"¨ÁuC»xwè7"*f’“`Šõ`ÔJ%‘WÕÍCXãNëåù­DLýøoâ ÈúXw6Pêd}i dA3‘„bŽ´ÛIz¶h¤¬ÝØ&q¹O“}dm çW´Xü(c™ÖÛŽµÛ™DBGT§èÛm HÖœž„av[­‘Hºñ2Õ_wDflª=xƒF ôúC‘o4›1HËèd#Ç X/=yí÷C:Ðo–ˆ0ufÄñÁ÷< Ï•<l¬ €u¶mÖKÈm2½M¡Í2@r†¯\¹ÌÖ±RåéVÄ´yœ}ÿ9bsÉé˜qS±¯ìuyC†ƒ¹×§Çm¯»^fÇzEN|U³q<·A~þä1­º.GHµv#Áïø¤ýéU¾g1F?dË(%LuÕyæyŽü'ò^f{òá-SRÅbA~âìá¡pˉr1úXϾáš>Ѐ^åHQ&ýbÆ M‰éTU·9™D˜EôgF^©~µ}¢‘&79>¯\T¹¦½f 1æ±e‡˜‹­_öNÏzÖ3‡Ü¯ Òu凲áXÈÖ4¹Äù‰ÃjFÿv'”ƯpTläút¸t™×{SÒçc¢¬¢@y3C›š %têò™"t¥ªòg]²eX+oŸ8”“ççsÔ¥eѬf[…t®¬…2eªL–™„é±R4ͤ¤©N°åI,êH³æK˜ÿº”JÓ6eÍIÜÜ–jÿ=$(ª•ÒxáŠï¾,Õ¸·(ÙWNY§ ؉XÞz+cNX+2~>»Ë¨ä\ç­ ½å#’Ò´ŒY+à:j³ê^^ŰD“lKGÛ? éØÇRêid ¼>z^[t)4Êm¢xï±<–5S¬¼ì62¤&ž×~æDŽþ#Ï)œÏ!è`®+ÁóqÒq›$zEYœe"x» uIáä¶%vf«‘‚7>¬vÀe½ù#ÓÆ3;º 8h›ƒ—5ç#6Èd×K4(/®vT)Ñ!g”b®«*Ρnh,ømxÍ|Gä"p×ì•(ȉ§·ÏS^’ÒG sø§WÚL² u äŲ™¯ƒÒv§Œ[4”B»¶'¬O ª¯‹3ÈeV5„cî;q*mQ׫®o6Hb¼pìuû±¨E°hϤô¬wTUÞã5ßկͥù6 *ăTˆa¾1¶1¾ï¹H*!@ùZK/舳ï ä:¬IpCÄÀ›þ!Uãám?søË6©HXôÆyŸ,AÓ^F~‡ *vò¤‚ÎÅ0¤¼¥y¡ÄYw õÊD}‚·¶ÓZ ¥G#í“Õ>-zª-抉A£²4DDDDDpl¸¸$ÍÀˆˆâ4> ¼¥²]K%c¸Ü`ÈŸ $Э é+Á6†i'-T…µ7NDSU~ -òç§M4zó múÅH·¦B±†F¶Õ½†½)#cÈogÝ¿ž«§ï[õ¹ã ³Íꮣ¤ Â^[ô¼AŠÆ²[[­“3®»˜ù“å\†b¥ÙÝ¢…kq4~“ ÔŒZ^ašGãætÝ_Ì;ªã'w~_wÃZªÖµ«»½kZ±U_À13Ç!Ã:B‚éžï|33/öœ³ÝÅøûþÇ£ö}°+ù] ´:rƒ,eÛÚîï.ÞÎÊQV”¥ÝéJV½E…hÁ“ˬÎÉbÉ—EXòG ¼w£I'elΡdYuÙž©Øu}±3V?áæHl^©9’ºØèkÓ·\ºihü&zÇ Ý< Áïêùþq‡i‚Ÿ³Õ<Õ¤öÀ‘7á§ëÖ†¿§Svd6² ¥tMÚŸ«qÈœ~„ŒGün¨âðO§‰TxP»l ëo½gÝŸÜbP|äê— W¦B9ì¦Ð„0M¯±}ù2Ye”Ž!ˆyí!Éǯež=œg…ÆAàòð)'žy}AE ~òð*`ÊPËÏ nŸ† øÐcÅA'Ïf9­ìÍy|ÂËÜÀ#Ôco®Ýþ|Ö¥ˆge:ÆŒ–üv³[7ô–gQ~“»›ä%Q•;Ô„{ÎáÍPúúqªåN9×=étd}}\¥· Ô* S÷uPP´õô´•±“÷rié ÍSj×áí2 °ÿ7ãµ#©#TùÍ D—œkÔ »P`P¹ˆØ2ôŒ„ÒŽ„ Öl\#2Šâ»ú ¸à#¼ãŒ ˆcš‹yO9£ìŽé1qcñJóIëcÝú_‡™•c{½Îuì?Ø}Ÿϯ¶d·ú¾ÿÇXç!—Žä,D}~Ä"-qBJ·ò4è½Ë^éÈ„%¿ÅÏEõz“#y'¨ûø¢ªË_´nG¥v!÷»·³#üÇþ ½xçǨ¤¢•s1©ÕÛ¤ˆëƒñÊÊY|òV–Vh"wIy·«…£zÙæârQ8+|¹ X"U—Eä1S¢½ ãZ1•¹´ ?"ùýí¶Ï7ûHp`|³g",³TPS ) i4Y˜Df¡„©~_„<`hÉog|×Þµ0>®Ñï´BïhÖh4ÛgœöÄLÔˆ‰æ5áŸ'rî5wÚuŒ_Õs©Þe‚ÀÀÊl‹0`ÄLJÊ`L+9PɆP©eÈ þH{}PÎÀ7î¤Ò»1HÖ¡„1‰&\§®(Ħܠ  æQxCû÷ÃnòÝ?Æ)³ÖÜë…wŒ½“P„¨ŠÐL^C¹Œ‰­c֦ذk€}ì$œè¯ú®ñ(HƒÝ Åt=ŸÓ±É&‡¤fÝ—R/LÓT ’E‡q@Ý¥”•‚ÖLÈ6„Ü*H•+a(˃Ԡ‘ “Ï&YêH¡OJ"3ÔD˜ fÍ@y’þ E MÚŸy«¤.+¡#÷Œ1„P¹#1FT;ÁÖN4å¡§OÞ£ùí¬è¥Ñ+ŸéúÏæEhÞP*Ä¢L ëJ |Úý~ŽZ¦ª›¾Ö8ëÞ¢¹=ÿLúýj¶á^üÇiφb ¤%r Ÿ¨205Ú‹ì3<(ÉÊÖ}ÏöûžbÅ}/¸l1ì–S±õšHÓuↃÐ…ª<@©B¦¨޲©Þ5[ü’(yާÛÓú„¨ÃôÉé:¢X‘Ø,†‘üÆ%Æq•¨ÐŠÁA/¢ì;%ó•òTU4•¾Å/$ÿÒ+M§¾ûÈð=^Í´¼VØ .&TžSñ”ZP‚TÌšEÏpó¸C¿O7”ááûM_4¸ú¸D „À`G[#;ÔžÙFþ0½¤Ôñ_<ý÷ÿÇä8'Úh­|9ÇXC'ŽüÞþ˜3¢|êV+PKÜŒ_‚}{ÂT”ã"ªÔæV>•žàúD©9£âÙÅÈÙ¶4Ëê`r¿0w§ USf ükët®£ ŠÅD"ÅH *Äå@”` ‚°TV1|mHJÀP P‘I$@H*ÎùY {Œˆ‘‰èw†ý»À3ÃBwHa¶:…âÛ›‚·JдY‡¥˜I³fé³$ý9‚ˆ‘(Sžiøƒ=P‰2„Ö³>ošÔi^ÃV "c ´[(0…wgçi°aØÛòµ“XP{¥¯ ëqÙÑ×?Igð•/õ^ ©ˆþä°ß´½NG$+ Èý? èYÊ€'ºÒ”a…PLl曂WØ|äË‘mQq5÷ÖÕ- ¤Ú #c Ñ#¹ž—*nØA':¸ÅêŒAÛ$àô IvhžO7]ÊY> *ÒÊËP[L(´-¹¥ $ I¾7 •¨—˜2§ˆà¢Nù Þ,Íã@b€ŽYÒLâ-øó”;½ü²â»Ç÷3Ž•8Méd2ÏÍß ÃÊ7DF™ø,Üi¶rØÍô½v°Œ2l—D/ö-UHf¹WVù jD¶+7Ž-‘)–½ÿd-놟Ö÷ÄQ÷¡‘m!a8ãƒÜÒÕKw¥Ñð‡•íÑ1LYõ®V¼áÇWƒ¸ídŠ€áüÓN·Ðr »‚ûv%°Ø`̓ø~ aIs†gvþDpq3§ž™ÇÁ€Aí’æ,/²:Í|FÚ³`R‡ VoðÄ:^|9yŠuÈäÜÉ$.±Ï†koŽr°kÍÞóÐ ²ÞŒšú¨™H%[14„Ñ$Œþè8Lº$f¬€/ÂCasp““f‡¥‡}‹! t°Ê­êªWËËù4»Š^š<§aéé° Š…Ç¬…$f½ا6ÅÍ$­ÝBnªÙh#ò 8½‘ at½Ã-ƒf<éPï²T0ˆ( ‰0ÑDÃß§²úq¢oqòw.3wÍ~“D8‚ð=ÄÑ=2O°Æ2*1GÀ¢ …EˆÈa˜OFÛ ¢Ì³ šn(TÊC 1J1EX"°­„P%G €²Iö퀠¡ˆJ‚È@¬*E5s`( )&ZŠ¢„X(ŠÂ CÑhXÊÔc¸›¡•ÞíC!ÌL8ûE*Áö÷B^‰Ô/~-k¡åCw1¿x‚ÿ‹¹¾Ð|®@P› ¸.t’þÑêâ„'S"ðßaí‚'d}Å·N¨Ë EÄ3ž®Ç”š™pK¼"IU»œJZýöáìÂ¥õ ¡&T¥ÒÞ²ÈñÂhð‹«Ö½Èƒ©04xƒŒ#µp1Ý)øñjL:àW*E€¬ sùdoÁRï6±µsqÛ…Ú öëOû®¢Á’ø«÷CÒÐá©Ê› “7B¯x'ÌH¦ø˜¤œ!0 * Á†%ûì`°ò_±©´Oȇ.19hK&~n'½U¶CôÛ(™lÑ æùYY§W …V´ð+Á(Œ$ epe;NÉ·Ûx5ôâ],̶5?ÞåD¤ôJäËUã#áÄÃÇzôC%ìÛuésc €f*›‡$ážvÍNj u©ßÌ'£?®¡ŠuÁ“r»<¤Ä/ÁáÂv:þšùlS.…h“—2_©ÈmÞy«Ôà±8VŹõ=ÄÏ®7%Ü1žƒÛ`, #éóÉùÃQOWV¢.~ó£GPqÇÏÊ»…9Å5Ý~DEPpFì$ý]„Jï–Ä-0³º ¬“.xÒK¶•I‹}ë¼ÈÁñLŒ«ÖàædžìÃC‘³˜ƒmó°½âLÈíÞ¦²_\c)cv‚÷07šÕìcÅ5R¦bÊûû4e[Cs"£ÑަräÄÃxH¨%ÜòãÀù›9!F*Îø«‹„µ¶È>o÷¦³cÕÄ8áÕM†Â×FÚE˜Å‘Œç3¦m-ë QÍc¨±ÁÈù}$ÐøG޼§³{R×›ƒÐh#L-ØÆ›ÛAO!>v„º¼s¢Í\î^4¼ÈÕ´J‰Or4úžËæà“‘\ô› רýª>§¬uè~¤< &žº’æÀæÖmÐJUç2ó.ÛÝ9éÑDZ`÷½(u+Þ8sœÍŽå¾é½x S³ "ÛÕÙCg9qï„:N›®;iê²ã$ÈÉ(ÞT(h\”h£Ït:‚bÀ€´Þ¦! .5rmé„džÊ{&ˆ1‰¦ÍLB2(Nwúxé·žò´­šÅ)Z¯ë>³íŒÄùÀ>fü^kGb— 4ÿ¢iwŸ³ÚÏÞl £Ý‹ŸÆ}r “dŸ¿sÉó‡÷ €RñlÒmõ€õúÒÜ“ƒ—À:Ai ?á tu°Ú$ò€X—³>ºô+DN€˜ EŠ+î[$Ÿ?2Å‘nØï2øNC\MXT!º ‹ 0ÐGŒ 9^x¢$F‰úvY>ÕD"@‹#"„c–ICC{¤{JØrž„ÅB¹ßÈ•²‡ø{Øl,eƉG1 ò±âQjà´¶@Ô „ ÝÌšãÕNŠTD’NnzIQ€'$q.`¡ìè‘h_<уFäÁ„»~‡¥'s"ôÆãƒ-X!kW@¹Ÿh‡nK† *GïB¡†WLÐcq×4d,v“pܘzŒ†Y‘PË!‰í‹Ñ¡á/ z²™;Bï÷„“»lÐb%v3Žzm¸¼´¶!ó3Ç>B´áap]FðÉZ2ìb¬"0F-m#Z/äjÑÆG1 ³‚ÇN2>õœ Ë]Zæ4œ„(õD.C•Üb[QÓ$^²ä¢æ;rÏÎ×ÌÁ™yàïPmê:sžâT6]°,J‡;<¯ÛmÀ}8pm-IØêîiqÚ“£KûH l-ÐkŠT¨ôTn‰ÍìÇ‘bG RûÓp»ŠÇFéâ‹÷ÃôÆ,ϨA¿;v Ôª ZZÔ,Îû¸·¤ÊoEF$B|ÙÓ!¡€ŒŒF@‹‚6ëÌHÒË$YÞØ^ €z)þ.×ÒÝ'– Á*\âÄ’€£EU!ØbK$ö»‹Þ⟯‰É,B9c$þÎp2aJ/ ~nE‡h±Dqé‚Kyn'y«‡eB*›+3p±6æSÅ^±`”qZ€­ŽFWoK<üéšj §¥rk伯Pƒ>&„Ѭ‡‰¯ŽÒY&|XOÂr”6‡–Ê›Z%‡‘£I ²ÔŸ[Ì{}9hèl-ÙÜ6· å]rútø¼2VÕ­,YG¨¢¦Ww#K’ík”Ñ ¸"kÖ#HŽÄà,·fŽ@B¨œCÒ®ÇBB7ló!YÍ.~%qð²ªö*£‹`ÝFÞó•n‚I´ÒººT”I²±,Pø£ÈS›n'ÒRÁïŠû;hx‰øJSŸ©¥&úZ‘ê(»&¶+Zyvë–P¹™½¤¨0. …¼06ˆ d8’G­Í']~Œª\Á¡ ž\4<û˜u´‘Á=4J}˰4ÓDWx¿B1†¸ 5Âæ€êSuo€u:ù–8{«Å\:¶k¦¹^èBo–{$ Žpl‰Îе*©´«\‘f Ðáðž™mbòÔ©ì0ˆ§ kjâ«–Ë XÆŒ’1¤9.B, =²7ÌVê†!¨4 B*—J'‰©ghßÙ˜|K°†ÈÚ2%©ËkSËÝû‚¢­l5¦\Hµƒú8öÈÐN|¹C—ëdÜXìw#o?ó’Æ·—̲+4LjÑ¢ü¼AyÝ™)§1Sð*$œDÀé;*ºˆïªº®”r¢ ‰ž´ OM¯‰®§¤!=e%BSGÅ;Âú©«ô›åh¹Y’tO÷/ÌttD®J… î°œˆÜïæéc ï?!Z*x¡O”m!T,”•Å °¶´á$ LŠlšÃ¿ð»_Ù‡=œ õ{;7zÑPï Jæ 7âäDb¿6öï²q7Cj‘˜Ï`¯·WÌ]UCj]ðÜb–aKˆ ±¿:<67ƒqï5M°/`ýÈDÇõQ\¤|„1 ÷xCZA7"RI¬Ø”âÊ”,B~£ðì. ð;î‹ÿ2ôDddôùz ?˜Ó6èwpaάdP‹ ˜@ˆpDö#ÄÆŽ\ªNÊ4ÎÕŒ0ÍnÈ…§(råf·#‘½c‹ßcM×=ëxÅë<®:§†±NuS¬BY¢§”®‚í‘yÛb °8ó›7 èã€1¹¨“™Ø8Y¥µ; ËA¼0 @Ûi_ûâ˜b 3u¸,«Í"“ƒBjœ^NÑôz­!ðÂI™nIrÐ4‚B °±Žd9?…PŠìš†0üݱøu– È£˜ ænÛJš—‚yW›¼z9ú¯íâ ŠìhVhã `†p@vcçLu¾Þ-½±EÜóЋâ¬LƒòPåñỂ¯t‹_—7׌¸â2žÙk àõÃê$£ ´*¦[¨)ë>s{xßñÏ‹[¨œ„ ÓE$PRHŒ"ÃïCA:PÎ$IÏÑBŠ(¦BÀ2ì¤"›S,•IË$ý.˜H(ëhð³D,Ë`Ò,"0U &ømšÃ£:~#7M ©Ôަ‰mrºó³ñê©2ÝÖ‚—0ª?ÝôÆ,c7U‚â4ÄɺïÜRý߬ÝOg/Ýîtë{.VúÐüI&Öýê¦|ÀÜ'Ó›‡´lg†=gž 8JZ¶žõ‡£óf›O7ž¼O„‡—ø`žáùmä’ ÈŠP¥ß&óCqÒõ(Œ uÞKâW-ȇp£}hÁj*7³±ä}•;¨g=2¹É¡P :OJÒ˜°<}¦ºuò±g‡ÂÊ&ðô|ôŸÊ‡ºŽ%$á ¦Ë]¬õÏKÜLºžé¡Ö}UUUUUUURzĘßÓ¯8ñ!ê Ô=ûIíÍ#ÊOÅÛ”‚s¸¬JÒ„¥$cd(“ʤƒö9u‡aÜÇ?˜áØlÜœèxEº7®wŠ4ˆ‘ÔAo:ƒQ£(wqû–'µ•Cóƒáä4"Ä%„ˆ”&6Ïz‰Ap|p„}ż:ºï碑.Ÿ<»-c§Q+æIÚ§9™ReÁ0Yí 'ÜF~ÂùÄzãÂÖNÎï%Ž. ˆgšWÒ"8Í^¦ä[%!¢z`ò#¬Úq ¶1Ï”™©ªpE &6r(‚…)/Žþ“¬ EÂMþªî&£Y¼Å a¤ˆ!óœE pq™ lÍ0Ò®:tM-3ÖVz7¸“ÒEiƒ{€Ûð®Özhè–È`¶XÈ(¨c ,Cˆè £ìÜX¢û»Çp‚¨fW6£N€€ïsX4•l\)ù  d(Q™ ;x‚Šg[Ka„²Øôj–€7–ñ0fÌStÚìD`ÄÆ÷D¦æp†âsã­-1 V\0–BLÒ˜Ý|rÍÁ¤¶<}§Åîû§ÐPýí_Ú_On‹Œ›¹ i[±wÕZ’3 Ò²'²¬ÑD¹ä é$I­P¨äÃþ¼F‰@©AÊìñm5|Nïê[`Û]‡á0TÀ7+€ “åšNÐä*vŸŠ~ÞïBé] P`6ä¢aV¦ýg^òXüyNzsÒ3ZK³|qbw;§][%yžÊ|rœÜIk><<š Þ«Èú ´ü`eÁÔ®ÝÑs#Š|~z÷«—O+ì:ºñ¯‰Âá'&4âŠ%h$bD`#!i‘¡b!PB”@A–”ÊL!Âû™°´\Z Ëéò“Zº`]ÝæGÝNòú¨=e^Su²BÅF Õ÷ºÄ9¶-)ãÒ/¨$’')j€× ¹õйjÌ® giªJ¨WU®g vãaIß û{稤Ðà•=Z¶2EbB3{g®DÉB±ý NK;ˆmèVÚ[¾‚ˆªKø™Â ÛBé+"hKð8‚;;:õÍ ã †wŒPbTzñ#QT…ñ0Âz‚óž[c)YCUKσxöU·JT‹÷F‰ ”±C4¨zÑ‚C¹ !-—î 'È"{Ìvo Õ ©´¸Ù6&Õíç7Bãâ1«y†LŽUhöÎ(6ÁT53^Ù“Œ%5fÚ‰sX;Ë CϬ-„«]ýRIã¤OA’û‡¡|6ÆQÅé×±’ÜQB‚±0êJÇhoìªèÐÏŠ$;a…;øüåÎáö¾”¡á¡'Ý­a¸e†q.&ZDH|6XO#&H† åñuR³…Yr¢Ät,÷ü>Ï:ò"]êÐEÙñŸGÑ}¥ÎtèE‡|/X2^ÈŽëKÉDœùž=ê$P‡û¶vöúÈ_ß é-!Â1¢'ÏJôž“úª.µ"<Çt.Õ‹j}KyQL(ÔÅèLÙÌ0»µã¹>Gõ$ôb^ DD#P4¿ŠÔ‚Â+,AÕ”áhPÝ¡P*‹ ù9ö^ೲ*<áÈæ”C€Ð‰§bCh¹#Bfw‡ß 3ksÏÌ=‘«aø÷„ªS”C”N34 D,§hŒ €ÑCƒüBÇÿ4ZB.ÜWÊéŽñUí2¬~pqBlè&p90Db‚áÖÄÄýL†cU+¨¸'Ñ1CÚ`Z#r‡s-æ*jÅ:e@6Ú6Á¾½ÁŠ”ŒÔÓÓ 3BŠ,؆’É£Œà–#P@ŸÊ ‹ì Dw D ògN÷‰ÛÏ×A3®1HhÂÜ…y©h6 íS4Ì Èà4Ï­¶ÛUUUUUU™Ó^µ¡²LJ…tb³Ñ»ÛÁ–sÂë"Ø9)–B–ÜK(ÃJÊ6H-ßÇ8™EŒššÃ¡Æ°rÀJ0FIì¡R bŒFf= Ôå#ûˆ=8‘¼÷NW~$‡âÕ¸%â$!Ä jPh˜Ü‘3gÛ¯¾g ",>AÜÒ–6ÚN붯sÆüéõi i® Ò%ü—µ:ó.I­Í©Šo²‰ó  ‰V{*¸¤I7-p aZÔD•,ÍÀ2ƒÍÇ~†&HšhÃ1ˆÉVj6”OÂ8BD†s©¸V÷9£©·ú¹±î¹@®^zïŠöÏy^æê” hâ‘Ã+>1¬š$Ê©ÈÉŽRÏCA†Àx4)ãI¨€?6—Z-¡í¡~a ï;ª8žwºvÚr›=0 Ðñ†-È¡ýe–ˆÀ}Èq1¿}qïÞ‘!ER¨ñlõ-˜Qð€ÒW‚¥R ãöoò°’\ x€Í¡@qi¢é  ½ «ð…^48tˆ˜OEBñÊ,&H&ëö”ÕBæ©bzÃRtëÂ^㹦P ,A"H"ˆH(¬‰’Ps Ò[€ ˜ö5z¶ÍýšCΑpœ Td‚Á©¢÷²…“hgãë»X-JbøØ_™–G Ω‚‘¼&•Ap õ‰…¢pÀ…°NÖ$Ê1C/ ¹oµ‚3e1:™‚F%ø ã¨ÌÈ£1‚ZClYóµÁ†ˆšš\Í©5× )€ƒ[š“Ëc”ÒÃ2¢_ L Ĩ‰0ô¤™pÀßc—‚”é#»FóÁÉÄ5]qÓ–’!rNÕ¸k\:I ’Šìä†ëÀ¨¶Lô‹A¬ê“yPÀ„ƒ[Úz˜.d10ð%ãhÞg~ô2×NÆ5äæhƒ!•r ôKš›C=w#…zhYŠª¦Rųº÷fãf¤Û{'iÈÈ6ž$8*RZ …è~9q®ŒÍ~ÀyߌžÊ¾´~Ÿ¦‘!딤Òìe‘¢¥*[fòÞV’ª ¤ó6)Ñ2‹W0>ŸS×Ðöþ^ù‰ÉÆrït©°÷‹ïâ›O#PX±Å*íœ=Ø ½+âÙîâËwBF 4™€rÊ;¹³š‚gnHà¦ål÷½Ï,JÐ’ÖR7Höéöã0!* óµî®ÄññâÜÙ‰QÑ/|Hð„›—–ÐXûà¾E¥‘l1ö¯ÊIaùÎÒ8Þî=$×ç¹Ê ÌJ¨E¦š Cäú?V:ÁžUÒSP1´“mˆÖc¸ßÌÍoMà…¬¡©WX'Uʼw¡ß1L“ZsÓö¬?#¡i4Ї•¡¯;<úƒ ù=;;ÉÊŒàú-zí^˜ÊÆ(x`ˆȡ bÌ™«qcE…Á€Æ.1ŒZ…*ƒJÄ*R¸Ž‹Zµ“±Äˆ©„* Q 4K¥È† 0"‹yŠXŒŠCÑrŠA|²˜Û€ ¬÷ƒÜœN¬l£ý£„NÃ-*Œuf<áø³ …„.J¾¥> À#&{sǼJU¾ê"Æ„ᔥ±²6 —-`ba,B˜Àb:ÃÖbºâ R' šGBx†!øŸbù“l -òVàtiRRØâ[ôù¡²O1ŸÅtˆæe464Æ&Ò@Ê”á›ÛÄ€ÕZ» vq¦û_tÎ^×W!”2Þ—u ž±Æ¹GoÙȶb9hsØjÁ¢„¦…––º‰1™i òOE`ü‹ëÒ4êØ~ï€ð«³eZ‹;+KߊHŒ’bW—KŒÈ}t•Œ(M$]3gœ¯dfÔWE†Tög)+¹ßJN¯£Â·PU[|(vpé,¢Es^™0®Ä´0ì®;ºn¨ä†‚Œ±jB1C2DÆÄƒ”ˆè©ª\©i!Õ®æËjfÈ”O‘îOXä/w%m]orŒ«‹¼qÔÖ•s³|[]g:Ý,2…¼eÍ/GĤAŠÂq½å6Öõ¬x[!9ˆ—MDC‘¯ÓûdÀÐ…­m̼cõ¨?/}Ýú_„ˆM® D&'ýSå« ›ð$Fé—äžCÀ¾ Êôw Úæ™1É„‘Ä@‡¡ˆÐä9¸š™4p»{9 EÚ ÀÊÄΞi4Êv(7Ž)"Tá¨tXK Žxágõ Y¦Ôªâ¦Á›Š´z„½ê íî7èô~•Wò°`ŸÚSä>òu ‹‚”ðv$nÒ–­{[÷)ȧNAìŸ$P Ù¸êyêê9 ¿Mð ÖTß7ÝHi³{µbX³‹Á—µëб¥¼@Ðz2Þ’ØÕKDhK€õQ‡hð4Ìf¼Q0qï äÒÈ›]z¡Y( â?KLZš‘™-]Ó ªº=I \¶ÆlqE”‚FHàŠE”)×ñ8'KÓ;9Åçùlà›G¼`Ødm}v5™f+,&c•T…3DÂv$Jæw’kÄ $¿0†*Kdcç ž¢·°×DAŸÓÌþêöuÀyr—®°œêb·¼•Ä%ùÍ+ÁEEBH˜méÞ$+<˽Ø#y1a1«“ 7ƒ0>ul¨â+ƒôb&Ÿ5‡JMŠ¢ˆfÚ»**Õ#y¬qJmÝèŠk K8‘Úv2˜[ š`Rª:=Á°Ô]!š„à’f˜wÄQ,ä $ç"Š'•)f ‚ž§‰Ü“d•lÃ&†@ß, –dz̜œFckÕL:Eæ¹êÆÈfÌ£j‡J $Šd(*ºIJË’EÊj¤æ^d’‰$Þ:ŤjhDX$OªM@Iƒclc†ZF Ándv똕 *LÏ‚ DíˆåÈ>lÃ$ª?$†÷õ¬è ’¡P ¤¨LŸ°çoP>²¾A.ÑA±é™9‘ #J ˆ.»„Äzþ€ºævt‹U]s€í‘~W xQ„g…¬É¹ê‡@u5c‚T@ô¨½¨j"ò‘è€àt7îj­#S;´Âˆâ‚Zø*H˜@£º’…Kû±:#H¬€( !AE‚Á@~ $‡Ö2NÄÒš›ÔPÈ g,E lBvrĪˆ¬òSÆdª¥Œ^FC$nf󑬑$Ùƒ§@pBŒAíQãg89"q†s0RÖ­)µ6žÁ ÷ÎÉò)Ë) è*Úh„ˆÈKQÕ“*è ÞÓ‚¢½2ö²$Xëªð0£J³…I.ÅØ ñ^_r[ò„0\Û" ßĘgÃ9`Æ\M„û§s; bK°)Q˜–á4”¯©µý eÀue$Ø›[£•u¬Á×òËI¸fÎЈ‡GåÙT[âù€I ýDB°43@×λ²Jªb@HEløgAšµÌtÔ:¦¤¾ôüîcFSh´Ô/…^Q ãGàé 0ƒúÏÃÊø7ÃVêÉ0*×â×Á¦–fÆúÝÇ’âH:Æ ƒCýd„äŽÅtI-¦¢º8³C=€a— ÀãN+p…E¡•2‰\lV¶Kºˆ&7™° KyâZ ¢49Q’%ê6µ¨4/¶Ÿƒ’±=,8…*©ÚC¾ ÆÓºì¸ÑÜŽ3ˆ8¯CLcép4(VùŠ`bϳIÌúŒ™!Cè7b$‘kª_§Óñáø”œé,.HÐrØ…ñ¯BYQL`JgK_:ëQ Îgïm8L’ç]ÆàÈ~“r[µ-ñÙü"ÄrnëdéòË’Êa+Œ%„Š;ª&¢Wu@y|½˜D¨^áŒI <).ÍÛ6Œö"ÀFSàœ*°›*¿@,‡¯ D‹:( ŒúšÅ0…¡ed2`aŽ“ë7nÎLjNh|¾å¦&ǼlFµ`{Û#"lŽÖSA.ùØí^#m±\¦ü܉Ïoøäæ¡óýT“ÆÏžõÏ)pCƒ$û{Æœ$h&c Uã§v1Ü3“\ Å’T¤öL›tü•3z礠“”pp‚Uî7 è~Ù®G*¢”öÙýµ¼^÷k彦·–¤Z+[sà…¸JàÈK´ynpßtœVÏß»Æj\o”Ü·ºI3>°é$(*Qª®9: Y‰’N¯±¾ÅÙÐp¦š#FÚ!4dý­kYjû¯8 ÁµAæ»Ns(n £ÔÏPs Ų„\a2A®q¡›_”4jç‡få4! rý¼YƒŒ»3øüUM2„±Éצ³‚ëLh•’50)ì ¶‹@¤ ‹Â׉w3¹^>‘Ñkâ>ôúÞg°¡/KN5É!1HRÜ»ŠƒÚ°&ä¤*g qsÇ ùç¼iûl?f˜@xk›È›6­N›Ò]Õx‚énܱHw'=Ó%Ku¯°ì"CQ#àP(?)(ÉV(#åÓöÉd<Àø»’)„„—¨j8grepmail-5.3111/t/mailboxes/mailarc-1.txt.lz000644 000765 000024 00000042040 12504156016 021226 0ustar00coppitstaff000000 000000 LZIP#‰æöàÉ©÷óÓ0]f¼YÎËòàÌ”¯¸¸dÞ«z…Ìá"®ïÓpªpkJÇh½*òÉq"߀‹ëi"ÎlAT±ƧãûÇñ+ѲPQÆi£MÜ«*u7 ER¡WaS¥rä'2¥$Çé0›¾ŒDVÆ÷>ÊØÖÍ8?’GÒšöÊbè@=>½äþF°ÿU±IÀ—R·,í݆èÊþÿ­"ò±v·OÌd¶JW qPF “ÝÏD’æ"£4¸H )­ƒ8ƫȫ?k´PoŠËöî~¤D_6 œSð"1¾#ƒÎè Ÿx£ƒ&H½VÍ©:±yÐjOdô—rƒy~4fEŸ›7ã‘6è‡b«–¸?ÀªYASK{)lb#Þ¡H³}ƒ¡î\&Jç@“U'^¶õ o¹qÌÆ®›‡±¤Šu1BDžýÇõ¤Âã¿ÁWŽËö#EdõÈXXô±ØÔsîþ±Èý]·Yáÿ¨Ý/+%sYŠ!qŠÄ Õäö!gʼ¹K8§àÞÂÁ°Á7“a|­ÐÆX7–%Að™Q1w® o‰è»LªÌÒtæV1 p»©ˆ·‡Q«XéRú%tv PŠ“‚‘{1ùoìß 5Š">µï÷ ðÈ£r§q”jZZurvhè›Ý{e*‘–Gõjˆ@¹ ™Å—`'2BS²ÒY"âV)ÀâEàã7‚Cbt|%iÁ)xÁËJ8x?E-+µ^íC6š#¤½v´7cý„~³Ÿ€‹Ðîʧ 3ÿ0A´r˜éeNc”u¥61vuF\¹`JwrÅìÿ-¢À"$;þëåWÄk-ë¹cü¤žnãÉ^YüwyMÆÙ†±Ë ñgØþ‡ŸM8h´ø äR x]–Ø{õä#h|‹Œ¶ÖìE:ÉÔÜÐ*ëk.4ü’˜:²u?À4­\â$øsOÙX-°y­Õ‡aB wy!,2 ¾DGÖ×ÛÞ¡àùÆÝÙCÇví%ö/ñdo¬,ÆŸò<ȹ ,jiN,d™,šêU¯HòPƒŽ¼Op_ZÚBD¨ú½`áÖæÎ}.P§Æ¶ÿoµØ X ç6fñ\¿>œÎñt‚‘<kÏ'ÆPáu†&WVœ+\ú={ awÑøòÙw­OõT­ó˜Ó¡@[' è"î§0JíA-Ùèÿ°ÝùÔQL(ñ3/éP»‡PeV2Šô}›¤|ÜÍ"Vê¼gB)‚“· y47ÑJÓè^­ØaÑH0n(Ÿ\TÏbó8T;øF¹ÑËvq}>“áCgl, ¾¾:òk`{8­*‘_ÓÁ™ƒÈþ¿M†!Ïèò·³]qθp8¾Ço—ÉæËëðAêö%‚Fðñ“ËŠ¢™biº¢|^ÞW†«ˆ4(Úy¢þêÅêÞE#jn6P+mîÞÀ¼G£+j'?-x±âªÄÈ„»¢1aOŒÔ8®Â¸I+ûÍq)SÈï#kBGé¤ÉÉÎ7Žá ‘Mq€ r!Š{믡M»{¬‘‡ØSG—aÛgBn¢ÖbD8_u0‡»˜E#ÁVA¯4R¹ßû:ÏÝ1õŽ Çl¶Ø3" Z²Z´JVœ*:.§wó˜í–0dVpsÆYãR•ûÊ^gåã[S>]WC+ k=q¸Ò.hUIkq:Ð/ö„HEtm‹R´Ë4%RæùæW³9»š¡ˆUÜ¥Q=, ¼¨JáôYb ¾> o‡›ê>ü à^ã$WJ…{À¦…[— ³nH¼Ý¡Yç‘¿ë'vvD›Rr4l!ëýÞÕŠ¼øôûq£ww‹BU¦÷¸4*á¾Ø[‡F2Œ±ÄsìØâ¿†o+ö—´‚NwKo¿DÇ¡NíÄ\Ÿ:ÃQòŸ~ÜhÅGÊÑœg·ìx‹¶^c  É^oÀ]ˆdÅ3)0.¢b@Ð&Ùž£™§E`G‰¥Z)z)³p—'ÌÀz˜@)ý+?‚Ÿ?íÇÓ³Ûp»'½»Mà„î bBÁM´ì ’“þtŒ(«[¹Áû»ú½^WI¶ºù™¥¶„Ї®ŠêÐõ½§•uZ%û o¶½O?Ë"ˉÒ!Å"€­:›[:£Ã„Ô‹º0Mçêúý'÷ì‘[A°r*t”žQïDW§Ò—•hx¥(UmA(·¼zÓ;o¼ íúx%ÕBlªÆ z¤@I %”¸Ÿ¸ @iÜð`}ac‚îÉŠ|“/˜;[GBÔú9AXºnt§‚3 n5\)äYIN{`€3¬ü]ýR7iÿCæ @§ëS•H‰ÄöKª|O9ùDÉù¦Eˆ²†óm^ 㘺hI y?µ¨ÉÙ0V 6@ɽ[3AªµŸâ¸l{Ÿ¥,…²À÷èpþkµÓ{'kD™;™“ó½ñ»0ûŽº—ñö´…¾µ—ûâµ 4¨›k×#-f´’Noý‡×OÜÈÏç©_n¹®×£%/<†©.>Ä„gÖá¬Æè1cèL«6Æm{6)%Á$”^uá ¤Z¦€ë¶I3z8„°àâÕ=ÁX(wù=:lókn­69cœ—ªEqË…‹;Bø:e¸ÛRès‡OçÐå™qLŠlk_ GŽäñŠG›g@ô"¼ ±Ö¼ÉR¬òæ–´é'ÊmªGÌLhD–PÎ5œBQk1¯«U‚™®À2;Å–lu†€÷Þx¥h6zoi1KƒÆ¨ÓÂaQ¼~žf˜Á¼ÀB»9:ÇßãKö zA£WÂÝå„Ë#a@60YÉJs‹|b"½¤¼.ŒìÀN%y–îÜ Ù1°WUÛù+N“€©¯ó‚Þz ¯¨Áå®?/œÖÈ.Šš§ÐY“¤‘¾<7&nŽgg„zØä|P›§?Þ>Ý Þ§Ý~šit05‹<‘Ä|õOýƒŒþA ÈžFß{"™c‡´4wHWWÀ¬f±ÛƘƒß“¹6Z߃ñj Šœ´ø6²*ZF]®ÿà¥õŒî7ßrík05ı?)âmôŠ'|Z±i8Mæ)åuß¼Cÿtùÿ[ÌÌ<šq¿ŸÏ¬·ïOM˜«/ȳ´Ý°Ÿã÷ÞH½DNηõ˜”5a0‰…r¶ÐgU ™öö¦a¤Æ##‚²çºå+]2NAÀRRî®ÎØÐlÚåÉAóí\B€7&~)©Ãª´ð¨Í„€mÙJ¼Îºf¤9 mº› J^˜›¡mdæNþæ:â­QŸþ èµï%éBô'ŸŒ^ác¹‚Ž K•WVr°GÔIíÆ´9bº78-±?±ƒG“Ï.ß©ó^1m#“ljcÞìO@à–€÷ÉÝ8Ï€-`P‘ëqø‘%šôažú¹Ù—äÎï3#mñ¥Í„£4Ë8‚ôÕçØ@Ð̼ƒË!µÿdª­ìŸÄÍüw:œôF©¹3äëÔš7Â&«-†Å¾;Ae_¦õmla8¦ >D ‘àŒJé·Åêfr/ïLj+×›ºK×ü~ürf§–¡<‘$™ºîÑH2ô&)€C|}ivð£ìù+úš\ü‹Å•b¿ç³þk†KÀE !tƒ?œª0•òηå¤WÒžŽW]Š'å}~ùmxdű–ˆƒuÌØðJbÕG5›¢oÙ/D’ÑDÛôW½˜n:¹pSÏ‚Cµ%/&ÊA …ÍA-€šŠ& ¾éôy7#êuÔßnȇvl ;LýV•Pž+¸œW…tø¼ßÞ¼©¸ãÙgaR ž&v 'x­öþ™CMZ7çó‹F+âuCT«Ý;°tâĤ°Ÿloäº,½µKÞä‹$h>/$”lqº^b¹¼À¿…ð•£2a®:Ñ„=ÊDì¾ô¿cgß19TÚf«Tcj7=aÄ¡îàR&ç{I¢^:·CR} ë^W´¶Ð§´‡€¾‹U®–ä`‚³å„sâ³+=wÍ[ØÁÜ VÏ,ãfg ó¨c>C==¸…±5$*‘3ÐçÎêÿ£°Ma>‘áDN§lE½’ïûÛ·\Û•¸:¡îÑ©™U?ª4[ËΠȈÀ7:xÌV&ÎÇòpðdzñÜpì¯ ‡†‹‰ÕåØ<öÊ"SŒÚ›Ö)ØW–° üvË¢žü·²@zþ111èûçôGuf=ã§‘céXuöñ¹«b×0.²õαsŰÄ|‰žØôL±ÊƱ¢}Û¥Z>FµH2õ•éÞ¾[FÄM "OÝ<›O=óŒÉ}Twü&ÚþxÚù ÖlU#ƒá°—-¡5ªXRJV¿Q•åËsðÄ5mÅã›À¸ËòÂìR –µÒ–ƽGOi]4¿/–"Ý×sk£üfÞìSéå>ˆþ6¶÷•<º›†6ÆÜømœóÁ÷Ǹ“-ž@û›!YRaëÂoSÉKÔO·>ŽÆiRÎCÄr/èùlåè›?®î–SCÐ<ÒÈ2¸@¨K %?¸™ÁhCnOe„d,+âÈ^Ym“4å`R¢x‡Ápà±™gqúeH퇉·åyÒqšÕgâêóó.Nôù%V?y©w›€‰–‡£š¸Rh^¨´¯Æ6°Ü`nmNð}J_‚\¾(S=K1˜È•O,³Ð±g'o Ç‹]n3¶®Mv“€ûãÖ³‰BzØbg˜:½ß†ñ†Êºzp³•¬I?ºøó2~ í¢~Ò*b«½‚É«1Ã>Ém¤ÀØ,ù8ž@&jµ®¼ô‰ºÆ§u>F®`‰µ¥ýœÆ*Mƒ œrŸ?°®TÑSµÉTHžÛ\õ/¹Í!h,j—‘YÑ+ÅÌ~u£ ›÷nkÞî7 ×_ ¹Ž•·¼KZ ñnŒ ÙöJ!V^îØ·ýÚÓË,êMÐY®R&ÉîMbXoh×ÿ÷ÌïQö6Êʹ«¦Xá8w^Ï4¯Ÿ¸•_â"¥è4$W™ü°c¸1•mz¹û¡g*€û0ôÜtGv{n#ÊÎÓµ·Ìo¸‚zçd¢%ØÖG³det»ŸÿòZ¡ëiýòÁ:·²ƒ K3ÙÃE¼Ø+­qŸ…Jüä3Ó²nÂÓ{ÊKöÎif¯lCåN[©dŸ^5–’·wár {Ð,.°w‚ áO¹ÎºB‘Yú,“êI–ªeosÖóœ“Æéÿ>iAò‰ì»GŸM2¶*e¸I2bhÇQ–ãÍŒ]È ,ìMù‰.eÂrOƒx:ëx‘ªJ0›˱ñ-·Üö^ÜÁš`|Š_]‡àÆ Ï|¬¢÷«Å£ºÙ÷.'t:~òþ±ÍèýE€šë†_åJµ¤@¶í;Î1±þH˜RVcvºªùÐ\ÊDM‚'žÔ’nJ{rËD@3UçâR²“ëg Çáƒôð]Ñ•zoè‡sËæ“…„“/.–’ÒdßÈÝóÂø¬ž( ¡Y™‰‘‰—ˈ$à´…X¡^õ/ŽÀG*ŽÅSs£ŽwŠTBPêš&É.Ës9„s2ãYóâ_Óy7òÛÇS,ÏœÓ1éÙj5ó ²`ÏuÝkÑh«SËî}žX‚õÖíñ&ÒÂRÚ§â\O¯íCt}69„Ö3½‚hIN΀×>)³ UËÛìœM®éXB-mü¢¯ö™{16Ÿ’ר7SIu ‡é໳´¨õ²ÅÙë&s™ãþãÃ\ècu— ×MDZ³œEé³ûËvÅ×ôiêDJåaøB:“Öi;ú†Ø“UBï'T§lZj†x¨<•RDRVËî9Þ‡åÍN>h˜ŠÖÕ÷Iµ($/•c,ƙ޶oJ€Ö·÷u\m“Ox#Æ=w]ÜYz¦Ð6òK‘%þ”œ…EV°"¤ÞeÈzÖ WÚ›XÓt¡xçqïðY)m¨Ä.Ío©ò¯ +‹kýlWäZ¾‡SDºTÓžwMw‹‹ ¾ä(R (wÙ©;s;ïògågÓµB÷AJ®¨u0ý‡Q±õMr‚“†sþ±9tM¤m{Õçsð†¾n¼­Å“‡¾¨Ï#ØsIÙ˜PÊþŽŽ=¶3Ì#mÿÖîqå$þ¢ §³ßÊÀÔ†áõrDZ‘×€óÕ5ÆÜÿè^lõ}$…š"|-Aê0Â¥Ê[Ñ9é[ˆ}4`€áÞPþ©z ¸4’ú´ÅʱJ_KH }¼¹lçÔ¾ye,$$k}…ýáPë«Wàè2>zAûÎì9~¼Ì]4–Ãs¦ ¾$Uµ¥ËvàèâÏH3ÙÒÞ¥ÿÙŒŸ[~•JÍÁ5ˆ2„&FLÒùf©CM0aшÕt2;GY ¡¹ûÖûÿòíèØV»1‹·ˆ!iåG-‡µÛ+HWåâbÝ­vü*¬'Gù›­«S5JϺ‰Ù¼è4ª|æ%½aŽøvôåÒȦä-~‚¨„ßÄãÙ&Öx°­v{\ÑN`ÚQ8–ƒ€ ›B@4eªv€ò™¨tÍL<7ÑÀ7‘} _:O2ß6ñÙ6ÄwÅQÄ8¨p":ûÚÛ MTξçmù™¤ ƒêÿ RÊkÓíiä â‚_–Íp=/ðþÅk(ü¦mÊ©™ƒÝéµ2­Ö¶…Ãç¯Ëà7z3bZ#!ð¹æP¡eˆ>°MÆü ñáNÊ-ÜtVKE†(8~‚dÊmøÑ'nÀÛ?cÖN1sDð@@2M òš¥']išohó/Pñ»H4 skí…&–jØ—€¥Y+“⢻\ÇPÅ-hW8ðq[i‡ÌïbÓ®1з‰=¼›{–¾Çe¢ºŸ»!èóàY«ô ƒßsV–|,ÁæP¤âFýü×NÃâ0xOÈ)|L¶‹ò峟‹¦%¶öá†{i?Ú߉$cÜ|;ömÁ,O2_‰Á¼ù¯¼¿Ã²fÂG{`ZÂúºÈúd+/õŽÍMMp;@cŒA-Þ@Ò⹓äÊÆj7úFf,ϯúø0ãm[|ïNvÏÜ.ëAÚ5´´>½{óuê¢Jz‹5,¹L¸—©5¿1»Ö’sÊw¸l·ƒz•ÏJ°Ät`gz@Awö~5bØf›¶0j#»H5/ž¶?Ý[~qd/þ_¡€i®JDRl"Õ(Ì©TPE ^Í?'×,ðHÆÍ{ú©¹{¹ yºl±ý¯ô¥LÈ1eê „òÿiæÊY ô€Û:…Ì4„¨ý ×ÞrÎŽ´õ®«O õU>ƒÁóµOJÃÎÆwG-Z}iB§’0”Ù½½ÂYo}N•*”‚»ààæ’XÀµ¾g úM ®f’mÿŽÔÙ}g1á„kï…F䨣›”V²O#ñ;;@g¨øíøàŸ†S†átê„Ý«ãQ‹PX„ £N“]÷Ñþ߉2Üù¸¥,r—QcŽ:×–R@ÈpäI)À_c‡Ú¢­‰¸õî éð„»Ò­¦®¤‰ñ3âí¾‰u)½‡œô Ò„o¼Ñ\¸éfŽð-‚sÒ8¾Ø¼ëNG9÷¹ˆTþˆ3½;-Z1(…Œ`ð¤å1+\_¨å ÷¬ÒwN™ù¾ÁI Çr=b²±˜TN$ÄÀ’Ë»ýdzauvÂÀßÀ. j“¾c<šùÚÉËÞ]ˆæ÷MÓÊ{Xõ¬˜‚;bBá»ÀÛjýãl…çXøjÀL?yÍ"Sê=þéσÁÚð쀲«¼ ÍÈ$¹ç~ôÀWî_/ˆˆQ‘#h¼ø W³©›ÀÖª}ò*å©,³üÂü–äDÕë@åü¾UHç~gà¯Q:Óºr±× œ1ùï™NIœs­›fG˜%y&º¨¿žÁÎÐ4Bw±(Py®ÝÖó8¯{*q^ t—ßT‚‹Á\»Ža‹Ö]AnªêJªöë^û5PœÄš ©>Hò8úf¦Ï©MV~eR—²ºSBYÒ€^¹ÿ0·ÊÕ¿¹¼UVÓ‘{ÛÀ‹oa6`1‰×¾oÉc P XøÚ‹xËøayØ Yš‰òL”bº‚®(>Âךæ:ºSÚòcÅ?õÈÀ!5»í ×äÉ„ _¡©Óï.> &m<¼*`øØ–ûV¹q$ñ’¢É] _£ißàHfÁyÍÐ4ŸÎ—*Vzk{±5÷\?ÈxÆg~½5yß¿ãÑÓ m­¡;r¼GRù’€© lu> ’p€¹Õ)BÌ5m»ËÍÅü„tÞV‹mh ø -ɵQÃÞ¸ÿ*ÚÀÿëÖÀBåg"äœç¡@óûÕÈ|ÙÎz  åYTßwY‡VYöfAñÖ̦ð”GèºÐnq³ýcwp¶[jߦ&iõ0rÅd÷h“|õïÛì_ P¶ª7l„Yù9·†`Tno\*ÊöôŠ]¶H)9ã™ì[Cs/Äù(lµßÙEœó\w&Ëê}Ü•0c`9æø&IUXR¶.²ÐŸ ø÷1À¨%ª)s»vÍinPÆîÌøjvºŒòô…9—4På’ma¤8Óǧ.ÎV¿¯ÕÆûq< ˆÝ¶j¾9nÍ ÀÂDµpIoçœ#ªÞ èÞ©yÁǨå¸PçÏ+Àa‡‰¦Ó$C"ÂQÛaj‘DšU¹Mõ]ˆ’ìAžYu§MÔššƒ.:çuoRÂKkEï|ÙeH;yÚ«÷'åknwµ”žu{à ÿÔ¶¸=Ǧ+ä¬îYîÒüˆ²¤¢´FƒA¨m[ß}X8W¿©­åȴ뇪” ?Œ¢H‡_ONÒ±Ì|:´f3àZ0?±ͼ{ZÜòa~¬+ó‡]‚&®â¤þÑçä™ i Õò¸D~ጯ?ÄŽ1އøIƒ5ð¹•#š,AçάúKyÇH¨†4)²yHǪ8yò-¥ëkK¨[«I—/G8™:q¢w•³Ù¿DƒöH¬°.x†…¹;˹SK!Üï7!…Ç`²Åi*Á¹3V:Áç²µtìa›ž"Cÿé@–(+ EÞcÏ=YùõÁ™0R²,Í"?Uá‘tï'’Uò³êÇNXÌg({U‡S†±wÅ®“äÓ¡R¢ƒÎÄÙ¸YŒ(Õ8[7óáASTyT® gLfIæÕÄ·ÀYHÊpd)yäß A\uBŠí"ìÁý#³78)•7¯,¡4Üt®#€/f¸i3¦”`Èë¬TÐþ ºÓ_z¢[™Ö¬§Îh%é>e|¹Í#¥YeRíY¦?âÔIÐËÖ£¢ö^,ØÃ³¼‚Ê­g“Ú…égˆ®|ÌçÍœ»¾ÿÖ™£u/¦Äû*Q¢Ñ\Ä•pg¯÷¼¸Í²F\¥\µ}^Bà êhBõÃeܽ\ç½ó‘ -Uµ#äü«mÞ<ü €+•W½“パ­¥úey:&? ™üP½Î"+?•÷\wh^\Õ˜ôÅ:ÆÕÞ OÑÊoϪPô»gèëËùô·œá­%Š6–QYî‹—¯P¥v­]舄:rI}?X!|{PʨÕ<³e >zÚÕ±îßvg'ê¿ñ·ñ—M˜½Þ"1]÷Qa[Ó†QÙÂúÜ|OžzÿÁÇ,ÃlœòºLŽ®µ^pÑ1«=á¯æe‚°o×XIÊg¡?åú.bÑ—‰ŠÚ¸ûÓj?Z€öZGÁñø¨Ç5³†‹>RFÓÏŽWž)ÑÂn„¿ã£ÙuSXKW§=ïrÆXcñ¾û“ÐNQ¹Ç‡GÃÜÞÞçjbå¢Ã0J2ó¢Ñ%Û%Û2ôeãÖ2ݳ¢Ÿ€·…Ñx’o9m$9‡-Mi4§…%üлX'„öYl9Z7Õd¬fÔêÔ[nšo!@÷qÒ’y™C4Q·4+½SD’¹ƒã8 &bæ*ª6GÚ%F€«µd¼·Û8Q¿¦CõR§ tÝ+çÆ€«{"N(=æ#*Ì>¢O0$ÙÊ÷ãðG´‹[r¹§²Ây¶²™å²m_Y‚°vž‰@/¼kQ‚Õ/Ñå™´Ã-v¢Ûâ§wà$•¬ºZ+'ì®%|òøF•“hÔPïL‰µüºü$Ï (]¨Lt\±éÂU.Žã~­:¶Èö”o µìGmß%‰Ö,ÒhÛoB2¸š™sfq¤6n{y½kºÒÊM  zÖ“÷¸µ™'ìo•;CÉ#ßg#ìć>â)ÉÎBÐcÎXÁô¢]Ìò§ *ç®âÈÃVa¿@©¯ôV :]϶üÜòõË©™{~âã?†ñ†Ç%úö õÔi‡€ŠpU››OÔ¾hò“ &Ý×^+wØ5€wÞÝo #èIEùW\Lé‡Òv[”nµM´ð‹ªÌÜKEø¾ìA¤º±Evƽt¬ý ˜)cC¢P7¸,–•'nO®Öfü€ì>m§`²,䪬7󤿫H,ùsu.™ù%Ì5ƒ’厅”bz¿³BÙV!õr÷Òtôäá\áÜFÌä`L|§b»è·ü,Ͳ“Ng¦²¿“jWÌ ®›ëE™OÅY@ón’º#j]ß*''NÑ-ÓÏF´  n—gk,$˜æÍvË@Žú/T‚Ó†‚,³5LúyÎ_…uæHwPViÑÖ?­4 Ü#½²cj× 8þ\ÖË…8Ë ±¢Y´xÆS/Sj®‚@oÆ=ö0(¶Ç2;×K'ÐPþvâ ßdet•îRbç뻈"–È­mð|@Èòvý$æzužÇ»"’ÍmÂéE¬[Èi10,胭­ {'Îg¨è²aÓ†¿k§ªm…¬wý'2‘¿— E•Õ ;¢©(vóýU©?ÄúÀºçf…#å?X¬ãGâB= ›Ôû»i@»Q„á©Úæ=Áh É›B§Ü¶óø‚òÄG½òÃÖóßkÒ}˜ Z[o7Ö®õEÃA#õšPµpÙÇ©Zm±be›­F¹ßIíœ?{¤>G˜ÁÊ)føüò±`ÆÄèû’¾¿úŒ\ˆ[a‹4ÉÜ5tÂm‹7Rò£õjPuªÚ慌ĎO„ÍÊ™òw¢cû~‡{öôå¢Zòm( hRºZÎÂJöHcM’°ìßµô2@ÛîvÐÕ¦XæÏŸ“Û}ßÈrçþh9EÐUC—F™8Çš¸Tg+óLag…t—xU¿ží—Ñ®ÇÒ8‰<…í Þìݨ•ÈÐ=ZÐQžwë?'ê´Š²­ó% fwùTÞ©XÎL©l®–è ¼4&¿v3ÚlªcêÓ[¸œš ß}ÙÙR ëß cu²°ð™/ë`£2"¡±J<ëk¦ÄPf'߈½èÜ÷¡’Õx}öP‚ÒÚ®“]R¿\¬­3/X ÁY±”Ÿ5^÷ˇ¹/leÜCì_ï§ØÞvaj_ªÝ £x–" N.éú9PG·¼ZѪÌ0eD¶ÿoS'„¼‘zA§^˜B{À¤ù•';’dtó|t€;­(L÷F9uÈ2ý–ºZJÆÂÂÁYàn'¾=⛪E¼"€¾:ªì_Nä ¶–Ÿ[¶¾² 蕉!†xF~c‰ÍóÈãß×ON<Øîêf1uK¯½"ïGÐÆ:“¤¼‡¹)PN#â·]Îï('õ´ÓáÚÄO;V ’«qY±4<ÏëóIDñ· è.5x…CÆãPÛ ’úqûàNI盽 o+mˆâtöãÊoYn¶Uå¬Jøq†ƒ+ óPxGî½¥‡*;#k§V5-ãv%gÀìÿ¯ºÃ†wæè‰^·Î}´ îìDìé}W}¸à¡dšŸ<|™2•hú² “‰UUšÝ…Lý÷R¿O«X„ ÈWžž@winDÙÑ*¦¿;cˆoVÑA8ß*Qè:ô&¬§’ë¯AªðŽˆð›Ò Bê ú#u¦JÓy'°‰É}µÿqº¿:HqÒPUÐ'›êD¬^ï¯2µôãw ‹ØÂчۑ×'‚˜^¹xíxùa2o\­\½­ÒˆÀÍÏ,ÝÅyg¢–€µå)ÓÒ,˜² ñœÁøcKi˜²% ÅàèÞ) -Ô^K3Mˆ¬sìâÒo–´Åbjp!¡eî+zWýaÈvý«î“9ÉC¶ÓÉOÿ/kI•7ßܨÊe©ŽÿýÎ ÜÞÒÇFz8ÊS ‡ƒrmNÜþ€«)ƒµZ£¾‡9êAxs”|Ž(‘‘³&–£²jÌr)7F¸•cƒ‡p ¬cÃ(>4ùí$ڃ׺Zõƒ8Ãí&»Tz¹]l\úå_l†Ð‡¯×1Ã…µ°k¡¥÷¿‚g-ÖkÙ³-(5,¶ô=¶éÜú¢±>pµ•Õ³,ê· ýw³iw`zÿ+y ¯E¦ _šû&‚rÈ ˜ºIÑ_¸ˆâ”L¦ ^‹â4­ÚŸ»£„Dœæì¦KU×GW /ùB $÷vc/@Ϙ¢]Úì#Àç¢Lè@ºs£UR@Ô0+–ôëbÿÝ–I WÆ ûßÚ¸<%wÆ€""֖ĺTE1¹|ˆÚÞ”¸~»x&àMž=§à90²aVè œúv¦4ÕÞ$Üu‡!î•ɽjmw÷à––Ó× {Òæxzå57…ˆ(ŸZa¨'¼'´Ÿäe„Ž6^tH†ùÇ:‘¥1rl'²¬Ìh{Áéi@”ÎEòSIš¾¶“-C»»eá˜åªaÿöhÍ(Õà †ïI@ʹ¹înu¤¶›Ñ0{ÀFPö´çX©ƒ ‡ŸXߓ̣º·l|«Š‰”vÞ¦9¶å¹FësßË ‰ªºž çgˆZù…á[—Û=~ eü„öÂÿ+F54I¿ã2»4Єá묑Ç—&vÓåÈ‹·5Ùi~S?̼Ü|7Ûy(*·m#*9‚"âBE+æ Ö%Rý‘‹¥ý«¸)µ¡ñ’Ô-¡ÁÃ$m;ѳŒg`4mÒu™aœÀÓ~ëÕåj0ñïh©^૱ÀQ”^4£BV½^ƒí0ù°¬vôçu:æ8Iã°Ë /êo­ª´æ}܈'¾°5}{ëÎÕãÐp׈)¡žFk# áWó¬[âÙT\d¤’¸•hôýDß4õÃʶ5y ‘ ø1¾y¨yÂÎl*;sx°Ìw’]q %§°¨Š¿µïŸÎ`ŸÔg|r€ö€Ñ¦@Ú—z6Qmi>ô}™ƒÅ7?ñ,s•™dÞIŒ££u½䱫õ æÿõÀ(ttcìx'îÞäÜL>Àâ7’›`>ÂÏd×™¾ ¡!¦ùLj#x{‘(ÌT’ê ¦4Þ%uðÞT‰Ãe d÷yT(L"{‹u§«!Ôû[½»PØžFëàCG[£¦TÖOWRìÏAú›1ì¦ÌtmˆÞ™+9ÖIÈq]z%£"a"˜•h þñNHnÍÛlŠÁ0èî-÷P¤æ.9{š…wP¼¦ Rä¥l“ˆôyè@4Žø;íÑdz5 vâ¹·#ò*±+§Rt”õ.ýS¿ÐÛ€ªï9h¥!,&ŠUÞ^ÂÏ – ëôœÉ€!=å+1³¡¸ðX`~Í ×®(TƒùØèå6Ã%ÿŽ“Qi ЂÍ~æïÁÍIó×^±‹†r>™ã¡N§P4KH4ƒ Á—yÂßëkGa{¢éQ” ª…08^÷;xxF©Š¢Ÿ­îU¦? ?úm¾“Öo’$c-´ªaû-œ³ù£¼ãVЃ£×?8‡Å9Ü®×öÅC¯=fTo„E«öðgÓûsýûVó “¥¦OC Áô—uV}‹E|¨M‡8Õ6ž“ôèêË÷ña´u½/ôþ‡˜åPReîAy…ïö4g¶þœèª€ÝûbÍßòh¡©Á¢n€·ðSÏ>Ÿ˜exšñÃo¸z½$Šª€¶°Š±Ç½”-½¾×$BÞòÝæy§þ>{Rçœ_K\a9x£)¬º=´ÓȰ¬_™n)ËuíC€ƒSK|< bç›ÏúÀ€¼4w„Š ^ÐmmÆý-ŠF/.ºDÀ”x1¦DõAùšôíQ„÷19^ß UW:ݹ°Ù2‚ æÄÿg>׫ºþìAž„ˆe‹Í;̲u×ÉÝDˆ7%JŽªì^ëÚž„ ÙÎçg]+ä³v¨‰Ã²Ý8„@v5aB½méd¥ÚÛÇIX‡õ4^C¿¨O¼06åÎŽd-`Ç-B柑Ü–…ÑÑt{Î9é7ÑS[»“ì åÇ'V~âz¶üïxr åt$FÚwV¼kg^'–Î3Ú©Äujôóþå?Ðx:­5i4ú),×9Å0 ëz?VŠ3F’ ~DÂ?±ëK]u= ½ŸÐ*»SmišŽåmILpå­ã[NÉÐý©`'¢½qºÏÇIÕAœàz-2È¥r‘"Œ¼‹2*Ï.Âp„‰’:Õ¿âœÃÄ:ôv½RÒ†\PLss¹?•$hk²»ÇfÕŠý8Ø$û79’ž •Äq:óøßšdnÐbºÑ=¹HÐ[b°5¯ã=/°È7—¸"‚lÀ-Q)ÑÓ““*ˆ],: ÄHš05/D²áÀÚvH¬NS"b8‘uâDµ]ã9w˜]Î0ÄÚ›ørbû^_ü…Yð›ŸÖÐÆ¶’ïb¸º‘õü‡ÿì|¨A«”?ÒŒm“OÏ_|»2@o‘¹î-’˜àKÒunfß—ü7ŒôÎ%G;ñ© wg Œ•nÆG®E1÷i°ê¤Ð7º.¬ÜÙµLH[£OX!jé Úìâpçâœ1íœ,}î¥e9•pÊ•—BÀúÇÃ?8/Ç-øž pl ˜9'¢2/¬‰Hì“Aö9ü¢sÃ,YÏïL·»‚Šóü+/e®Ÿ^ž¸ÓÿɾԻ@•øÌš²4_òJgQ:íæÆet{\u Ú>š·¯ß•e¥Eïdê0ÈwÎML°ôð–» X¼lØÚø¹VúfKÜF:"€ÄEó+póêÒþh h dõ²~çÐo«Ü;ž³³›š,ÐÝ ;†šÕD ô.•Uû¥´êX%ÌdØægE…[‘Ýš™äœ7X *Òü0ȸ±sÚ2¾ îÈöâF_NP0ïÅs?3MõœþßLYgn]MÃÀFÈoRn)^úb` »¢kòå)hOš §ÄhL\áŠûVáÀÖ_+F¤$$ˆ¾¶à¢Ôü".=±€2NÄND«ƒû1Sæ RÜLçÆ/‡ÉKOG°^àŸܶ™‡²ˆ‡òÁlIOá8ëR åÜd¸Buš­–7 @ÆþàW.fóŒÛ9Ɇcµk×a;»‡0¹y_fƒµŸè š™y½¦¬Ø[qUï©”ÛÔ\Ç¥þÊk Ê Þi‹°ÿ)ôTVçÚ WÎã}o «pglÝéöctöÍ”wì§×Å4hP~ìê¦6åñn îÀäeöÃp…´rRêÂèи%¿]yƒEYö#s/^î"Ž6í®%­dì`ð&ÌȰÐWþ×üéG£É?,ö E•ÒñnÃÖÁÜȻƣ‘¹TÔÁ`¤Ê$(À…¬tQo¶lz“ŸÍ]aLð…\I Ãt?P,Uòb¬æâC½B%)b®eðMl$N??5ù7H#¨¾•X…û2OõÙ‹´N©L¨^"-ì¢ãÆØ®êuˆE½o^`òè&Ò°C49î$fþLC€=ïxx$°f{ËõšuÍ6Ð`…”mŠß­o”8M]Ëãf8²×Ž~Û›iðI›‡ãÔ»’[·Î³40­ûý K_.";‚%oÑ«ˆ¾€ã¼«­§Ð}«mb¿v‰òÒNŒ•rÓÉók¢s§ßàÿ7ýÉï??È3J@ä,I8ù ÀYç䯵†/±ei%ät,‡î€eç´¤e Î,% ê”äÁÙ§mzŠó´`u¹âs„Ÿ(l!n$÷šÖÞßõ: ¯Ç÷LJåÁ‚ñ¼ÇžT×Nä–|ç¼*‘`·Ví¼¦­=þK~$‡ÑË8 l²]31]‚‹º…îì<,ˆãØÊˆ”Ë'A÷SY3i—láÄýè.íÖD·ZÂŒ^À‚óWnÝòôK"ÆÑõ,Xެ—xBÊK5oo! n­µãå¥å¢é\2ÂTÐŒj¹YÕç"µt¢ â‘0— Mƒ…Üd{¾)IUEvi ÆL^ªÓN;bp’YøˆNΦh3Àý'ÁØKߊ’nz¢J,š]â­ñ‹ðàë¯9„,nòœéŠdjÊLM²‡HÁuí+ÍFMãV¢E‘ &–[qÂŒåü*5¯\U q´3‡¹Nª€f‡|¸ÌèÑTÃHéUº^èN ¥ðÂmÓù!„¿áAÆ$Hú-)†¤­-uëD¡ê³²£ç]½]ãƒñöÛ,7s é¿ŠíРz¨’,Ęq»‰)Zõhw?á §Æ‰;ÕËõs®eß'‘¥C8oWËÐQ \‹÷åEÉ.,”ªë/§”¨ëÎ9‹¤®¦óE¦=b.S†$†QÖ@`†»ÁÊŠ¾?BMÑ•4¹ö))‡¹+r’j7F yÝÆ¶òÚ •pâYJ}g”Ø+ŠÜB3B¥x-”ß$wŠ˜!Þ"íþ“•=²Æø©Áñš0ý•£óÀ]§÷äS¤š~»æ¬3ÏZîçx[•M7æ1<`kÏŸº€k¢ˆO•þÊXSqÅè«}“œ­'¡®,2'ÞìW'—V¦d#«¢:WÞXådØ6ÏåƒËµ9Ýw¥UTËűƒŠ¦ÏY„8ÇåÉøv¬Ï§c5ŠãoE*éGUiwÈ9ƒÉ|Ý m"tv = . °á ŽTÝKÄ©H±Eý-8/ë¸Â6uÿ±BsJ¹lÑé«/©j|zThÐ$£eòõwWП1Ê*?êYÅ1`è]„¤”%žiíãûww25Ë¡Õbfg ‘~Mï%/¦Tmi™·T2ƒ£Æd&5û-xõx“DÕ#[sLˆŸ`3F(–â@7}€‹X†“AW+ ·ê>¡z{¯A©ŸñŽÝÜ1¶…Ó*Š\XgêÛœâA%ÊJÔ{ ‰3­ Ÿ!å0ïÁ½æˆ±·¹J$g–ôWëmØú3åý¢@¡©FHˤ¤Öü—°–d–€^Ìý~͘B¥4ì8†€ª%ë8óY±“vpì(óù Z,ƒʘqQ5üüWÑá¨$2B*w·;Òœ¹™c×ÖMÓmê$ÝÈ+úÛ&Ì6%§íž…#JNµ t©ÁS*(^†=1µ$º:aD&ç(JR„ü–G[KOf-š|›0Ñûöv=ã=­¬¿SH\e'bâÆñÕÙ:ŠÛ›èMº-úsÎm|Òô&ޱø¾ÓÁ%¶bÀ Ò>¨GŒF£ÚCº%Än.剙}; ©ôDÿ2‡å=âÆhDu€’„°*ÁæŽEóòõ†oƒ!eÕA×CóÆãQ‰¾ˆîHza¸á?8_‡š|¨IϽFƒQUøé¶ë SoV v„1ȧÁíDþÌe“ì 0ú&°$7 "Þ…XÉØG§Ç iµ^ví–å gJ_ª _ßG²gÁ‹ÚØí%>âV„î[¼‚NíDñσøâý ì® É„.oK赌¨Ô+Û» û:ÑM3fð¹½¢ýš:›“ã‹]~fTÞ_I‘¯>Ù©i_3¸„(¬la q3{’Š¿³•¤*hÛ„1E7ö3èô~½ko«ƒ¨ÆÏ>AôÒX\vŒz¡š Ç^^ñ#˜99R’}Á&âBá0ÇI5t“‡!þÍD{R€B‚+™›B”®lU^B¾F‹óhï*Xv#CÏcêšhãx¯enÔuŸêœj8[c„1ïå”4,æ‘jå×OŒE ÌRÛýŠQR[w² }c©É?àòÑM'µYl çLñïȘNö‚¦·´T&‘;—ÿýˆ.Þaý Dgrepmail-5.3111/t/mailboxes/directory/mailarc-2.txt000644 000765 000024 00000027250 12504145755 022625 0ustar00coppitstaff000000 000000 From jrh@jack.securepipe.com Tue Jan 13 03:19:47 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA08834; Tue, 13 Jan 1998 03:19:47 -0500 Received: from splat.securepipe.com (splat.securepipe.com [169.207.51.74]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA00703 for ; Tue, 13 Jan 1998 02:15:36 -0500 (EST) Message-Id: <199801130715.CAA00703@aleve.media.mit.edu> Received: (qmail 7615 invoked from network); 13 Jan 1998 07:23:07 -0000 Received: from jack.securepipe.com (network-user@169.207.51.75) by splat.securepipe.com with SMTP; 13 Jan 1998 07:23:07 -0000 X-Mailer: exmh version 2.0zeta 7/24/97 From: Joshua Heling To: handyboard@media.mit.edu Subject: questions re: unix version of IC Reply-To: Joshua Heling Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Jan 1998 01:23:12 -0600 Sender: jrh@jack.securepipe.com Hi - I'm a handy-board/ic newbie, so please excuse this question if it's answers seem obvious. After two weeks of writing code in DOS/Windows (yuck), I downloaded the ic-2.860beta source code, which compiled without significant trouble in linux (redhat 5). The version is, of course, a bit different from that which came with the handy-board (from Gleason Rsch, was version 2.851). My question is, can I just copy the library files that came from Gleason Rsch. into the lib directory on the unix ic installation (it seems that I can, I just want to be sure)? Are there any other issues I should be aware of (w.r.t. the beta, or using ic from unix, end-of-line conventions on library files, etc.). I'm not particularly concerned with being able to download the pcode in unix - I do have DOS easily available... BTW, thanks to all that have contributed to this really neat project - this is my first exposure to robotics, and it's been great fun so far. ----- Begin Included Message ----- From owner-laser@ns1.qsl.net Thu May 1 09:58:06 1997 X-Authentication-Warning: ns1.qsl.net: majordom set sender to owner-laser@qsl.net using -f From: "Guy Hamblen" To: "Laser" Subject: [LASER] Which Circuit for OPT210? Date: Thu, 1 May 1997 12:53:29 -0400 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-laser@qsl.net Reply-To: "Guy Hamblen" Content-Length: 1037 Thanks everyone for sourcing information on this device. I've got several in hand, feedback resistors are in the mail. Now can I get existing OPT1210 user experience re: the following questions: 1) I assume (dangerous I know...) that the easiest circuit (per the Burr-Brown App Notes) is the Fig. 3 "Single Power Supply Operation"? 2) Is 12v operation recommended? 3) If 12v operation, did you use a 5.6v zener or lower value? 4) Did you use electrolytics to bypass to ground pins 1 & 8? 5) Did you build this circuit in a shielded box? 6) Does the on-board opamp provide sufficient output to drive a set of headphones or did you add another opamp gain circuit? If so what low noise device? Any highpass filter circuits? Is there any need for a bandpass filter circuit to get rid of audio highs? I am using a 3" PVC with a focusing lens (f/4") - - how did you mechanically place the OPT210 so the focused light source falls on the photodiode? My approach would be trial-versus-error.... Thanks in advance....Guy N7UN/2 ----- End Included Message ----- - Joshua -------- Joshua Heling jrh@securepipe.com SecurePipe Communications, Inc. From fredm@ml.media.mit.edu Tue Jan 13 10:41:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA21129; Tue, 13 Jan 1998 10:41:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA22423 for ; Tue, 13 Jan 1998 09:10:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ml.media.mit.edu (8.8.7/8.8.7) with SMTP id JAA26699; Tue, 13 Jan 1998 09:10:37 -0500 (EST) Message-Id: <199801131410.JAA26699@ml.media.mit.edu> X-Authentication-Warning: ml.media.mit.edu: localhost [127.0.0.1] didn't use HELO protocol To: Joshua Heling Cc: handyboard@media.mit.edu Subject: Re: questions re: unix version of IC In-Reply-To: Your message of "Tue, 13 Jan 98 01:23:12 CST." <199801130715.CAA00703@aleve.media.mit.edu> Date: Tue, 13 Jan 98 09:10:37 -0500 From: "Fred G. Martin" X-Mts: smtp Joshua - There should be no problems using the Gleason Research libraries (or any of the libraries that are on the web site). There are no differences between version 2.851 and 2.860 from the point of view of the libraries. There is a pre-compiled version for Linux. See ftp://cher.media.mit.edu/pub/projects/interactive-c/unix/ Fred In your message you said: > Hi - > > I'm a handy-board/ic newbie, so please excuse this question if it's answers > seem obvious. After two weeks of writing code in DOS/Windows (yuck), I > downloaded the ic-2.860beta source code, which compiled without significant > trouble in linux (redhat 5). The version is, of course, a bit different from > that which came with the handy-board (from Gleason Rsch, was version 2.851). > > My question is, can I just copy the library files that came from Gleason Rsch . > into the lib directory on the unix ic installation (it seems that I can, I > just want to be sure)? Are there any other issues I should be aware of > (w.r.t. the beta, or using ic from unix, end-of-line conventions on library > files, etc.). I'm not particularly concerned with being able to download the > pcode in unix - I do have DOS easily available... > > BTW, thanks to all that have contributed to this really neat project - this i s > my first exposure to robotics, and it's been great fun so far. > > > - Joshua > > -------- > Joshua Heling jrh@securepipe.com > SecurePipe Communications, Inc. > > > From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU From fredm@ml.media.mit.edu Thu Jan 1 10:20:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA28944; Thu, 1 Jan 1998 10:20:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA23720 for ; Thu, 1 Jan 1998 09:41:01 -0500 (EST) Received: (from fredm@localhost) by ml.media.mit.edu (8.8.7/8.8.7) id JAA32741 for handyboard; Thu, 1 Jan 1998 09:41:01 -0500 (EST) From: Fred G Martin Message-Id: <199801011441.JAA32741@ml.media.mit.edu> To: handyboard@media.mit.edu Subject: Re: Digital outputs. Thanks David for a nice explanation of how to add I/O using shift registers. Let us not all forget that the HB does have two uncommitted digital output ASIDE from the four SPI pins: PA7 (a bidirectional pin which is marked as digital input #9) and PA5 (a timer output pin which is marked as TO3 on the expansion header). It would seem silly to disconnect a motor driver signal when these two signals are available. Fred grepmail-5.3111/t/results/sep_7_1998000644 000765 000024 00000020250 12504145755 017452 0ustar00coppitstaff000000 000000 From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- grepmail-5.3111/t/results/not_header_handy000644 000765 000024 00000152651 12504145755 021251 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/all_luikeith000644 000765 000024 00000002676 12504145755 020425 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > grepmail-5.3111/t/results/ro_status000644 000765 000024 00000000000 12504145755 017755 0ustar00coppitstaff000000 000000 grepmail-5.3111/t/results/ignore_signatures000644 000765 000024 00000034576 12504145755 021512 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/header_mozilla000644 000765 000024 00000036704 12504145755 020735 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c grepmail-5.3111/t/results/body_mime_dos000644 000765 000024 00000017226 12504145755 020565 0ustar00coppitstaff000000 000000 From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- grepmail-5.3111/t/results/two_handy000644 000765 000024 00000113521 12504145755 017743 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU grepmail-5.3111/t/results/unique_all_1000644 000765 000024 00000166510 12504145755 020333 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/body_my_dos000644 000765 000024 00000045337 12504145755 020267 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck grepmail-5.3111/t/results/all_handy_buffer000644 000765 000024 00000122777 12504145755 021250 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/body_my000644 000765 000024 00000044241 12504145755 017413 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck grepmail-5.3111/t/results/all_handy_imagecraft000644 000765 000024 00000025417 12504145755 022072 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/mailarc-2.txt000644 000765 000024 00000027250 12504145755 020337 0ustar00coppitstaff000000 000000 From jrh@jack.securepipe.com Tue Jan 13 03:19:47 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA08834; Tue, 13 Jan 1998 03:19:47 -0500 Received: from splat.securepipe.com (splat.securepipe.com [169.207.51.74]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA00703 for ; Tue, 13 Jan 1998 02:15:36 -0500 (EST) Message-Id: <199801130715.CAA00703@aleve.media.mit.edu> Received: (qmail 7615 invoked from network); 13 Jan 1998 07:23:07 -0000 Received: from jack.securepipe.com (network-user@169.207.51.75) by splat.securepipe.com with SMTP; 13 Jan 1998 07:23:07 -0000 X-Mailer: exmh version 2.0zeta 7/24/97 From: Joshua Heling To: handyboard@media.mit.edu Subject: questions re: unix version of IC Reply-To: Joshua Heling Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Jan 1998 01:23:12 -0600 Sender: jrh@jack.securepipe.com Hi - I'm a handy-board/ic newbie, so please excuse this question if it's answers seem obvious. After two weeks of writing code in DOS/Windows (yuck), I downloaded the ic-2.860beta source code, which compiled without significant trouble in linux (redhat 5). The version is, of course, a bit different from that which came with the handy-board (from Gleason Rsch, was version 2.851). My question is, can I just copy the library files that came from Gleason Rsch. into the lib directory on the unix ic installation (it seems that I can, I just want to be sure)? Are there any other issues I should be aware of (w.r.t. the beta, or using ic from unix, end-of-line conventions on library files, etc.). I'm not particularly concerned with being able to download the pcode in unix - I do have DOS easily available... BTW, thanks to all that have contributed to this really neat project - this is my first exposure to robotics, and it's been great fun so far. ----- Begin Included Message ----- From owner-laser@ns1.qsl.net Thu May 1 09:58:06 1997 X-Authentication-Warning: ns1.qsl.net: majordom set sender to owner-laser@qsl.net using -f From: "Guy Hamblen" To: "Laser" Subject: [LASER] Which Circuit for OPT210? Date: Thu, 1 May 1997 12:53:29 -0400 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-laser@qsl.net Reply-To: "Guy Hamblen" Content-Length: 1037 Thanks everyone for sourcing information on this device. I've got several in hand, feedback resistors are in the mail. Now can I get existing OPT1210 user experience re: the following questions: 1) I assume (dangerous I know...) that the easiest circuit (per the Burr-Brown App Notes) is the Fig. 3 "Single Power Supply Operation"? 2) Is 12v operation recommended? 3) If 12v operation, did you use a 5.6v zener or lower value? 4) Did you use electrolytics to bypass to ground pins 1 & 8? 5) Did you build this circuit in a shielded box? 6) Does the on-board opamp provide sufficient output to drive a set of headphones or did you add another opamp gain circuit? If so what low noise device? Any highpass filter circuits? Is there any need for a bandpass filter circuit to get rid of audio highs? I am using a 3" PVC with a focusing lens (f/4") - - how did you mechanically place the OPT210 so the focused light source falls on the photodiode? My approach would be trial-versus-error.... Thanks in advance....Guy N7UN/2 ----- End Included Message ----- - Joshua -------- Joshua Heling jrh@securepipe.com SecurePipe Communications, Inc. From fredm@ml.media.mit.edu Tue Jan 13 10:41:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA21129; Tue, 13 Jan 1998 10:41:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA22423 for ; Tue, 13 Jan 1998 09:10:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ml.media.mit.edu (8.8.7/8.8.7) with SMTP id JAA26699; Tue, 13 Jan 1998 09:10:37 -0500 (EST) Message-Id: <199801131410.JAA26699@ml.media.mit.edu> X-Authentication-Warning: ml.media.mit.edu: localhost [127.0.0.1] didn't use HELO protocol To: Joshua Heling Cc: handyboard@media.mit.edu Subject: Re: questions re: unix version of IC In-Reply-To: Your message of "Tue, 13 Jan 98 01:23:12 CST." <199801130715.CAA00703@aleve.media.mit.edu> Date: Tue, 13 Jan 98 09:10:37 -0500 From: "Fred G. Martin" X-Mts: smtp Joshua - There should be no problems using the Gleason Research libraries (or any of the libraries that are on the web site). There are no differences between version 2.851 and 2.860 from the point of view of the libraries. There is a pre-compiled version for Linux. See ftp://cher.media.mit.edu/pub/projects/interactive-c/unix/ Fred In your message you said: > Hi - > > I'm a handy-board/ic newbie, so please excuse this question if it's answers > seem obvious. After two weeks of writing code in DOS/Windows (yuck), I > downloaded the ic-2.860beta source code, which compiled without significant > trouble in linux (redhat 5). The version is, of course, a bit different from > that which came with the handy-board (from Gleason Rsch, was version 2.851). > > My question is, can I just copy the library files that came from Gleason Rsch . > into the lib directory on the unix ic installation (it seems that I can, I > just want to be sure)? Are there any other issues I should be aware of > (w.r.t. the beta, or using ic from unix, end-of-line conventions on library > files, etc.). I'm not particularly concerned with being able to download the > pcode in unix - I do have DOS easily available... > > BTW, thanks to all that have contributed to this really neat project - this i s > my first exposure to robotics, and it's been great fun so far. > > > - Joshua > > -------- > Joshua Heling jrh@securepipe.com > SecurePipe Communications, Inc. > > > From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU From fredm@ml.media.mit.edu Thu Jan 1 10:20:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA28944; Thu, 1 Jan 1998 10:20:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA23720 for ; Thu, 1 Jan 1998 09:41:01 -0500 (EST) Received: (from fredm@localhost) by ml.media.mit.edu (8.8.7/8.8.7) id JAA32741 for handyboard; Thu, 1 Jan 1998 09:41:01 -0500 (EST) From: Fred G Martin Message-Id: <199801011441.JAA32741@ml.media.mit.edu> To: handyboard@media.mit.edu Subject: Re: Digital outputs. Thanks David for a nice explanation of how to add I/O using shift registers. Let us not all forget that the HB does have two uncommitted digital output ASIDE from the four SPI pins: PA7 (a bidirectional pin which is marked as digital input #9) and PA5 (a timer output pin which is marked as TO3 on the expansion header). It would seem silly to disconnect a motor driver signal when these two signals are available. Fred grepmail-5.3111/t/results/all_test000644 000765 000024 00000002351 12504145755 017554 0ustar00coppitstaff000000 000000 From ("nnml:Mailbox" 6738) To: Xxxxx XxXxxxxx Subject: Re: test References: X-Face: 5qz+Fg"Lb1Z3i<6h&9Ax$jfq]k{-f:z_Uk_fQ_DOy|7;xWm4@bDK52s/-A\!8g'3a}peKv> u;mMlqf!3"K"X5B;2E|Nz}< Date: Mon, 30 Jul 2001 09:17:30 -0400 In-Reply-To: (Xxxxx XxXxxxxxxx message of "Sun, 29 Jul 2001 23:11:42 -0400 (EDT)") Message-ID: User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 21 Xref: xxxxxx.xxxxxx.xxx Mailbox:6742 Xxxxx XxXxxxxx Xxxxx X xxx xxxx. Xxxxxx xxx xxx xxxx. Xxxxxx xx xxxx xxx x xxxxxxx xx xxx > xxxxx xxxxxxx xxxx xxxxx X xxxxxxxx xxx xxx xxxx xxxxxx. Xx xxxxx xx x > xxxx xxxx. X xxxx xxx xx xxxxx xx xxxxxxx xx x xxxxxx. > Xxxxx > X xxxxxxx xx xx xxxxxxx x xxx xxx xx xxxx xxxxx xxxxxxxxxxx xxx xxxxxxxx xxxx. Xxxx xx xxxx xxxx xx Xxx Xxxxxxx X xxxxx.x -- Xxxxx grepmail-5.3111/t/results/number_1_dos000644 000765 000024 00000113671 12504145755 020332 0ustar00coppitstaff000000 000000 1:From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 2:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 3: id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 4:Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) 5: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 6: for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) 7:Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) 8: by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; 9: Wed, 1 Jul 1998 10:56:30 -0500 (CDT) 10:Sender: dblank@comp.uark.edu 11:Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> 12:Date: Wed, 01 Jul 1998 10:56:30 -0500 13:From: Douglas Blank 14:Organization: University of Arkansas, CS 15:X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) 16:Mime-Version: 1.0 17:To: Aaron Edsinger 18:Cc: handy 19:Subject: Re: Serial Interface 20:References: <199807010601.XAA26862@mail3.sirius.com> 21:Content-Type: text/plain; charset=us-ascii 22:Content-Transfer-Encoding: 7bit 23: 24:Aaron Edsinger wrote: 25: 26:> Hello, 27:> I've been having some problems using my HandyBoard to talk directly to my 28:> PC via the serial interface. I disable Interactive C and then Poke() and 29:> Peek() as has been described on this list. I send short character strings 30:> from my PC to the HandyBoard under Windows 95. If I send strings longer 31:> than 2 characters, it seems that some of the characters get lost. This 32:> behavior seems to be affected by repositioning or slightly modifying the 33:> code, suggesting perhaps a timing issue. 34: 35:Although there is the HEXMON program, I too, have been trying to do what 36:you describe, and encountered the same problems. I found it to be a 37:timing issue, and, through trial and error, have a found some settings 38:that seem to work most of the time. 39: 40:My goal was to make C code that looked the same when compiled and run on 41:the Host is the code that ran under IC. 42: 43:I am including the host and HB programs here. If anyone knows of a 44:better way of communicating, please let us know. 45: 46:-Doug Blank 47: 48:===================================================================== 49:dblank@comp.uark.edu Douglas Blank, University of Arkansas 50:Assistant Professor Computer Science 51:==================== http://www.uark.edu/~dblank ==================== 52: 53:This code was written for MS C++4.0 running on Win95. 54: 55://************** BEGIN: serial_HOST.c 56: 57:/* VC++4.0 HandyBoard Host Programming System 58: Dr. Douglas S. Blank 59: University of Arkansas, Department of Computer Science 60: www.uark.edu/~dblank 61: 62: This code runs on a host PC. 63:*/ 64: 65:#include 66:#include 67:#include 68:#include 69: 70:#include "serial_HOST.h" 71: 72:void main(int argc, char *argv[]) 73:{ 74: motor(0, 100); 75: motor(1, 100); 76: motor(2, 100); 77: motor(3, 100); 78: sleep(1000); 79: motor(0, -100); 80: motor(1, -100); 81: motor(2, -100); 82: motor(3, -100); 83: sleep(1000); 84: ao(); 85: print("\nThis is a test"); 86: printf("Knob is %d\n", knob() ); 87: printf("Analog(0) is %d\n", analog(0)); 88: printf("Digital(0) is %d\n", digital(0)); 89: printf("Analog(1) is %d\n", analog(1)); 90: printf("Digital(1) is %d\n", digital(1)); 91: printf("Analog(2) is %d\n", analog(2)); 92: printf("Digital(2) is %d\n", digital(2)); 93: printf("Analog(3) is %d\n", analog(3)); 94: printf("Digital(3) is %d\n", digital(3)); 95: printf("Analog(4) is %d\n", analog(4)); 96: printf("Digital(4) is %d\n", digital(4)); 97: printf("Analog(5) is %d\n", analog(5)); 98: printf("Digital(5) is %d\n", digital(5)); 99: printf("Analog(6) is %d\n", analog(6)); 100: printf("Digital(6) is %d\n", digital(6)); 101: printf("Analog(7) is %d\n", analog(7)); 102: printf("Digital(7) is %d\n", digital(7)); 103: printf("Analog(8) is %d\n", analog(8)); 104: printf("Digital(8) is %d\n", digital(8)); 105: printf("Analog(9) is %d\n", analog(9)); 106: printf("Digital(9) is %d\n", digital(9)); 107: printf("Analog(10) is %d\n", analog(10)); 108: printf("Digital(10) is %d\n", digital(10)); 109: printf("Analog(11) is %d\n", analog(11)); 110: printf("Digital(11) is %d\n", digital(11)); 111: printf("Analog(12) is %d\n", analog(12)); 112: printf("Digital(12) is %d\n", digital(12)); 113: printf("Analog(13) is %d\n", analog(13)); 114: printf("Digital(13) is %d\n", digital(13)); 115: printf("Analog(14) is %d\n", analog(14)); 116: printf("Digital(14) is %d\n", digital(14)); 117: printf("Analog(15) is %d\n", analog(15)); 118: printf("Digital(15) is %d\n", digital(15)); 119: beep(); 120: sleep(1000); 121: while (! stop_button() ) { 122: sprintf(buffer, "%d.0", (knob() * 10)); 123: tone( buffer, "0.1"); 124: } 125:} 126: 127://************** END: serial_HOST.c 128: 129://************** BEGIN: serial_HOST.h 130: 131:/* VC++4.0 HandyBoard Host Programming System 132: Dr. Douglas S. Blank 133: University of Arkansas, Department of Computer Science 134: www.uark.edu/~dblank 135:*/ 136: 137:#define MOTOR 0 138:#define AO 1 139:#define ANALOG 2 140:#define DIGITAL 3 141:#define PRINTF 4 142:#define KNOB 5 143:#define BEEP 6 144:#define TONE 7 145:#define START_BUTTON 8 146:#define STOP_BUTTON 9 147:#define QUIT 113 148: 149:#define sleep(NUM) _sleep(NUM) 150:#define SERIALWAIT 5 151: 152:unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 153: 154:int send(int i) { 155: int retval; 156: retval = _outp( PORT, i); 157: _sleep(SERIALWAIT); 158: return retval; 159:} 160: 161:int receive() { 162: int retval; 163: retval = _inp( PORT); 164: _sleep(SERIALWAIT); 165: retval = _inp( PORT); 166: return retval; 167:} 168: 169:void hangup() { 170: send(QUIT); 171:} 172: 173:void print(char buffer[]) { 174: int i; 175: send(PRINTF); 176: for (i = 0; buffer[i] != 0; i++) 177: send(buffer[i]); 178: send('\0'); 179:} 180: 181:void motor(int motornum, int power) { 182: send(MOTOR); 183: send(motornum); 184: send(power + 100); // taken off on the other end 185:} 186: 187:int analog(int sensor) { 188: send(ANALOG); 189: send(sensor); 190: return receive(); 191:} 192: 193:int digital(int sensor) { 194: send(DIGITAL); 195: send(sensor); 196: return receive(); 197:} 198: 199:void ao() { 200: send(AO); 201:} 202: 203:int knob() { 204: send(KNOB); 205: return receive(); 206:} 207: 208:void beep() { 209: send(BEEP); 210:} 211: 212:void tone(char f1[], char f2[]) { 213: int i; 214: send(TONE); 215: for (i = 0; f1[i] != 0; i++) 216: send(f1[i]); 217: send('\0'); 218: for (i = 0; f2[i] != 0; i++) 219: send(f2[i]); 220: send('\0'); 221: _sleep((unsigned long) (atof(f2) * 1000)); // to keep from 222:overflowing serial line 223:} 224: 225:void interactive() 226:{ 227: char c; 228: char key = ' '; 229: while (key != 'q') { 230: key = getch(); 231: send(key); 232: printf("Sent %c\n", key); 233: c = receive(); 234: printf("Got %c as a return value\n", c); 235: } 236:} 237: 238:int start_button() { 239: send(START_BUTTON); 240: return receive(); 241:} 242: 243:int stop_button() { 244: send(STOP_BUTTON); 245: return receive(); 246:} 247://************** END: serial_HOST.h 248: 249://************** BEGIN: serial_HB.c 250: 251:/* VC++4.0 HandyBoard Programming System 252: (Parts taken from other HB programs) 253: Dr. Douglas S. Blank 254: University of Arkansas, Department of Computer Science 255: www.uark.edu/~dblank 256: 257: This code runs on the HB 258:*/ 259: 260:#define MOTOR 0 261:#define AO 1 262:#define ANALOG 2 263:#define DIGITAL 3 264:#define PRINTF 4 265:#define KNOB 5 266:#define BEEP 6 267:#define TONE 7 268:#define START_BUTTON 8 269:#define STOP_BUTTON 9 270:#define QUIT 113 271: 272:int _isspace(int a) /* returns 1 for space or tab, 0 273:otherwise */ 274: /* internal routine used by atof() and 275:cgets() */ 276: 277:{ 278: return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ 279:} 280: 281:/*****************************************************************************/ 282: 283:int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ 284: /* internal routine used by atof() */ 285: 286:{ 287: return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ 288:} 289: 290:float atof(char s[]) /* Convert a string containing a number in 291:ASCII */ 292: /* form (integer, float, or exponential float) 293:to a */ 294: /* float. Strips whitespace characters (space 295:and */ 296: /* tab) from the front of the string, but 297:stops */ 298: /* parsing at the first (unexpected) 299:non-numeric */ 300: /* character if the string has garbage at the 301:end. */ 302: /* This means that " 34.3foo78" translates to 303:34.3. */ 304: /* Modified from atof() function in the 305:standard */ 306: /* library of the Hi-Tec C compiler for 307:CP/M. */ 308: /* Note: all string literals converted to 309:decimal */ 310: /* form because IC can't deal with string 311:literals */ 312: /* in math 313:calculations. */ 314: /* Also note: very ugly code because IC will 315:not */ 316: /* allow any math operations on pointers! Thus, 317:the */ 318: /* the number string has to be treated as an 319:array! */ 320: /* Also also note: no error handling; assumes 321:that */ 322: /* the string is a valid representation of a 323:number! */ 324: /* Valid range for exponential-format numbers 325:is */ 326: /* approximately 2.0e-38 to 327:3.4e+38. */ 328: 329:{ 330: int i=0; /* index into string array */ 331: int sign=0; /* mantissa sign flag: 0=positive, 332:1=negative */ 333: int exp0=0; /* mantissa exponent counter */ 334: int eexp=0; /* E-form exponent counter */ 335: int expsign=0; /* exponent sign flag: 0=positive, 336:1=negative */ 337: float m=0.0; /* mantissa accumulator */ 338: 339: /* skip any leading whitespace (space, tab) */ 340: while (_isspace(s[i])) 341: i++; /* skip it */ 342: 343: /* check for mantissa sign */ 344: if (s[i] == 45) /* 45 is '-' */ 345: { 346: sign = 1; /* flag minus sign */ 347: i++; /* point to next */ 348: } 349: else if (s[i] == 43) /* 43 is '+' */ 350: i++; /* point to next */ 351: 352: /* now get all digits up to either a decimal point or an e/E */ 353: while (_isdigit(s[i])) 354: { 355: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 356: i++; /* point to next */ 357: } 358: 359: /* no more digits, so check for decimal point */ 360: if (s[i] == 46) /* 46 is '.' */ 361: { 362: i++; /* point to next */ 363: /* get all digits after decimal point */ 364: while (_isdigit(s[i])) 365: { 366: exp0--; 367: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 368: i++; /* point to next */ 369: } 370: } 371: 372: /* check for e/E exponential form */ 373: if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ 374: { 375: i++; /* point to next */ 376: /* check for exponent sign */ 377: if (s[i] == 45) /* 45 is '-' */ 378: { 379: expsign = 1; /* flag negative exponent */ 380: i++; /* point to next */ 381: } 382: else if (s[i] == 43) /* 43 is '+' */ 383: i++; /* point to next */ 384: 385: /* now get exponent */ 386: while (_isdigit(s[i])) 387: { 388: eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ 389: i++; /* point to next */ 390: } 391: 392: /* adjust exponent sign */ 393: if (expsign) 394: eexp = -eexp; /* make it negative */ 395: } 396: 397: /* compute absolute value of final float */ 398: exp0 += eexp; 399: while (exp0 < 0) /* for negative exponents */ 400: { 401: m = m / 10.0; 402: exp0++; 403: } 404: while (exp0 > 0) /* for positive exponents */ 405: { 406: m = m * 10.0; 407: exp0--; 408: } 409: 410: /* adjust final float sign from mantissa */ 411: if (sign) 412: return (-m); /* negative */ 413: else 414: return (m); /* positive */ 415:} 416: 417:void disable_pcode_serial() 418:/* necessary to receive characters using serial_getchar */ 419:{ 420: poke(0x3c, 1); 421:} 422: 423:void reenable_pcode_serial() 424:/* necessary for IC to interact with board again */ 425:{ 426: poke(0x3c, 0); 427:} 428: 429:/* 430:====================================================================== 431:For sending and receiving single bytes, you can use Randy's IC code: 432:*/ 433: 434:void serial_putchar(int c) 435:{ 436: while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty 437:*/ 438: poke(0x102f, c); /* send character */ 439:} 440: 441:int serial_getchar() 442:{ 443: while (!(peek(0x102e) & 0x20)); /* wait for received character */ 444: return peek(0x102f); 445:} 446: 447:void main(void) { 448: int pos, c = ' ', var1, var2; 449: float f1, f2; 450: char buffer[80]; 451: disable_pcode_serial(); 452: beep(); 453: printf("\nSerial IO Mode!"); 454: printf("Listening..."); 455: msleep(500L); 456: while (c != 'q') { 457: c = serial_getchar(); 458:/* printf("[%d] ", c); */ 459: if (c == MOTOR) { 460: var1 = serial_getchar(); 461: var2 = serial_getchar() - 100; 462: motor(var1, var2); 463: } else if (c == AO) { 464: ao(); 465: } else if (c == ANALOG) { 466: var1 = serial_getchar(); 467: serial_putchar(analog(var1)); 468: } else if (c == DIGITAL) { 469: var1 = serial_getchar(); 470: serial_putchar(digital(var1)); 471: } else if (c == PRINTF) { 472: pos = 0; 473: while (c != 0) { 474: buffer[pos++] = c; 475: c = serial_getchar(); 476: } 477: buffer[pos] = '\0'; 478: printf(buffer); 479: } else if (c == TONE) { 480: pos = 0; 481: c = serial_getchar(); 482: while (c != 0) { 483: buffer[pos++] = c; 484: c = serial_getchar(); 485: } 486: buffer[pos] = '\0'; 487: f1 = atof(buffer); 488: pos = 0; 489: c = serial_getchar(); 490: while (c != 0) { 491: buffer[pos++] = c; 492: c = serial_getchar(); 493: } 494: buffer[pos] = '\0'; 495: f2 = atof(buffer); 496: tone(f1, f2); 497: } else if (c == START_BUTTON) { 498: serial_putchar(start_button()); 499: } else if (c == STOP_BUTTON) { 500: serial_putchar(stop_button()); 501: } else if (c == BEEP) { 502: beep(); 503: } else if (c == KNOB) { 504: serial_putchar(knob()); 505: } 506: } 507: reenable_pcode_serial(); 508: printf("\nHB Mode!"); 509:} 510: 511://************** END: serial_HB.c 512: 791:From aarone@sirius.com Wed Jul 1 02:44:06 1998 792:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 793: id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 794:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 795: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 796: for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) 797:Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) 798: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 799: for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) 800:Message-Id: <199807010601.XAA26862@mail3.sirius.com> 801:From: "Aaron Edsinger" 802:To: "handy" 803:Subject: Serial Interface 804:Date: Wed, 1 Jul 1998 02:06:39 +0100 805:X-Msmail-Priority: Normal 806:X-Priority: 3 807:X-Mailer: Microsoft Internet Mail 4.70.1162 808:Mime-Version: 1.0 809:Content-Type: text/plain; charset=ISO-8859-1 810:Content-Transfer-Encoding: 7bit 811: 812:Hello, 813: I've been having some problems using my HandyBoard to talk directly to my 814:PC via the serial interface. I disable Interactive C and then Poke() and 815:Peek() as has been described on this list. I send short character strings 816:from my PC to the HandyBoard under Windows 95. If I send strings longer 817:than 2 characters, it seems that some of the characters get lost. This 818:behavior seems to be affected by repositioning or slightly modifying the 819:code, suggesting perhaps a timing issue. 820: 821:Why might this be? Is there any way to check for an error situation? 822: 823:Thanks for any help, 824: Aaron 825:From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 826:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 827: id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 828:Received: from hq.freegate.com ([208.226.86.1]) 829: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 830: for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) 831:Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 832:Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) 833: by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 834:Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> 835:Date: Wed, 15 Jul 1998 23:21:14 -0700 836:From: Chuck McManis 837:Reply-To: cmcmanis@freegate.com 838:Organization: Freegate Corporation 839:X-Mailer: Mozilla 4.04 [en] (Win95; I) 840:Mime-Version: 1.0 841:To: David Rye 842:Cc: handyboard@media.mit.edu 843:Subject: Re: Handyboard/RWP without p-code 844:References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> 845:Content-Type: text/plain; charset=us-ascii 846:Content-Transfer-Encoding: 7bit 847: 848:Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the 849:handyboard library from their site. 850: 851:--Chuck 852: 853:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 854:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 855: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 856:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 857: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 858: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 859:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 860:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 861: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 862:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 863: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 864:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> 865:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 866:From: Scott Seaton - Systems Consultant - ESG 867:Reply-To: Scott Seaton - Systems Consultant - ESG 868:Subject: Re: Handyboard/RWP without p-code 869:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 870:Mime-Version: 1.0 871:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 872:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 873: 874:--Troop_of_Baboons_752_000 875:Content-Type: TEXT/plain; charset=us-ascii 876:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 877: 878:Hi 879: 880:I suggest that you contact ImageCraft. 881:http://www.imagecraft.com/software/index.html or info@imagecraft.com 882: 883:They have a C compiler for 68HC11 CPU's that will do what you want, including a 884:library for the HandyBoard (see attached e-mail) ! 885: 886:I have no affiliation with ImageCraft (other than as a satisfied customer). 887: 888:Hope this helps 889:Scott 890:============================================================================== 891: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 892:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 893:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 894: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 895:============================================================================== 896: 897:--Troop_of_Baboons_752_000 898:Content-Type: MESSAGE/rfc822; name=Mailbox 899:Content-Description: Mailbox 900: 901:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 902:Return-Path: 903:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 904: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 905:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 906: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 907:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 908: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 909: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 910:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 911:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 912:Message-Id: <199807100804.BAA15320@lists1.best.com> 913:From: Christina Willrich & Richard Man 914:Subject: icc11 Handyboard library available 915:Date: Fri, 10 Jul 1998 00:58:49 -0700 916:BestServHost: lists.best.com 917:MIME-Version: 1.0 918:Content-Type: text/plain; charset="us-ascii" 919:Sender: icc11-list-errors@lists.best.com 920:Errors-To: icc11-list-errors@lists.best.com 921:Reply-To: icc11-list@lists.best.com 922:To: icc11-list@lists.best.com 923:content-length: 399 924:Status: RO 925:X-Status: $$$$ 926:X-UID: 0000000001 927: 928:At long last, I dusted off Chuck McManis Handyboard library and ported it 929:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 930:out, point your browser to 931: 932:ftp://ftp.imagecraft.com/pub/libhb.zip 933: 934:Chuck really did a great job with the LCD. There are commands to scroll, 935:move etc. Make sure you try the lcdtest2.c test. 936: 937:// richard 938:someone@imagecraft.com http://www.imagecraft.com 939: 940: 941:--Troop_of_Baboons_752_000-- 942: 1142:From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 1143:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1144: id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 1145:Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) 1146: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 1147: for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) 1148:Received: from localhost (wallace@localhost) 1149: by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 1150: for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1151:Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1152:From: Mark Wallace 1153:To: handyboard@media.mit.edu 1154:Subject: sonar.c for the handyboard 1155:Message-Id: 1156:Mime-Version: 1.0 1157:Content-Type: TEXT/PLAIN; charset=US-ASCII 1158: 1159:Hello, 1160: I have a handyboard and 6500 series poloroid ultrasonic ranging 1161:system. I have downloaded the sonar.c programs used to drive the 1162:transducer for distance measurements. There appears to be a problem, or 1163:atleast I think there is, with it. The sonar device is supposed to give 1164:distances of up to 35ft but the TCNC time register is 16 bit and in the 1165:program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has 1166:elapsed and it returns -1. Therefore as soon as about 32700 counts goes 1167:by, that value will go negative. I believe hex goes from 0 to 32768 then 1168:-32768 to -1. In this case the difference will be < 0 if the object 1169:is greater then about 9 ft. I have taken this out of the program and can 1170:get accurate measurements up to atleast 30 ft but I have to look at the 1171:value given and add multiples of 2^16 to it to figure out where it is. 1172:Taking this out of the program also can get you stuck if you really are 1173:out of range. 1174: I have looked on the motorola web pages to see about this clock 1175:and it says that the clock goes till it reachs $ffff and then flags 1176:somewhere that there is an overflow and then starts over. I don't know 1177:how to find out were in the chip this information might be stored. I know 1178:the TCNT time register is at 0x100e from the notes on Simplified Sonar for 1179:the Handy Board but I don't know where that overflow flag is stored. I 1180:thought that maybe by setting this flag and using it in the loop you might 1181:be about to get a greater distance out of you measurement. 1182: Another question I have is about IC. I would like to display 1183:numbers greater then 32000 and right now there are several int type 1184:variables and normal C comands don't seem to work to make a "long" or any 1185:other type that are larger then 32000. How does IC handle larger numbers? 1186: I am only a student and don't have much experience with this stuff 1187:so I would appreciate any feedback I can get on either of these problems. 1188:Thanks. 1189: 1190:Mark Wallace 1191: 1192: e-mail mawalla3@vt.edu 1193: wallace@astro.phys.vt.edu 1194:Web page http://sps1.phys.vt.edu/~mwallace/index.html 1195: 1196:"What a waste it would be after 4 billion tortuous years of evolution if 1197:the dominant organism contrived its own self-destruction" 1198: Carl Sagan 1199: 1200: 1274:From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 1275:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1276: id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 1277:Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) 1278: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 1279: for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) 1280:Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) 1281: by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 1282: for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) 1283:Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) 1284: by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 1285: for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) 1286:Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> 1287:X-Sender: mawalla3@mail.vt.edu (Unverified) 1288:X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) 1289:Date: Wed, 12 Aug 1998 12:13:45 -0400 1290:To: Handyboard@media.mit.edu 1291:From: Mark Wallace 1292:Subject: serial library for C++ 1293:Mime-Version: 1.0 1294:Content-Type: text/plain; charset="us-ascii" 1295: 1296:Hello, 1297: I have a handy board with poloroid transducers and I am trying use the 1298:results of my distance measurments in a C++ program on the computer. I 1299:have found programs on the handyboard web page that should alow the 1300:handyboard to transmit information over the serial line. What I am looking 1301:for is if anyone knows were I could find a serial for Microsofts 1302:Visual C++ 5.0. I would like to find one that is free or sharware but any 1303:information on any serial that will work would be appreciated. 1304:Thanks. 1305:Mark Wallace 1306: 1307: e-mail mawalla3@vt.edu 1308: mwallace@sps1.phys.vt.edu 1309:web page http://sps1.phys.vt.ede/~mwallace 1310: 1311:"What a waist it would be after 4 billion tortuous years of evolution if 1312:the dominant organism contrived its own self-distruction" 1313: Carl Sagan 1314: 1315: 1361:From aarone@sirius.com Wed Aug 12 13:42:19 1998 1362:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1363: id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 1364:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 1365: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 1366: for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) 1367:Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) 1368: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; 1369: Wed, 12 Aug 1998 09:48:24 -0700 (PDT) 1370:Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> 1371:From: "Aaron Edsinger" 1372:To: "Mark Wallace" 1373:Cc: "handy" 1374:Subject: Re: serial library for C++ 1375:Date: Wed, 12 Aug 1998 12:53:41 -0700 1376:Mime-Version: 1.0 1377:Content-Type: text/plain; 1378: charset="iso-8859-1" 1379:Content-Transfer-Encoding: 7bit 1380:X-Priority: 3 1381:X-Msmail-Priority: Normal 1382:X-Mailer: Microsoft Outlook Express 4.72.2106.4 1383:X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 1384: 1385: 1386: Check out this site. It works well. The only problem I had was timing 1387:issues when trying to read and write to the port too quickly. 1388: 1389:http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml 1390: 1391: 1392:-----Original Message----- 1393:From: Mark Wallace 1394:To: Handyboard@media.mit.edu 1395:Date: Wednesday, August 12, 1998 9:25 AM 1396:Subject: serial library for C++ 1397: 1398: 1399:>Hello, 1400:> I have a handy board with poloroid transducers and I am trying use the 1401:>results of my distance measurments in a C++ program on the computer. I 1402:>have found programs on the handyboard web page that should alow the 1403:>handyboard to transmit information over the serial line. What I am looking 1404:>for is if anyone knows were I could find a serial library for Microsofts 1405:>Visual C++ 5.0. I would like to find one that is free or sharware but any 1406:>information on any serial librarys that will work would be appreciated. 1407:>Thanks. 1408:>Mark Wallace 1409:> 1410:> e-mail mawalla3@vt.edu 1411:> mwallace@sps1.phys.vt.edu 1412:>web page http://sps1.phys.vt.ede/~mwallace 1413:> 1414:>"What a waist it would be after 4 billion tortuous years of evolution if 1415:>the dominant organism contrived its own self-distruction" 1416:> Carl Sagan 1417:> 1418: 1419:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 1420:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1421: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 1422:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 1423: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 1424: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 1425:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 1426:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 1427: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 1428:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1429: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 1430:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> 1431:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 1432:From: Scott Seaton - Systems Consultant - ESG 1433:Reply-To: Scott Seaton - Systems Consultant - ESG 1434:Subject: Re: Handyboard/RWP without p-code 1435:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 1436:Mime-Version: 1.0 1437:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 1438:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 1439: 1440:--Troop_of_Baboons_752_000 1441:Content-Type: TEXT/plain; charset=us-ascii 1442:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 1443: 1444:Hi 1445: 1446:I suggest that you contact ImageCraft. 1447:http://www.imagecraft.com/software/index.html or info@imagecraft.com 1448: 1449:They have a C compiler for 68HC11 CPU's that will do what you want, including a 1450:library for the HandyBoard (see attached e-mail) ! 1451: 1452:I have no affiliation with ImageCraft (other than as a satisfied customer). 1453: 1454:Hope this helps 1455:Scott 1456:============================================================================== 1457: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 1458:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 1459:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 1460: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 1461:============================================================================== 1462: 1463:--Troop_of_Baboons_752_000 1464:Content-Type: MESSAGE/rfc822; name=Mailbox 1465:Content-Description: Mailbox 1466: 1467:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 1468:Return-Path: 1469:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1470: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 1471:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 1472: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 1473:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 1474: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 1475: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 1476:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 1477:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 1478:Message-Id: <199807100804.BAA15320@lists1.best.com> 1479:From: Christina Willrich & Richard Man 1480:Subject: icc11 Handyboard library available 1481:Date: Fri, 10 Jul 1998 00:58:49 -0700 1482:BestServHost: lists.best.com 1483:MIME-Version: 1.0 1484:Content-Type: text/plain; charset="us-ascii" 1485:Sender: icc11-list-errors@lists.best.com 1486:Errors-To: icc11-list-errors@lists.best.com 1487:Reply-To: icc11-list@lists.best.com 1488:To: icc11-list@lists.best.com 1489:content-length: 399 1490:Status: RO 1491:X-Status: $$$$ 1492:X-UID: 0000000001 1493: 1494:At long last, I dusted off Chuck McManis Handyboard library and ported it 1495:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 1496:out, point your browser to 1497: 1498:ftp://ftp.imagecraft.com/pub/libhb.zip 1499: 1500:Chuck really did a great job with the LCD. There are commands to scroll, 1501:move etc. Make sure you try the lcdtest2.c test. 1502: 1503:// richard 1504:someone@imagecraft.com http://www.imagecraft.com 1505: 1506: 1507:--Troop_of_Baboons_752_000-- 1508: grepmail-5.3111/t/results/ignore_signatures_dos000644 000765 000024 00000035250 12504145755 022345 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/append_header000644 000765 000024 00000114221 12504145755 020524 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailfolder: t/mailboxes/mailarc-1.txt Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailfolder: t/mailboxes/mailarc-1.txt Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc X-Mailfolder: t/mailboxes/mailarc-1.txt --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailfolder: t/mailboxes/mailarc-1.txt Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Mailfolder: t/mailboxes/mailarc-1.txt Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 X-Mailfolder: t/mailboxes/mailarc-1.txt Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc X-Mailfolder: t/mailboxes/mailarc-1.txt --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailfolder: t/mailboxes/mailarc-2.txt On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU grepmail-5.3111/t/results/recursive2000644 000765 000024 00000021764 12504145755 020047 0ustar00coppitstaff000000 000000 From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU grepmail-5.3111/t/results/all_driving000644 000765 000024 00000004175 12504145755 020245 0ustar00coppitstaff000000 000000 From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org grepmail-5.3111/t/results/count_all000644 000765 000024 00000000042 12504145755 017720 0ustar00coppitstaff000000 000000 t/mailboxes/mailseparators.txt: 3 grepmail-5.3111/t/results/list_handy_dos000644 000765 000024 00000000070 12504145755 020744 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1-dos.txt t/mailboxes/mailarc-2.txt grepmail-5.3111/t/results/unique_handy000644 000765 000024 00000072476 12504145755 020455 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > grepmail-5.3111/t/results/header_aarone000644 000765 000024 00000014555 12504145755 020533 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > grepmail-5.3111/t/results/recursive000644 000765 000024 00000010772 12504145755 017762 0ustar00coppitstaff000000 000000 From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU grepmail-5.3111/t/results/header_edsinger000644 000765 000024 00000053461 12504145755 021065 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > grepmail-5.3111/t/results/header_body_handy000644 000765 000024 00000020062 12504145755 021374 0ustar00coppitstaff000000 000000 From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/number_2000644 000765 000024 00000207356 12504145755 017472 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1.txt:1:From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 t/mailboxes/mailarc-1.txt:2:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:3: id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 t/mailboxes/mailarc-1.txt:4:Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) t/mailboxes/mailarc-1.txt:5: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 t/mailboxes/mailarc-1.txt:6: for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) t/mailboxes/mailarc-1.txt:7:Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) t/mailboxes/mailarc-1.txt:8: by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; t/mailboxes/mailarc-1.txt:9: Wed, 1 Jul 1998 10:56:30 -0500 (CDT) t/mailboxes/mailarc-1.txt:10:Sender: dblank@comp.uark.edu t/mailboxes/mailarc-1.txt:11:Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> t/mailboxes/mailarc-1.txt:12:Date: Wed, 01 Jul 1998 10:56:30 -0500 t/mailboxes/mailarc-1.txt:13:From: Douglas Blank t/mailboxes/mailarc-1.txt:14:Organization: University of Arkansas, CS t/mailboxes/mailarc-1.txt:15:X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) t/mailboxes/mailarc-1.txt:16:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:17:To: Aaron Edsinger t/mailboxes/mailarc-1.txt:18:Cc: handy t/mailboxes/mailarc-1.txt:19:Subject: Re: Serial Interface t/mailboxes/mailarc-1.txt:20:References: <199807010601.XAA26862@mail3.sirius.com> t/mailboxes/mailarc-1.txt:21:Content-Type: text/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:22:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:23: t/mailboxes/mailarc-1.txt:24:Aaron Edsinger wrote: t/mailboxes/mailarc-1.txt:25: t/mailboxes/mailarc-1.txt:26:> Hello, t/mailboxes/mailarc-1.txt:27:> I've been having some problems using my HandyBoard to talk directly to my t/mailboxes/mailarc-1.txt:28:> PC via the serial interface. I disable Interactive C and then Poke() and t/mailboxes/mailarc-1.txt:29:> Peek() as has been described on this list. I send short character strings t/mailboxes/mailarc-1.txt:30:> from my PC to the HandyBoard under Windows 95. If I send strings longer t/mailboxes/mailarc-1.txt:31:> than 2 characters, it seems that some of the characters get lost. This t/mailboxes/mailarc-1.txt:32:> behavior seems to be affected by repositioning or slightly modifying the t/mailboxes/mailarc-1.txt:33:> code, suggesting perhaps a timing issue. t/mailboxes/mailarc-1.txt:34: t/mailboxes/mailarc-1.txt:35:Although there is the HEXMON program, I too, have been trying to do what t/mailboxes/mailarc-1.txt:36:you describe, and encountered the same problems. I found it to be a t/mailboxes/mailarc-1.txt:37:timing issue, and, through trial and error, have a found some settings t/mailboxes/mailarc-1.txt:38:that seem to work most of the time. t/mailboxes/mailarc-1.txt:39: t/mailboxes/mailarc-1.txt:40:My goal was to make C code that looked the same when compiled and run on t/mailboxes/mailarc-1.txt:41:the Host is the code that ran under IC. t/mailboxes/mailarc-1.txt:42: t/mailboxes/mailarc-1.txt:43:I am including the host and HB programs here. If anyone knows of a t/mailboxes/mailarc-1.txt:44:better way of communicating, please let us know. t/mailboxes/mailarc-1.txt:45: t/mailboxes/mailarc-1.txt:46:-Doug Blank t/mailboxes/mailarc-1.txt:47: t/mailboxes/mailarc-1.txt:48:===================================================================== t/mailboxes/mailarc-1.txt:49:dblank@comp.uark.edu Douglas Blank, University of Arkansas t/mailboxes/mailarc-1.txt:50:Assistant Professor Computer Science t/mailboxes/mailarc-1.txt:51:==================== http://www.uark.edu/~dblank ==================== t/mailboxes/mailarc-1.txt:52: t/mailboxes/mailarc-1.txt:53:This code was written for MS C++4.0 running on Win95. t/mailboxes/mailarc-1.txt:54: t/mailboxes/mailarc-1.txt:55://************** BEGIN: serial_HOST.c t/mailboxes/mailarc-1.txt:56: t/mailboxes/mailarc-1.txt:57:/* VC++4.0 HandyBoard Host Programming System t/mailboxes/mailarc-1.txt:58: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:59: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:60: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:61: t/mailboxes/mailarc-1.txt:62: This code runs on a host PC. t/mailboxes/mailarc-1.txt:63:*/ t/mailboxes/mailarc-1.txt:64: t/mailboxes/mailarc-1.txt:65:#include t/mailboxes/mailarc-1.txt:66:#include t/mailboxes/mailarc-1.txt:67:#include t/mailboxes/mailarc-1.txt:68:#include t/mailboxes/mailarc-1.txt:69: t/mailboxes/mailarc-1.txt:70:#include "serial_HOST.h" t/mailboxes/mailarc-1.txt:71: t/mailboxes/mailarc-1.txt:72:void main(int argc, char *argv[]) t/mailboxes/mailarc-1.txt:73:{ t/mailboxes/mailarc-1.txt:74: motor(0, 100); t/mailboxes/mailarc-1.txt:75: motor(1, 100); t/mailboxes/mailarc-1.txt:76: motor(2, 100); t/mailboxes/mailarc-1.txt:77: motor(3, 100); t/mailboxes/mailarc-1.txt:78: sleep(1000); t/mailboxes/mailarc-1.txt:79: motor(0, -100); t/mailboxes/mailarc-1.txt:80: motor(1, -100); t/mailboxes/mailarc-1.txt:81: motor(2, -100); t/mailboxes/mailarc-1.txt:82: motor(3, -100); t/mailboxes/mailarc-1.txt:83: sleep(1000); t/mailboxes/mailarc-1.txt:84: ao(); t/mailboxes/mailarc-1.txt:85: print("\nThis is a test"); t/mailboxes/mailarc-1.txt:86: printf("Knob is %d\n", knob() ); t/mailboxes/mailarc-1.txt:87: printf("Analog(0) is %d\n", analog(0)); t/mailboxes/mailarc-1.txt:88: printf("Digital(0) is %d\n", digital(0)); t/mailboxes/mailarc-1.txt:89: printf("Analog(1) is %d\n", analog(1)); t/mailboxes/mailarc-1.txt:90: printf("Digital(1) is %d\n", digital(1)); t/mailboxes/mailarc-1.txt:91: printf("Analog(2) is %d\n", analog(2)); t/mailboxes/mailarc-1.txt:92: printf("Digital(2) is %d\n", digital(2)); t/mailboxes/mailarc-1.txt:93: printf("Analog(3) is %d\n", analog(3)); t/mailboxes/mailarc-1.txt:94: printf("Digital(3) is %d\n", digital(3)); t/mailboxes/mailarc-1.txt:95: printf("Analog(4) is %d\n", analog(4)); t/mailboxes/mailarc-1.txt:96: printf("Digital(4) is %d\n", digital(4)); t/mailboxes/mailarc-1.txt:97: printf("Analog(5) is %d\n", analog(5)); t/mailboxes/mailarc-1.txt:98: printf("Digital(5) is %d\n", digital(5)); t/mailboxes/mailarc-1.txt:99: printf("Analog(6) is %d\n", analog(6)); t/mailboxes/mailarc-1.txt:100: printf("Digital(6) is %d\n", digital(6)); t/mailboxes/mailarc-1.txt:101: printf("Analog(7) is %d\n", analog(7)); t/mailboxes/mailarc-1.txt:102: printf("Digital(7) is %d\n", digital(7)); t/mailboxes/mailarc-1.txt:103: printf("Analog(8) is %d\n", analog(8)); t/mailboxes/mailarc-1.txt:104: printf("Digital(8) is %d\n", digital(8)); t/mailboxes/mailarc-1.txt:105: printf("Analog(9) is %d\n", analog(9)); t/mailboxes/mailarc-1.txt:106: printf("Digital(9) is %d\n", digital(9)); t/mailboxes/mailarc-1.txt:107: printf("Analog(10) is %d\n", analog(10)); t/mailboxes/mailarc-1.txt:108: printf("Digital(10) is %d\n", digital(10)); t/mailboxes/mailarc-1.txt:109: printf("Analog(11) is %d\n", analog(11)); t/mailboxes/mailarc-1.txt:110: printf("Digital(11) is %d\n", digital(11)); t/mailboxes/mailarc-1.txt:111: printf("Analog(12) is %d\n", analog(12)); t/mailboxes/mailarc-1.txt:112: printf("Digital(12) is %d\n", digital(12)); t/mailboxes/mailarc-1.txt:113: printf("Analog(13) is %d\n", analog(13)); t/mailboxes/mailarc-1.txt:114: printf("Digital(13) is %d\n", digital(13)); t/mailboxes/mailarc-1.txt:115: printf("Analog(14) is %d\n", analog(14)); t/mailboxes/mailarc-1.txt:116: printf("Digital(14) is %d\n", digital(14)); t/mailboxes/mailarc-1.txt:117: printf("Analog(15) is %d\n", analog(15)); t/mailboxes/mailarc-1.txt:118: printf("Digital(15) is %d\n", digital(15)); t/mailboxes/mailarc-1.txt:119: beep(); t/mailboxes/mailarc-1.txt:120: sleep(1000); t/mailboxes/mailarc-1.txt:121: while (! stop_button() ) { t/mailboxes/mailarc-1.txt:122: sprintf(buffer, "%d.0", (knob() * 10)); t/mailboxes/mailarc-1.txt:123: tone( buffer, "0.1"); t/mailboxes/mailarc-1.txt:124: } t/mailboxes/mailarc-1.txt:125:} t/mailboxes/mailarc-1.txt:126: t/mailboxes/mailarc-1.txt:127://************** END: serial_HOST.c t/mailboxes/mailarc-1.txt:128: t/mailboxes/mailarc-1.txt:129://************** BEGIN: serial_HOST.h t/mailboxes/mailarc-1.txt:130: t/mailboxes/mailarc-1.txt:131:/* VC++4.0 HandyBoard Host Programming System t/mailboxes/mailarc-1.txt:132: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:133: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:134: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:135:*/ t/mailboxes/mailarc-1.txt:136: t/mailboxes/mailarc-1.txt:137:#define MOTOR 0 t/mailboxes/mailarc-1.txt:138:#define AO 1 t/mailboxes/mailarc-1.txt:139:#define ANALOG 2 t/mailboxes/mailarc-1.txt:140:#define DIGITAL 3 t/mailboxes/mailarc-1.txt:141:#define PRINTF 4 t/mailboxes/mailarc-1.txt:142:#define KNOB 5 t/mailboxes/mailarc-1.txt:143:#define BEEP 6 t/mailboxes/mailarc-1.txt:144:#define TONE 7 t/mailboxes/mailarc-1.txt:145:#define START_BUTTON 8 t/mailboxes/mailarc-1.txt:146:#define STOP_BUTTON 9 t/mailboxes/mailarc-1.txt:147:#define QUIT 113 t/mailboxes/mailarc-1.txt:148: t/mailboxes/mailarc-1.txt:149:#define sleep(NUM) _sleep(NUM) t/mailboxes/mailarc-1.txt:150:#define SERIALWAIT 5 t/mailboxes/mailarc-1.txt:151: t/mailboxes/mailarc-1.txt:152:unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 t/mailboxes/mailarc-1.txt:153: t/mailboxes/mailarc-1.txt:154:int send(int i) { t/mailboxes/mailarc-1.txt:155: int retval; t/mailboxes/mailarc-1.txt:156: retval = _outp( PORT, i); t/mailboxes/mailarc-1.txt:157: _sleep(SERIALWAIT); t/mailboxes/mailarc-1.txt:158: return retval; t/mailboxes/mailarc-1.txt:159:} t/mailboxes/mailarc-1.txt:160: t/mailboxes/mailarc-1.txt:161:int receive() { t/mailboxes/mailarc-1.txt:162: int retval; t/mailboxes/mailarc-1.txt:163: retval = _inp( PORT); t/mailboxes/mailarc-1.txt:164: _sleep(SERIALWAIT); t/mailboxes/mailarc-1.txt:165: retval = _inp( PORT); t/mailboxes/mailarc-1.txt:166: return retval; t/mailboxes/mailarc-1.txt:167:} t/mailboxes/mailarc-1.txt:168: t/mailboxes/mailarc-1.txt:169:void hangup() { t/mailboxes/mailarc-1.txt:170: send(QUIT); t/mailboxes/mailarc-1.txt:171:} t/mailboxes/mailarc-1.txt:172: t/mailboxes/mailarc-1.txt:173:void print(char buffer[]) { t/mailboxes/mailarc-1.txt:174: int i; t/mailboxes/mailarc-1.txt:175: send(PRINTF); t/mailboxes/mailarc-1.txt:176: for (i = 0; buffer[i] != 0; i++) t/mailboxes/mailarc-1.txt:177: send(buffer[i]); t/mailboxes/mailarc-1.txt:178: send('\0'); t/mailboxes/mailarc-1.txt:179:} t/mailboxes/mailarc-1.txt:180: t/mailboxes/mailarc-1.txt:181:void motor(int motornum, int power) { t/mailboxes/mailarc-1.txt:182: send(MOTOR); t/mailboxes/mailarc-1.txt:183: send(motornum); t/mailboxes/mailarc-1.txt:184: send(power + 100); // taken off on the other end t/mailboxes/mailarc-1.txt:185:} t/mailboxes/mailarc-1.txt:186: t/mailboxes/mailarc-1.txt:187:int analog(int sensor) { t/mailboxes/mailarc-1.txt:188: send(ANALOG); t/mailboxes/mailarc-1.txt:189: send(sensor); t/mailboxes/mailarc-1.txt:190: return receive(); t/mailboxes/mailarc-1.txt:191:} t/mailboxes/mailarc-1.txt:192: t/mailboxes/mailarc-1.txt:193:int digital(int sensor) { t/mailboxes/mailarc-1.txt:194: send(DIGITAL); t/mailboxes/mailarc-1.txt:195: send(sensor); t/mailboxes/mailarc-1.txt:196: return receive(); t/mailboxes/mailarc-1.txt:197:} t/mailboxes/mailarc-1.txt:198: t/mailboxes/mailarc-1.txt:199:void ao() { t/mailboxes/mailarc-1.txt:200: send(AO); t/mailboxes/mailarc-1.txt:201:} t/mailboxes/mailarc-1.txt:202: t/mailboxes/mailarc-1.txt:203:int knob() { t/mailboxes/mailarc-1.txt:204: send(KNOB); t/mailboxes/mailarc-1.txt:205: return receive(); t/mailboxes/mailarc-1.txt:206:} t/mailboxes/mailarc-1.txt:207: t/mailboxes/mailarc-1.txt:208:void beep() { t/mailboxes/mailarc-1.txt:209: send(BEEP); t/mailboxes/mailarc-1.txt:210:} t/mailboxes/mailarc-1.txt:211: t/mailboxes/mailarc-1.txt:212:void tone(char f1[], char f2[]) { t/mailboxes/mailarc-1.txt:213: int i; t/mailboxes/mailarc-1.txt:214: send(TONE); t/mailboxes/mailarc-1.txt:215: for (i = 0; f1[i] != 0; i++) t/mailboxes/mailarc-1.txt:216: send(f1[i]); t/mailboxes/mailarc-1.txt:217: send('\0'); t/mailboxes/mailarc-1.txt:218: for (i = 0; f2[i] != 0; i++) t/mailboxes/mailarc-1.txt:219: send(f2[i]); t/mailboxes/mailarc-1.txt:220: send('\0'); t/mailboxes/mailarc-1.txt:221: _sleep((unsigned long) (atof(f2) * 1000)); // to keep from t/mailboxes/mailarc-1.txt:222:overflowing serial line t/mailboxes/mailarc-1.txt:223:} t/mailboxes/mailarc-1.txt:224: t/mailboxes/mailarc-1.txt:225:void interactive() t/mailboxes/mailarc-1.txt:226:{ t/mailboxes/mailarc-1.txt:227: char c; t/mailboxes/mailarc-1.txt:228: char key = ' '; t/mailboxes/mailarc-1.txt:229: while (key != 'q') { t/mailboxes/mailarc-1.txt:230: key = getch(); t/mailboxes/mailarc-1.txt:231: send(key); t/mailboxes/mailarc-1.txt:232: printf("Sent %c\n", key); t/mailboxes/mailarc-1.txt:233: c = receive(); t/mailboxes/mailarc-1.txt:234: printf("Got %c as a return value\n", c); t/mailboxes/mailarc-1.txt:235: } t/mailboxes/mailarc-1.txt:236:} t/mailboxes/mailarc-1.txt:237: t/mailboxes/mailarc-1.txt:238:int start_button() { t/mailboxes/mailarc-1.txt:239: send(START_BUTTON); t/mailboxes/mailarc-1.txt:240: return receive(); t/mailboxes/mailarc-1.txt:241:} t/mailboxes/mailarc-1.txt:242: t/mailboxes/mailarc-1.txt:243:int stop_button() { t/mailboxes/mailarc-1.txt:244: send(STOP_BUTTON); t/mailboxes/mailarc-1.txt:245: return receive(); t/mailboxes/mailarc-1.txt:246:} t/mailboxes/mailarc-1.txt:247://************** END: serial_HOST.h t/mailboxes/mailarc-1.txt:248: t/mailboxes/mailarc-1.txt:249://************** BEGIN: serial_HB.c t/mailboxes/mailarc-1.txt:250: t/mailboxes/mailarc-1.txt:251:/* VC++4.0 HandyBoard Programming System t/mailboxes/mailarc-1.txt:252: (Parts taken from other HB programs) t/mailboxes/mailarc-1.txt:253: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:254: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:255: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:256: t/mailboxes/mailarc-1.txt:257: This code runs on the HB t/mailboxes/mailarc-1.txt:258:*/ t/mailboxes/mailarc-1.txt:259: t/mailboxes/mailarc-1.txt:260:#define MOTOR 0 t/mailboxes/mailarc-1.txt:261:#define AO 1 t/mailboxes/mailarc-1.txt:262:#define ANALOG 2 t/mailboxes/mailarc-1.txt:263:#define DIGITAL 3 t/mailboxes/mailarc-1.txt:264:#define PRINTF 4 t/mailboxes/mailarc-1.txt:265:#define KNOB 5 t/mailboxes/mailarc-1.txt:266:#define BEEP 6 t/mailboxes/mailarc-1.txt:267:#define TONE 7 t/mailboxes/mailarc-1.txt:268:#define START_BUTTON 8 t/mailboxes/mailarc-1.txt:269:#define STOP_BUTTON 9 t/mailboxes/mailarc-1.txt:270:#define QUIT 113 t/mailboxes/mailarc-1.txt:271: t/mailboxes/mailarc-1.txt:272:int _isspace(int a) /* returns 1 for space or tab, 0 t/mailboxes/mailarc-1.txt:273:otherwise */ t/mailboxes/mailarc-1.txt:274: /* internal routine used by atof() and t/mailboxes/mailarc-1.txt:275:cgets() */ t/mailboxes/mailarc-1.txt:276: t/mailboxes/mailarc-1.txt:277:{ t/mailboxes/mailarc-1.txt:278: return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ t/mailboxes/mailarc-1.txt:279:} t/mailboxes/mailarc-1.txt:280: t/mailboxes/mailarc-1.txt:281:/*****************************************************************************/ t/mailboxes/mailarc-1.txt:282: t/mailboxes/mailarc-1.txt:283:int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ t/mailboxes/mailarc-1.txt:284: /* internal routine used by atof() */ t/mailboxes/mailarc-1.txt:285: t/mailboxes/mailarc-1.txt:286:{ t/mailboxes/mailarc-1.txt:287: return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ t/mailboxes/mailarc-1.txt:288:} t/mailboxes/mailarc-1.txt:289: t/mailboxes/mailarc-1.txt:290:float atof(char s[]) /* Convert a string containing a number in t/mailboxes/mailarc-1.txt:291:ASCII */ t/mailboxes/mailarc-1.txt:292: /* form (integer, float, or exponential float) t/mailboxes/mailarc-1.txt:293:to a */ t/mailboxes/mailarc-1.txt:294: /* float. Strips whitespace characters (space t/mailboxes/mailarc-1.txt:295:and */ t/mailboxes/mailarc-1.txt:296: /* tab) from the front of the string, but t/mailboxes/mailarc-1.txt:297:stops */ t/mailboxes/mailarc-1.txt:298: /* parsing at the first (unexpected) t/mailboxes/mailarc-1.txt:299:non-numeric */ t/mailboxes/mailarc-1.txt:300: /* character if the string has garbage at the t/mailboxes/mailarc-1.txt:301:end. */ t/mailboxes/mailarc-1.txt:302: /* This means that " 34.3foo78" translates to t/mailboxes/mailarc-1.txt:303:34.3. */ t/mailboxes/mailarc-1.txt:304: /* Modified from atof() function in the t/mailboxes/mailarc-1.txt:305:standard */ t/mailboxes/mailarc-1.txt:306: /* library of the Hi-Tec C compiler for t/mailboxes/mailarc-1.txt:307:CP/M. */ t/mailboxes/mailarc-1.txt:308: /* Note: all string literals converted to t/mailboxes/mailarc-1.txt:309:decimal */ t/mailboxes/mailarc-1.txt:310: /* form because IC can't deal with string t/mailboxes/mailarc-1.txt:311:literals */ t/mailboxes/mailarc-1.txt:312: /* in math t/mailboxes/mailarc-1.txt:313:calculations. */ t/mailboxes/mailarc-1.txt:314: /* Also note: very ugly code because IC will t/mailboxes/mailarc-1.txt:315:not */ t/mailboxes/mailarc-1.txt:316: /* allow any math operations on pointers! Thus, t/mailboxes/mailarc-1.txt:317:the */ t/mailboxes/mailarc-1.txt:318: /* the number string has to be treated as an t/mailboxes/mailarc-1.txt:319:array! */ t/mailboxes/mailarc-1.txt:320: /* Also also note: no error handling; assumes t/mailboxes/mailarc-1.txt:321:that */ t/mailboxes/mailarc-1.txt:322: /* the string is a valid representation of a t/mailboxes/mailarc-1.txt:323:number! */ t/mailboxes/mailarc-1.txt:324: /* Valid range for exponential-format numbers t/mailboxes/mailarc-1.txt:325:is */ t/mailboxes/mailarc-1.txt:326: /* approximately 2.0e-38 to t/mailboxes/mailarc-1.txt:327:3.4e+38. */ t/mailboxes/mailarc-1.txt:328: t/mailboxes/mailarc-1.txt:329:{ t/mailboxes/mailarc-1.txt:330: int i=0; /* index into string array */ t/mailboxes/mailarc-1.txt:331: int sign=0; /* mantissa sign flag: 0=positive, t/mailboxes/mailarc-1.txt:332:1=negative */ t/mailboxes/mailarc-1.txt:333: int exp0=0; /* mantissa exponent counter */ t/mailboxes/mailarc-1.txt:334: int eexp=0; /* E-form exponent counter */ t/mailboxes/mailarc-1.txt:335: int expsign=0; /* exponent sign flag: 0=positive, t/mailboxes/mailarc-1.txt:336:1=negative */ t/mailboxes/mailarc-1.txt:337: float m=0.0; /* mantissa accumulator */ t/mailboxes/mailarc-1.txt:338: t/mailboxes/mailarc-1.txt:339: /* skip any leading whitespace (space, tab) */ t/mailboxes/mailarc-1.txt:340: while (_isspace(s[i])) t/mailboxes/mailarc-1.txt:341: i++; /* skip it */ t/mailboxes/mailarc-1.txt:342: t/mailboxes/mailarc-1.txt:343: /* check for mantissa sign */ t/mailboxes/mailarc-1.txt:344: if (s[i] == 45) /* 45 is '-' */ t/mailboxes/mailarc-1.txt:345: { t/mailboxes/mailarc-1.txt:346: sign = 1; /* flag minus sign */ t/mailboxes/mailarc-1.txt:347: i++; /* point to next */ t/mailboxes/mailarc-1.txt:348: } t/mailboxes/mailarc-1.txt:349: else if (s[i] == 43) /* 43 is '+' */ t/mailboxes/mailarc-1.txt:350: i++; /* point to next */ t/mailboxes/mailarc-1.txt:351: t/mailboxes/mailarc-1.txt:352: /* now get all digits up to either a decimal point or an e/E */ t/mailboxes/mailarc-1.txt:353: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:354: { t/mailboxes/mailarc-1.txt:355: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ t/mailboxes/mailarc-1.txt:356: i++; /* point to next */ t/mailboxes/mailarc-1.txt:357: } t/mailboxes/mailarc-1.txt:358: t/mailboxes/mailarc-1.txt:359: /* no more digits, so check for decimal point */ t/mailboxes/mailarc-1.txt:360: if (s[i] == 46) /* 46 is '.' */ t/mailboxes/mailarc-1.txt:361: { t/mailboxes/mailarc-1.txt:362: i++; /* point to next */ t/mailboxes/mailarc-1.txt:363: /* get all digits after decimal point */ t/mailboxes/mailarc-1.txt:364: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:365: { t/mailboxes/mailarc-1.txt:366: exp0--; t/mailboxes/mailarc-1.txt:367: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ t/mailboxes/mailarc-1.txt:368: i++; /* point to next */ t/mailboxes/mailarc-1.txt:369: } t/mailboxes/mailarc-1.txt:370: } t/mailboxes/mailarc-1.txt:371: t/mailboxes/mailarc-1.txt:372: /* check for e/E exponential form */ t/mailboxes/mailarc-1.txt:373: if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ t/mailboxes/mailarc-1.txt:374: { t/mailboxes/mailarc-1.txt:375: i++; /* point to next */ t/mailboxes/mailarc-1.txt:376: /* check for exponent sign */ t/mailboxes/mailarc-1.txt:377: if (s[i] == 45) /* 45 is '-' */ t/mailboxes/mailarc-1.txt:378: { t/mailboxes/mailarc-1.txt:379: expsign = 1; /* flag negative exponent */ t/mailboxes/mailarc-1.txt:380: i++; /* point to next */ t/mailboxes/mailarc-1.txt:381: } t/mailboxes/mailarc-1.txt:382: else if (s[i] == 43) /* 43 is '+' */ t/mailboxes/mailarc-1.txt:383: i++; /* point to next */ t/mailboxes/mailarc-1.txt:384: t/mailboxes/mailarc-1.txt:385: /* now get exponent */ t/mailboxes/mailarc-1.txt:386: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:387: { t/mailboxes/mailarc-1.txt:388: eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ t/mailboxes/mailarc-1.txt:389: i++; /* point to next */ t/mailboxes/mailarc-1.txt:390: } t/mailboxes/mailarc-1.txt:391: t/mailboxes/mailarc-1.txt:392: /* adjust exponent sign */ t/mailboxes/mailarc-1.txt:393: if (expsign) t/mailboxes/mailarc-1.txt:394: eexp = -eexp; /* make it negative */ t/mailboxes/mailarc-1.txt:395: } t/mailboxes/mailarc-1.txt:396: t/mailboxes/mailarc-1.txt:397: /* compute absolute value of final float */ t/mailboxes/mailarc-1.txt:398: exp0 += eexp; t/mailboxes/mailarc-1.txt:399: while (exp0 < 0) /* for negative exponents */ t/mailboxes/mailarc-1.txt:400: { t/mailboxes/mailarc-1.txt:401: m = m / 10.0; t/mailboxes/mailarc-1.txt:402: exp0++; t/mailboxes/mailarc-1.txt:403: } t/mailboxes/mailarc-1.txt:404: while (exp0 > 0) /* for positive exponents */ t/mailboxes/mailarc-1.txt:405: { t/mailboxes/mailarc-1.txt:406: m = m * 10.0; t/mailboxes/mailarc-1.txt:407: exp0--; t/mailboxes/mailarc-1.txt:408: } t/mailboxes/mailarc-1.txt:409: t/mailboxes/mailarc-1.txt:410: /* adjust final float sign from mantissa */ t/mailboxes/mailarc-1.txt:411: if (sign) t/mailboxes/mailarc-1.txt:412: return (-m); /* negative */ t/mailboxes/mailarc-1.txt:413: else t/mailboxes/mailarc-1.txt:414: return (m); /* positive */ t/mailboxes/mailarc-1.txt:415:} t/mailboxes/mailarc-1.txt:416: t/mailboxes/mailarc-1.txt:417:void disable_pcode_serial() t/mailboxes/mailarc-1.txt:418:/* necessary to receive characters using serial_getchar */ t/mailboxes/mailarc-1.txt:419:{ t/mailboxes/mailarc-1.txt:420: poke(0x3c, 1); t/mailboxes/mailarc-1.txt:421:} t/mailboxes/mailarc-1.txt:422: t/mailboxes/mailarc-1.txt:423:void reenable_pcode_serial() t/mailboxes/mailarc-1.txt:424:/* necessary for IC to interact with board again */ t/mailboxes/mailarc-1.txt:425:{ t/mailboxes/mailarc-1.txt:426: poke(0x3c, 0); t/mailboxes/mailarc-1.txt:427:} t/mailboxes/mailarc-1.txt:428: t/mailboxes/mailarc-1.txt:429:/* t/mailboxes/mailarc-1.txt:430:====================================================================== t/mailboxes/mailarc-1.txt:431:For sending and receiving single bytes, you can use Randy's IC code: t/mailboxes/mailarc-1.txt:432:*/ t/mailboxes/mailarc-1.txt:433: t/mailboxes/mailarc-1.txt:434:void serial_putchar(int c) t/mailboxes/mailarc-1.txt:435:{ t/mailboxes/mailarc-1.txt:436: while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty t/mailboxes/mailarc-1.txt:437:*/ t/mailboxes/mailarc-1.txt:438: poke(0x102f, c); /* send character */ t/mailboxes/mailarc-1.txt:439:} t/mailboxes/mailarc-1.txt:440: t/mailboxes/mailarc-1.txt:441:int serial_getchar() t/mailboxes/mailarc-1.txt:442:{ t/mailboxes/mailarc-1.txt:443: while (!(peek(0x102e) & 0x20)); /* wait for received character */ t/mailboxes/mailarc-1.txt:444: return peek(0x102f); t/mailboxes/mailarc-1.txt:445:} t/mailboxes/mailarc-1.txt:446: t/mailboxes/mailarc-1.txt:447:void main(void) { t/mailboxes/mailarc-1.txt:448: int pos, c = ' ', var1, var2; t/mailboxes/mailarc-1.txt:449: float f1, f2; t/mailboxes/mailarc-1.txt:450: char buffer[80]; t/mailboxes/mailarc-1.txt:451: disable_pcode_serial(); t/mailboxes/mailarc-1.txt:452: beep(); t/mailboxes/mailarc-1.txt:453: printf("\nSerial IO Mode!"); t/mailboxes/mailarc-1.txt:454: printf("Listening..."); t/mailboxes/mailarc-1.txt:455: msleep(500L); t/mailboxes/mailarc-1.txt:456: while (c != 'q') { t/mailboxes/mailarc-1.txt:457: c = serial_getchar(); t/mailboxes/mailarc-1.txt:458:/* printf("[%d] ", c); */ t/mailboxes/mailarc-1.txt:459: if (c == MOTOR) { t/mailboxes/mailarc-1.txt:460: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:461: var2 = serial_getchar() - 100; t/mailboxes/mailarc-1.txt:462: motor(var1, var2); t/mailboxes/mailarc-1.txt:463: } else if (c == AO) { t/mailboxes/mailarc-1.txt:464: ao(); t/mailboxes/mailarc-1.txt:465: } else if (c == ANALOG) { t/mailboxes/mailarc-1.txt:466: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:467: serial_putchar(analog(var1)); t/mailboxes/mailarc-1.txt:468: } else if (c == DIGITAL) { t/mailboxes/mailarc-1.txt:469: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:470: serial_putchar(digital(var1)); t/mailboxes/mailarc-1.txt:471: } else if (c == PRINTF) { t/mailboxes/mailarc-1.txt:472: pos = 0; t/mailboxes/mailarc-1.txt:473: while (c != 0) { t/mailboxes/mailarc-1.txt:474: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:475: c = serial_getchar(); t/mailboxes/mailarc-1.txt:476: } t/mailboxes/mailarc-1.txt:477: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:478: printf(buffer); t/mailboxes/mailarc-1.txt:479: } else if (c == TONE) { t/mailboxes/mailarc-1.txt:480: pos = 0; t/mailboxes/mailarc-1.txt:481: c = serial_getchar(); t/mailboxes/mailarc-1.txt:482: while (c != 0) { t/mailboxes/mailarc-1.txt:483: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:484: c = serial_getchar(); t/mailboxes/mailarc-1.txt:485: } t/mailboxes/mailarc-1.txt:486: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:487: f1 = atof(buffer); t/mailboxes/mailarc-1.txt:488: pos = 0; t/mailboxes/mailarc-1.txt:489: c = serial_getchar(); t/mailboxes/mailarc-1.txt:490: while (c != 0) { t/mailboxes/mailarc-1.txt:491: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:492: c = serial_getchar(); t/mailboxes/mailarc-1.txt:493: } t/mailboxes/mailarc-1.txt:494: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:495: f2 = atof(buffer); t/mailboxes/mailarc-1.txt:496: tone(f1, f2); t/mailboxes/mailarc-1.txt:497: } else if (c == START_BUTTON) { t/mailboxes/mailarc-1.txt:498: serial_putchar(start_button()); t/mailboxes/mailarc-1.txt:499: } else if (c == STOP_BUTTON) { t/mailboxes/mailarc-1.txt:500: serial_putchar(stop_button()); t/mailboxes/mailarc-1.txt:501: } else if (c == BEEP) { t/mailboxes/mailarc-1.txt:502: beep(); t/mailboxes/mailarc-1.txt:503: } else if (c == KNOB) { t/mailboxes/mailarc-1.txt:504: serial_putchar(knob()); t/mailboxes/mailarc-1.txt:505: } t/mailboxes/mailarc-1.txt:506: } t/mailboxes/mailarc-1.txt:507: reenable_pcode_serial(); t/mailboxes/mailarc-1.txt:508: printf("\nHB Mode!"); t/mailboxes/mailarc-1.txt:509:} t/mailboxes/mailarc-1.txt:510: t/mailboxes/mailarc-1.txt:511://************** END: serial_HB.c t/mailboxes/mailarc-1.txt:512: t/mailboxes/mailarc-1.txt:791:From aarone@sirius.com Wed Jul 1 02:44:06 1998 t/mailboxes/mailarc-1.txt:792:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:793: id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 t/mailboxes/mailarc-1.txt:794:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) t/mailboxes/mailarc-1.txt:795: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 t/mailboxes/mailarc-1.txt:796: for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) t/mailboxes/mailarc-1.txt:797:Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) t/mailboxes/mailarc-1.txt:798: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 t/mailboxes/mailarc-1.txt:799: for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) t/mailboxes/mailarc-1.txt:800:Message-Id: <199807010601.XAA26862@mail3.sirius.com> t/mailboxes/mailarc-1.txt:801:From: "Aaron Edsinger" t/mailboxes/mailarc-1.txt:802:To: "handy" t/mailboxes/mailarc-1.txt:803:Subject: Serial Interface t/mailboxes/mailarc-1.txt:804:Date: Wed, 1 Jul 1998 02:06:39 +0100 t/mailboxes/mailarc-1.txt:805:X-Msmail-Priority: Normal t/mailboxes/mailarc-1.txt:806:X-Priority: 3 t/mailboxes/mailarc-1.txt:807:X-Mailer: Microsoft Internet Mail 4.70.1162 t/mailboxes/mailarc-1.txt:808:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:809:Content-Type: text/plain; charset=ISO-8859-1 t/mailboxes/mailarc-1.txt:810:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:811: t/mailboxes/mailarc-1.txt:812:Hello, t/mailboxes/mailarc-1.txt:813: I've been having some problems using my HandyBoard to talk directly to my t/mailboxes/mailarc-1.txt:814:PC via the serial interface. I disable Interactive C and then Poke() and t/mailboxes/mailarc-1.txt:815:Peek() as has been described on this list. I send short character strings t/mailboxes/mailarc-1.txt:816:from my PC to the HandyBoard under Windows 95. If I send strings longer t/mailboxes/mailarc-1.txt:817:than 2 characters, it seems that some of the characters get lost. This t/mailboxes/mailarc-1.txt:818:behavior seems to be affected by repositioning or slightly modifying the t/mailboxes/mailarc-1.txt:819:code, suggesting perhaps a timing issue. t/mailboxes/mailarc-1.txt:820: t/mailboxes/mailarc-1.txt:821:Why might this be? Is there any way to check for an error situation? t/mailboxes/mailarc-1.txt:822: t/mailboxes/mailarc-1.txt:823:Thanks for any help, t/mailboxes/mailarc-1.txt:824: Aaron t/mailboxes/mailarc-1.txt:825:From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 t/mailboxes/mailarc-1.txt:826:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:827: id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 t/mailboxes/mailarc-1.txt:828:Received: from hq.freegate.com ([208.226.86.1]) t/mailboxes/mailarc-1.txt:829: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 t/mailboxes/mailarc-1.txt:830: for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) t/mailboxes/mailarc-1.txt:831:Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 t/mailboxes/mailarc-1.txt:832:Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) t/mailboxes/mailarc-1.txt:833: by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 t/mailboxes/mailarc-1.txt:834:Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> t/mailboxes/mailarc-1.txt:835:Date: Wed, 15 Jul 1998 23:21:14 -0700 t/mailboxes/mailarc-1.txt:836:From: Chuck McManis t/mailboxes/mailarc-1.txt:837:Reply-To: cmcmanis@freegate.com t/mailboxes/mailarc-1.txt:838:Organization: Freegate Corporation t/mailboxes/mailarc-1.txt:839:X-Mailer: Mozilla 4.04 [en] (Win95; I) t/mailboxes/mailarc-1.txt:840:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:841:To: David Rye t/mailboxes/mailarc-1.txt:842:Cc: handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:843:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:844:References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> t/mailboxes/mailarc-1.txt:845:Content-Type: text/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:846:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:847: t/mailboxes/mailarc-1.txt:848:Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the t/mailboxes/mailarc-1.txt:849:handyboard library from their site. t/mailboxes/mailarc-1.txt:850: t/mailboxes/mailarc-1.txt:851:--Chuck t/mailboxes/mailarc-1.txt:852: t/mailboxes/mailarc-1.txt:853:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 t/mailboxes/mailarc-1.txt:854:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:855: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 t/mailboxes/mailarc-1.txt:856:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) t/mailboxes/mailarc-1.txt:857: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 t/mailboxes/mailarc-1.txt:858: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) t/mailboxes/mailarc-1.txt:859:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 t/mailboxes/mailarc-1.txt:860:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 t/mailboxes/mailarc-1.txt:861: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 t/mailboxes/mailarc-1.txt:862:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:863: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 t/mailboxes/mailarc-1.txt:864:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> t/mailboxes/mailarc-1.txt:865:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) t/mailboxes/mailarc-1.txt:866:From: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:867:Reply-To: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:868:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:869:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au t/mailboxes/mailarc-1.txt:870:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:871:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:872:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc t/mailboxes/mailarc-1.txt:873: t/mailboxes/mailarc-1.txt:874:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:875:Content-Type: TEXT/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:876:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== t/mailboxes/mailarc-1.txt:877: t/mailboxes/mailarc-1.txt:878:Hi t/mailboxes/mailarc-1.txt:879: t/mailboxes/mailarc-1.txt:880:I suggest that you contact ImageCraft. t/mailboxes/mailarc-1.txt:881:http://www.imagecraft.com/software/index.html or info@imagecraft.com t/mailboxes/mailarc-1.txt:882: t/mailboxes/mailarc-1.txt:883:They have a C compiler for 68HC11 CPU's that will do what you want, including a t/mailboxes/mailarc-1.txt:884:library for the HandyBoard (see attached e-mail) ! t/mailboxes/mailarc-1.txt:885: t/mailboxes/mailarc-1.txt:886:I have no affiliation with ImageCraft (other than as a satisfied customer). t/mailboxes/mailarc-1.txt:887: t/mailboxes/mailarc-1.txt:888:Hope this helps t/mailboxes/mailarc-1.txt:889:Scott t/mailboxes/mailarc-1.txt:890:============================================================================== t/mailboxes/mailarc-1.txt:891: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant t/mailboxes/mailarc-1.txt:892:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com t/mailboxes/mailarc-1.txt:893:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 t/mailboxes/mailarc-1.txt:894: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 t/mailboxes/mailarc-1.txt:895:============================================================================== t/mailboxes/mailarc-1.txt:896: t/mailboxes/mailarc-1.txt:897:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:898:Content-Type: MESSAGE/rfc822; name=Mailbox t/mailboxes/mailarc-1.txt:899:Content-Description: Mailbox t/mailboxes/mailarc-1.txt:900: t/mailboxes/mailarc-1.txt:901:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 t/mailboxes/mailarc-1.txt:902:Return-Path: t/mailboxes/mailarc-1.txt:903:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:904: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 t/mailboxes/mailarc-1.txt:905:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 t/mailboxes/mailarc-1.txt:906: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 t/mailboxes/mailarc-1.txt:907:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) t/mailboxes/mailarc-1.txt:908: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 t/mailboxes/mailarc-1.txt:909: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) t/mailboxes/mailarc-1.txt:910:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 t/mailboxes/mailarc-1.txt:911:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) t/mailboxes/mailarc-1.txt:912:Message-Id: <199807100804.BAA15320@lists1.best.com> t/mailboxes/mailarc-1.txt:913:From: Christina Willrich & Richard Man t/mailboxes/mailarc-1.txt:914:Subject: icc11 Handyboard library available t/mailboxes/mailarc-1.txt:915:Date: Fri, 10 Jul 1998 00:58:49 -0700 t/mailboxes/mailarc-1.txt:916:BestServHost: lists.best.com t/mailboxes/mailarc-1.txt:917:MIME-Version: 1.0 t/mailboxes/mailarc-1.txt:918:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt:919:Sender: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:920:Errors-To: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:921:Reply-To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:922:To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:923:content-length: 399 t/mailboxes/mailarc-1.txt:924:Status: RO t/mailboxes/mailarc-1.txt:925:X-Status: $$$$ t/mailboxes/mailarc-1.txt:926:X-UID: 0000000001 t/mailboxes/mailarc-1.txt:927: t/mailboxes/mailarc-1.txt:928:At long last, I dusted off Chuck McManis Handyboard library and ported it t/mailboxes/mailarc-1.txt:929:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it t/mailboxes/mailarc-1.txt:930:out, point your browser to t/mailboxes/mailarc-1.txt:931: t/mailboxes/mailarc-1.txt:932:ftp://ftp.imagecraft.com/pub/libhb.zip t/mailboxes/mailarc-1.txt:933: t/mailboxes/mailarc-1.txt:934:Chuck really did a great job with the LCD. There are commands to scroll, t/mailboxes/mailarc-1.txt:935:move etc. Make sure you try the lcdtest2.c test. t/mailboxes/mailarc-1.txt:936: t/mailboxes/mailarc-1.txt:937:// richard t/mailboxes/mailarc-1.txt:938:someone@imagecraft.com http://www.imagecraft.com t/mailboxes/mailarc-1.txt:939: t/mailboxes/mailarc-1.txt:940: t/mailboxes/mailarc-1.txt:941:--Troop_of_Baboons_752_000-- t/mailboxes/mailarc-1.txt:942: t/mailboxes/mailarc-1.txt:1142:From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 t/mailboxes/mailarc-1.txt:1143:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1144: id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 t/mailboxes/mailarc-1.txt:1145:Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) t/mailboxes/mailarc-1.txt:1146: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 t/mailboxes/mailarc-1.txt:1147: for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) t/mailboxes/mailarc-1.txt:1148:Received: from localhost (wallace@localhost) t/mailboxes/mailarc-1.txt:1149: by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 t/mailboxes/mailarc-1.txt:1150: for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) t/mailboxes/mailarc-1.txt:1151:Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) t/mailboxes/mailarc-1.txt:1152:From: Mark Wallace t/mailboxes/mailarc-1.txt:1153:To: handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1154:Subject: sonar.c for the handyboard t/mailboxes/mailarc-1.txt:1155:Message-Id: t/mailboxes/mailarc-1.txt:1156:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1157:Content-Type: TEXT/PLAIN; charset=US-ASCII t/mailboxes/mailarc-1.txt:1158: t/mailboxes/mailarc-1.txt:1159:Hello, t/mailboxes/mailarc-1.txt:1160: I have a handyboard and 6500 series poloroid ultrasonic ranging t/mailboxes/mailarc-1.txt:1161:system. I have downloaded the sonar.c programs used to drive the t/mailboxes/mailarc-1.txt:1162:transducer for distance measurements. There appears to be a problem, or t/mailboxes/mailarc-1.txt:1163:atleast I think there is, with it. The sonar device is supposed to give t/mailboxes/mailarc-1.txt:1164:distances of up to 35ft but the TCNC time register is 16 bit and in the t/mailboxes/mailarc-1.txt:1165:program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has t/mailboxes/mailarc-1.txt:1166:elapsed and it returns -1. Therefore as soon as about 32700 counts goes t/mailboxes/mailarc-1.txt:1167:by, that value will go negative. I believe hex goes from 0 to 32768 then t/mailboxes/mailarc-1.txt:1168:-32768 to -1. In this case the difference will be < 0 if the object t/mailboxes/mailarc-1.txt:1169:is greater then about 9 ft. I have taken this out of the program and can t/mailboxes/mailarc-1.txt:1170:get accurate measurements up to atleast 30 ft but I have to look at the t/mailboxes/mailarc-1.txt:1171:value given and add multiples of 2^16 to it to figure out where it is. t/mailboxes/mailarc-1.txt:1172:Taking this out of the program also can get you stuck if you really are t/mailboxes/mailarc-1.txt:1173:out of range. t/mailboxes/mailarc-1.txt:1174: I have looked on the motorola web pages to see about this clock t/mailboxes/mailarc-1.txt:1175:and it says that the clock goes till it reachs $ffff and then flags t/mailboxes/mailarc-1.txt:1176:somewhere that there is an overflow and then starts over. I don't know t/mailboxes/mailarc-1.txt:1177:how to find out were in the chip this information might be stored. I know t/mailboxes/mailarc-1.txt:1178:the TCNT time register is at 0x100e from the notes on Simplified Sonar for t/mailboxes/mailarc-1.txt:1179:the Handy Board but I don't know where that overflow flag is stored. I t/mailboxes/mailarc-1.txt:1180:thought that maybe by setting this flag and using it in the loop you might t/mailboxes/mailarc-1.txt:1181:be about to get a greater distance out of you measurement. t/mailboxes/mailarc-1.txt:1182: Another question I have is about IC. I would like to display t/mailboxes/mailarc-1.txt:1183:numbers greater then 32000 and right now there are several int type t/mailboxes/mailarc-1.txt:1184:variables and normal C comands don't seem to work to make a "long" or any t/mailboxes/mailarc-1.txt:1185:other type that are larger then 32000. How does IC handle larger numbers? t/mailboxes/mailarc-1.txt:1186: I am only a student and don't have much experience with this stuff t/mailboxes/mailarc-1.txt:1187:so I would appreciate any feedback I can get on either of these problems. t/mailboxes/mailarc-1.txt:1188:Thanks. t/mailboxes/mailarc-1.txt:1189: t/mailboxes/mailarc-1.txt:1190:Mark Wallace t/mailboxes/mailarc-1.txt:1191: t/mailboxes/mailarc-1.txt:1192: e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1193: wallace@astro.phys.vt.edu t/mailboxes/mailarc-1.txt:1194:Web page http://sps1.phys.vt.edu/~mwallace/index.html t/mailboxes/mailarc-1.txt:1195: t/mailboxes/mailarc-1.txt:1196:"What a waste it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1197:the dominant organism contrived its own self-destruction" t/mailboxes/mailarc-1.txt:1198: Carl Sagan t/mailboxes/mailarc-1.txt:1199: t/mailboxes/mailarc-1.txt:1200: t/mailboxes/mailarc-1.txt:1274:From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 t/mailboxes/mailarc-1.txt:1275:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1276: id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 t/mailboxes/mailarc-1.txt:1277:Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) t/mailboxes/mailarc-1.txt:1278: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 t/mailboxes/mailarc-1.txt:1279: for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) t/mailboxes/mailarc-1.txt:1280:Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) t/mailboxes/mailarc-1.txt:1281: by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 t/mailboxes/mailarc-1.txt:1282: for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) t/mailboxes/mailarc-1.txt:1283:Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) t/mailboxes/mailarc-1.txt:1284: by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 t/mailboxes/mailarc-1.txt:1285: for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) t/mailboxes/mailarc-1.txt:1286:Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> t/mailboxes/mailarc-1.txt:1287:X-Sender: mawalla3@mail.vt.edu (Unverified) t/mailboxes/mailarc-1.txt:1288:X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) t/mailboxes/mailarc-1.txt:1289:Date: Wed, 12 Aug 1998 12:13:45 -0400 t/mailboxes/mailarc-1.txt:1290:To: Handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1291:From: Mark Wallace t/mailboxes/mailarc-1.txt:1292:Subject: serial library for C++ t/mailboxes/mailarc-1.txt:1293:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1294:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt:1295: t/mailboxes/mailarc-1.txt:1296:Hello, t/mailboxes/mailarc-1.txt:1297: I have a handy board with poloroid transducers and I am trying use the t/mailboxes/mailarc-1.txt:1298:results of my distance measurments in a C++ program on the computer. I t/mailboxes/mailarc-1.txt:1299:have found programs on the handyboard web page that should alow the t/mailboxes/mailarc-1.txt:1300:handyboard to transmit information over the serial line. What I am looking t/mailboxes/mailarc-1.txt:1301:for is if anyone knows were I could find a serial for Microsofts t/mailboxes/mailarc-1.txt:1302:Visual C++ 5.0. I would like to find one that is free or sharware but any t/mailboxes/mailarc-1.txt:1303:information on any serial that will work would be appreciated. t/mailboxes/mailarc-1.txt:1304:Thanks. t/mailboxes/mailarc-1.txt:1305:Mark Wallace t/mailboxes/mailarc-1.txt:1306: t/mailboxes/mailarc-1.txt:1307: e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1308: mwallace@sps1.phys.vt.edu t/mailboxes/mailarc-1.txt:1309:web page http://sps1.phys.vt.ede/~mwallace t/mailboxes/mailarc-1.txt:1310: t/mailboxes/mailarc-1.txt:1311:"What a waist it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1312:the dominant organism contrived its own self-distruction" t/mailboxes/mailarc-1.txt:1313: Carl Sagan t/mailboxes/mailarc-1.txt:1314: t/mailboxes/mailarc-1.txt:1315: t/mailboxes/mailarc-1.txt:1361:From aarone@sirius.com Wed Aug 12 13:42:19 1998 t/mailboxes/mailarc-1.txt:1362:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1363: id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 t/mailboxes/mailarc-1.txt:1364:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) t/mailboxes/mailarc-1.txt:1365: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 t/mailboxes/mailarc-1.txt:1366: for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) t/mailboxes/mailarc-1.txt:1367:Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) t/mailboxes/mailarc-1.txt:1368: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; t/mailboxes/mailarc-1.txt:1369: Wed, 12 Aug 1998 09:48:24 -0700 (PDT) t/mailboxes/mailarc-1.txt:1370:Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> t/mailboxes/mailarc-1.txt:1371:From: "Aaron Edsinger" t/mailboxes/mailarc-1.txt:1372:To: "Mark Wallace" t/mailboxes/mailarc-1.txt:1373:Cc: "handy" t/mailboxes/mailarc-1.txt:1374:Subject: Re: serial library for C++ t/mailboxes/mailarc-1.txt:1375:Date: Wed, 12 Aug 1998 12:53:41 -0700 t/mailboxes/mailarc-1.txt:1376:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1377:Content-Type: text/plain; t/mailboxes/mailarc-1.txt:1378: charset="iso-8859-1" t/mailboxes/mailarc-1.txt:1379:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:1380:X-Priority: 3 t/mailboxes/mailarc-1.txt:1381:X-Msmail-Priority: Normal t/mailboxes/mailarc-1.txt:1382:X-Mailer: Microsoft Outlook Express 4.72.2106.4 t/mailboxes/mailarc-1.txt:1383:X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 t/mailboxes/mailarc-1.txt:1384: t/mailboxes/mailarc-1.txt:1385: t/mailboxes/mailarc-1.txt:1386: Check out this site. It works well. The only problem I had was timing t/mailboxes/mailarc-1.txt:1387:issues when trying to read and write to the port too quickly. t/mailboxes/mailarc-1.txt:1388: t/mailboxes/mailarc-1.txt:1389:http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml t/mailboxes/mailarc-1.txt:1390: t/mailboxes/mailarc-1.txt:1391: t/mailboxes/mailarc-1.txt:1392:-----Original Message----- t/mailboxes/mailarc-1.txt:1393:From: Mark Wallace t/mailboxes/mailarc-1.txt:1394:To: Handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1395:Date: Wednesday, August 12, 1998 9:25 AM t/mailboxes/mailarc-1.txt:1396:Subject: serial library for C++ t/mailboxes/mailarc-1.txt:1397: t/mailboxes/mailarc-1.txt:1398: t/mailboxes/mailarc-1.txt:1399:>Hello, t/mailboxes/mailarc-1.txt:1400:> I have a handy board with poloroid transducers and I am trying use the t/mailboxes/mailarc-1.txt:1401:>results of my distance measurments in a C++ program on the computer. I t/mailboxes/mailarc-1.txt:1402:>have found programs on the handyboard web page that should alow the t/mailboxes/mailarc-1.txt:1403:>handyboard to transmit information over the serial line. What I am looking t/mailboxes/mailarc-1.txt:1404:>for is if anyone knows were I could find a serial library for Microsofts t/mailboxes/mailarc-1.txt:1405:>Visual C++ 5.0. I would like to find one that is free or sharware but any t/mailboxes/mailarc-1.txt:1406:>information on any serial librarys that will work would be appreciated. t/mailboxes/mailarc-1.txt:1407:>Thanks. t/mailboxes/mailarc-1.txt:1408:>Mark Wallace t/mailboxes/mailarc-1.txt:1409:> t/mailboxes/mailarc-1.txt:1410:> e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1411:> mwallace@sps1.phys.vt.edu t/mailboxes/mailarc-1.txt:1412:>web page http://sps1.phys.vt.ede/~mwallace t/mailboxes/mailarc-1.txt:1413:> t/mailboxes/mailarc-1.txt:1414:>"What a waist it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1415:>the dominant organism contrived its own self-distruction" t/mailboxes/mailarc-1.txt:1416:> Carl Sagan t/mailboxes/mailarc-1.txt:1417:> t/mailboxes/mailarc-1.txt:1418: t/mailboxes/mailarc-1.txt:1419:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 t/mailboxes/mailarc-1.txt:1420:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1421: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 t/mailboxes/mailarc-1.txt:1422:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) t/mailboxes/mailarc-1.txt:1423: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 t/mailboxes/mailarc-1.txt:1424: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) t/mailboxes/mailarc-1.txt:1425:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 t/mailboxes/mailarc-1.txt:1426:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 t/mailboxes/mailarc-1.txt:1427: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 t/mailboxes/mailarc-1.txt:1428:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:1429: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 t/mailboxes/mailarc-1.txt:1430:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> t/mailboxes/mailarc-1.txt:1431:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) t/mailboxes/mailarc-1.txt:1432:From: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:1433:Reply-To: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:1434:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:1435:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au t/mailboxes/mailarc-1.txt:1436:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1437:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1438:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc t/mailboxes/mailarc-1.txt:1439: t/mailboxes/mailarc-1.txt:1440:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1441:Content-Type: TEXT/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:1442:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== t/mailboxes/mailarc-1.txt:1443: t/mailboxes/mailarc-1.txt:1444:Hi t/mailboxes/mailarc-1.txt:1445: t/mailboxes/mailarc-1.txt:1446:I suggest that you contact ImageCraft. t/mailboxes/mailarc-1.txt:1447:http://www.imagecraft.com/software/index.html or info@imagecraft.com t/mailboxes/mailarc-1.txt:1448: t/mailboxes/mailarc-1.txt:1449:They have a C compiler for 68HC11 CPU's that will do what you want, including a t/mailboxes/mailarc-1.txt:1450:library for the HandyBoard (see attached e-mail) ! t/mailboxes/mailarc-1.txt:1451: t/mailboxes/mailarc-1.txt:1452:I have no affiliation with ImageCraft (other than as a satisfied customer). t/mailboxes/mailarc-1.txt:1453: t/mailboxes/mailarc-1.txt:1454:Hope this helps t/mailboxes/mailarc-1.txt:1455:Scott t/mailboxes/mailarc-1.txt:1456:============================================================================== t/mailboxes/mailarc-1.txt:1457: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant t/mailboxes/mailarc-1.txt:1458:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com t/mailboxes/mailarc-1.txt:1459:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 t/mailboxes/mailarc-1.txt:1460: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 t/mailboxes/mailarc-1.txt:1461:============================================================================== t/mailboxes/mailarc-1.txt:1462: t/mailboxes/mailarc-1.txt:1463:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1464:Content-Type: MESSAGE/rfc822; name=Mailbox t/mailboxes/mailarc-1.txt:1465:Content-Description: Mailbox t/mailboxes/mailarc-1.txt:1466: t/mailboxes/mailarc-1.txt:1467:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 t/mailboxes/mailarc-1.txt:1468:Return-Path: t/mailboxes/mailarc-1.txt:1469:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:1470: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 t/mailboxes/mailarc-1.txt:1471:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 t/mailboxes/mailarc-1.txt:1472: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 t/mailboxes/mailarc-1.txt:1473:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) t/mailboxes/mailarc-1.txt:1474: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 t/mailboxes/mailarc-1.txt:1475: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) t/mailboxes/mailarc-1.txt:1476:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 t/mailboxes/mailarc-1.txt:1477:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) t/mailboxes/mailarc-1.txt:1478:Message-Id: <199807100804.BAA15320@lists1.best.com> t/mailboxes/mailarc-1.txt:1479:From: Christina Willrich & Richard Man t/mailboxes/mailarc-1.txt:1480:Subject: icc11 Handyboard library available t/mailboxes/mailarc-1.txt:1481:Date: Fri, 10 Jul 1998 00:58:49 -0700 t/mailboxes/mailarc-1.txt:1482:BestServHost: lists.best.com t/mailboxes/mailarc-1.txt:1483:MIME-Version: 1.0 t/mailboxes/mailarc-1.txt:1484:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt:1485:Sender: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:1486:Errors-To: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:1487:Reply-To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:1488:To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:1489:content-length: 399 t/mailboxes/mailarc-1.txt:1490:Status: RO t/mailboxes/mailarc-1.txt:1491:X-Status: $$$$ t/mailboxes/mailarc-1.txt:1492:X-UID: 0000000001 t/mailboxes/mailarc-1.txt:1493: t/mailboxes/mailarc-1.txt:1494:At long last, I dusted off Chuck McManis Handyboard library and ported it t/mailboxes/mailarc-1.txt:1495:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it t/mailboxes/mailarc-1.txt:1496:out, point your browser to t/mailboxes/mailarc-1.txt:1497: t/mailboxes/mailarc-1.txt:1498:ftp://ftp.imagecraft.com/pub/libhb.zip t/mailboxes/mailarc-1.txt:1499: t/mailboxes/mailarc-1.txt:1500:Chuck really did a great job with the LCD. There are commands to scroll, t/mailboxes/mailarc-1.txt:1501:move etc. Make sure you try the lcdtest2.c test. t/mailboxes/mailarc-1.txt:1502: t/mailboxes/mailarc-1.txt:1503:// richard t/mailboxes/mailarc-1.txt:1504:someone@imagecraft.com http://www.imagecraft.com t/mailboxes/mailarc-1.txt:1505: t/mailboxes/mailarc-1.txt:1506: t/mailboxes/mailarc-1.txt:1507:--Troop_of_Baboons_752_000-- t/mailboxes/mailarc-1.txt:1508: t/mailboxes/mailarc-2.txt:156:From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 t/mailboxes/mailarc-2.txt:157:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-2.txt:158: id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 t/mailboxes/mailarc-2.txt:159:Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) t/mailboxes/mailarc-2.txt:160: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 t/mailboxes/mailarc-2.txt:161: for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) t/mailboxes/mailarc-2.txt:162:Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) t/mailboxes/mailarc-2.txt:163: by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 t/mailboxes/mailarc-2.txt:164: for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) t/mailboxes/mailarc-2.txt:165:Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) t/mailboxes/mailarc-2.txt:166:From: David Kott t/mailboxes/mailarc-2.txt:167:Sender: dakott@kott.my.domain t/mailboxes/mailarc-2.txt:168:To: handyboard@media.mit.edu t/mailboxes/mailarc-2.txt:169:Subject: Re: Digital outputs. t/mailboxes/mailarc-2.txt:170:In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> t/mailboxes/mailarc-2.txt:171:Message-Id: t/mailboxes/mailarc-2.txt:172:Mime-Version: 1.0 t/mailboxes/mailarc-2.txt:173:Content-Type: TEXT/PLAIN; charset=US-ASCII t/mailboxes/mailarc-2.txt:174: t/mailboxes/mailarc-2.txt:175:On Wed, 31 Dec 1997, Tom Brusehaver wrote: t/mailboxes/mailarc-2.txt:176: t/mailboxes/mailarc-2.txt:177: t/mailboxes/mailarc-2.txt:178:> t/mailboxes/mailarc-2.txt:179:> G> Wich are the options to have 3 digital outputs in the handyboard? t/mailboxes/mailarc-2.txt:180:> G> No matter if i have to do little modifications to the Hardware. I t/mailboxes/mailarc-2.txt:181:> G> already know how to conect the keypad if you can tell me how t/mailboxes/mailarc-2.txt:182:> G> obtain 3 outputs.. :) t/mailboxes/mailarc-2.txt:183:> t/mailboxes/mailarc-2.txt:184:> t/mailboxes/mailarc-2.txt:185:> The SPI port is sitting there. I think you can get at 3 outputs from t/mailboxes/mailarc-2.txt:186:> those pins (SD/RD/CLK). t/mailboxes/mailarc-2.txt:187:> t/mailboxes/mailarc-2.txt:188: t/mailboxes/mailarc-2.txt:189: t/mailboxes/mailarc-2.txt:190:yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port t/mailboxes/mailarc-2.txt:191:for a much more extensible I/O system. As you know, SPI uses 4 basic t/mailboxes/mailarc-2.txt:192:control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in t/mailboxes/mailarc-2.txt:193:Embedded Controllers class is hook up a Serial In/Parallel Out t/mailboxes/mailarc-2.txt:194:(hereforward referred to as a SIPO) shift register. You must have at t/mailboxes/mailarc-2.txt:195:least ONE output available, so, this pretty much eliminates a L293 or, if t/mailboxes/mailarc-2.txt:196:you are bold enough, obtain additional outputs using a '138 as outlined in t/mailboxes/mailarc-2.txt:197:the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. t/mailboxes/mailarc-2.txt:198: t/mailboxes/mailarc-2.txt:199:Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the t/mailboxes/mailarc-2.txt:200:SPI's CLK output to the SIPO's clock pin. Use a transparent latch to t/mailboxes/mailarc-2.txt:201:update and hold the data on the outputs of the SIPO and update it with the t/mailboxes/mailarc-2.txt:202:one output pin, perhaps a 74373. t/mailboxes/mailarc-2.txt:203: t/mailboxes/mailarc-2.txt:204:To update the new 8 bits of data appearing at your latch's output, you load t/mailboxes/mailarc-2.txt:205:the SPI's data register with the byte value that you want to have across t/mailboxes/mailarc-2.txt:206:your new outputs. This data will be shifted out during the next 8 E-clock t/mailboxes/mailarc-2.txt:207:cycles. After the SPI's data register is empty indicating that the SIPO t/mailboxes/mailarc-2.txt:208:has the output byte on it's parallel outputs, pulse the single control t/mailboxes/mailarc-2.txt:209:output to update the latch's outputs. t/mailboxes/mailarc-2.txt:210: t/mailboxes/mailarc-2.txt:211:With this arrangement, you could, in theory, have many, many SIPO shift t/mailboxes/mailarc-2.txt:212:register/Latch pairs; the Serial Data In of the next stage connected to t/mailboxes/mailarc-2.txt:213:the last Parallel Output on the previous adjacent stage. t/mailboxes/mailarc-2.txt:214: t/mailboxes/mailarc-2.txt:215:One would just have to make sure that you coordinated the number of stages t/mailboxes/mailarc-2.txt:216:with the number of bytes outshifted by the SPI data register (naturally). t/mailboxes/mailarc-2.txt:217:The downside to this arrangement is the time it takes to update a digital t/mailboxes/mailarc-2.txt:218:output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be t/mailboxes/mailarc-2.txt:219:loaded and shifted out to change just ONE output. The upside is, the data t/mailboxes/mailarc-2.txt:220:will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update t/mailboxes/mailarc-2.txt:221:time. Not suitable for time critical applications, (PWM, Communication) t/mailboxes/mailarc-2.txt:222:but not bad for bulk outputs. t/mailboxes/mailarc-2.txt:223: t/mailboxes/mailarc-2.txt:224:I don't think I have explained my little circuit here very well.. perhaps t/mailboxes/mailarc-2.txt:225:an ASCII graphic? t/mailboxes/mailarc-2.txt:226: t/mailboxes/mailarc-2.txt:227: Output originally going to an L293D t/mailboxes/mailarc-2.txt:228: +---------------------------------------+ t/mailboxes/mailarc-2.txt:229: |Or added via a '138 from the | t/mailboxes/mailarc-2.txt:230: |expansion buss. | t/mailboxes/mailarc-2.txt:231: | +--+----+ t/mailboxes/mailarc-2.txt:232:+----+---------+ +---------+ | LE | t/mailboxes/mailarc-2.txt:233:| | SPI CLK |'164 PO0|----| '373 |---- t/mailboxes/mailarc-2.txt:234:| +-----------+ CP PO1|----| |---- t/mailboxes/mailarc-2.txt:235:| 68HC11 | SPI MOSI | PO2|----| |---- t/mailboxes/mailarc-2.txt:236:| +-----------+ Data PO3|----| |---- New t/mailboxes/mailarc-2.txt:237:| | | PO4|----| |---- Digital t/mailboxes/mailarc-2.txt:238:+--------------+ | PO5|----| |---- Outputs t/mailboxes/mailarc-2.txt:239: | PO6|----| |---- t/mailboxes/mailarc-2.txt:240: | PO7|----| |---- t/mailboxes/mailarc-2.txt:241: +---------+ +-------+ t/mailboxes/mailarc-2.txt:242: t/mailboxes/mailarc-2.txt:243: t/mailboxes/mailarc-2.txt:244:Where: t/mailboxes/mailarc-2.txt:245: PO# is a "Parallel Output" on a SIPO t/mailboxes/mailarc-2.txt:246: Data is the "Serial Data Input" on a SIPO t/mailboxes/mailarc-2.txt:247: CP is the SIPO's clock t/mailboxes/mailarc-2.txt:248: t/mailboxes/mailarc-2.txt:249: t/mailboxes/mailarc-2.txt:250: -d t/mailboxes/mailarc-2.txt:251: t/mailboxes/mailarc-2.txt:252: t/mailboxes/mailarc-2.txt:253:Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to t/mailboxes/mailarc-2.txt:254:an 8 bit operating system originally coded for a 4 bit microprocessor, t/mailboxes/mailarc-2.txt:255:written by a 2 bit company that can't stand 1 bit of competition. -UGU t/mailboxes/mailarc-2.txt:256: t/mailboxes/mailarc-2.txt:257: t/mailboxes/mailarc-2.txt:258: grepmail-5.3111/t/results/date_manip000644 000765 000024 00000106555 12504145755 020061 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/mime_attachments000644 000765 000024 00000017111 13316204622 021256 0ustar00coppitstaff000000 000000 From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/date_1000644 000765 000024 00000127025 12504145755 017110 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/count_handy000644 000765 000024 00000000072 12504145755 020256 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1.txt: 6 t/mailboxes/mailarc-2.txt: 1 grepmail-5.3111/t/results/date_august000644 000765 000024 00000016460 12504145755 020260 0ustar00coppitstaff000000 000000 From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > grepmail-5.3111/t/results/unique_body_imagecraft000644 000765 000024 00000000000 12504145755 022437 0ustar00coppitstaff000000 000000 grepmail-5.3111/t/results/unique_all_2000644 000765 000024 00000170602 12504145755 020331 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 WETDST Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 MEST Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com From someone2@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com2> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available 2 Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/no_such_file000644 000765 000024 00000000111 12504145755 020372 0ustar00coppitstaff000000 000000 grepmail: Can't open no_such_file: [No such file or directory], skipping grepmail-5.3111/t/results/header_handy_dos000644 000765 000024 00000024226 12504145755 021232 0ustar00coppitstaff000000 000000 From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/date_invalid000644 000765 000024 00000000731 12504145755 020370 0ustar00coppitstaff000000 000000 From joe.user@example.com Mon May 23 17:52:55 2005 Return-Path: X-Original-To: joe.user@example.com Delivered-To: joe.user@example.com Received: by smtp.example.com (Postfix, from userid 1026) id AF04B83C601; Mon, 23 May 2005 17:52:55 -0400 (EDT) To: joe.user@example.com Subject: test Message-Id: <20050523215255.AF04B83C601@smtp.example.com> Date: Mon, 11 May 2005 17:52:54 dR From: joe.user@example.com (Joe User) Mon May 23 17:52:55 EDT 2005 grepmail-5.3111/t/results/count_handy_dos000644 000765 000024 00000000076 12504145755 021127 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1-dos.txt: 6 t/mailboxes/mailarc-2.txt: 1 grepmail-5.3111/t/results/header_handy000644 000765 000024 00000023670 12504145755 020367 0ustar00coppitstaff000000 000000 From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/size_2000644 000765 000024 00000151761 12504145755 017152 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/not_handy000644 000765 000024 00000074012 12504145755 017733 0ustar00coppitstaff000000 000000 From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/list_handy000644 000765 000024 00000000064 12504145755 020102 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-2.txt grepmail-5.3111/t/results/not_body_handy000644 000765 000024 00000077620 12504145755 020760 0ustar00coppitstaff000000 000000 From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/unique_body000644 000765 000024 00000015366 12504145755 020302 0ustar00coppitstaff000000 000000 From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/match_word_let000644 000765 000024 00000036704 12504145755 020751 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c grepmail-5.3111/t/results/size_handy000644 000765 000024 00000003606 12504145755 020106 0ustar00coppitstaff000000 000000 From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan grepmail-5.3111/t/results/all_handy_blank000644 000765 000024 00000036704 12504145755 021060 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c grepmail-5.3111/t/results/size_3000644 000765 000024 00000000000 12504145755 017126 0ustar00coppitstaff000000 000000 grepmail-5.3111/t/results/body_handy000644 000765 000024 00000076721 12504145755 020101 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/not_header_body_handy000644 000765 000024 00000156457 12504145755 022276 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From goldt@et.byu.edu Tue Jul 7 20:33:03 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA32480; Tue, 7 Jul 1998 20:33:03 -0400 Received: from wormwood.ee.byu.edu (wormwood.ee.byu.edu [128.187.30.54]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30127 for ; Tue, 7 Jul 1998 19:48:43 -0400 (EDT) Received: from wormwood (localhost [127.0.0.1]) by wormwood.ee.byu.edu with SMTP (8.7.6/8.7.1) id RAA26916 for ; Tue, 7 Jul 1998 17:48:42 -0600 (MDT) Sender: goldt@ee.byu.edu Message-Id: <35A2B3D9.1260@et.byu.edu> Date: Tue, 07 Jul 1998 17:48:41 -0600 From: "Timothy B. Gold" X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/780) Mime-Version: 1.0 To: handyboard@media.mit.edu Subject: Interrupt Handler for Serial communication Content-Type: multipart/mixed; boundary="------------18CC6AC44E2E" This is a multi-part message in MIME format. --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Here's a bit of code that will buffer incoming serial information so that no information will be lost when transmitting to the handy board. There are two files: serial_isr.c and serial_isr.asm. You'll need to assemble the .asm file using as11_ic, and then both the .c file and the .icb file need to be loaded onto the handy board. I'm sure improvements could be made to the code to clean it up a little, but it's a start (and I haven't had any problems with it yet). Enjoy! --------------18CC6AC44E2E Content-Type: text/plain; charset=us-ascii; name="serial_isr.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="serial_isr.c" /* C program to read serial port with interrupt service routine */ /* First version: Written by Anton Wirsch 20 Nov 1997 */ /* Second Version: Written by Tim Gold 27 May 1998 BYU Robotics Lab goldt@et.byu.edu Really, the only thing left from the original code are a few lines in the .asm file. Everything else I pretty much had to rewrite from scratch to get it to work the way I wanted to. But the orignal code by Anton was a very helpful starting point. Needed files: serial_isr.c serial_isr.icb serial_isr.asm (needed to change the buffer size) The buffer size here is 32 bytes (probably much larger than it needs to be.) To change the buffer size, do the following: 1. Change the BUFFER_SIZE constant below to the desired number of bytes. 2. Edit the line(s) in the serial_isr.asm which contain the word "EDIT" in the comment so that the value matches that of BUFFER_SIZE. 3. Recreate the serial_isr.icb file by typing the following: > as11_ic serial_isr.asm */ #define BUFFER_SIZE 32 /* change buffer size here -- see above */ /* various constants used by the program... */ #define BAUD 0x102b /* baud rate set to 9600 */ #define SCCR2 0x102d #define SCCR1 0x102c #define SCSR 0x102e #define SCDR 0x102f int buffer[BUFFER_SIZE]; /* this is the actual buffer */ void initSerial() { /* Call this routine to activate the serial interrupt handler. */ int i,temp; /* clear out buffer */ for(i=0; i as11_ic serial_isr.asm */ /* change this line to match your library path... */ #include "/usr/local/ic/libs/6811regs.asm" ORG MAIN_START variable_CURRENT: FDB 00 * ptr to next data to be read by user variable_INCOMING: FDB 00 * number of bytes received (circular count) variable_BASE_ADDR: FDB 00 * base address of buffer (to be set by init routine) variable_DATA_FLAG: FDB 00 * flag set when data is available variable_buffer_ptr: FDB 00 * pointer to CURRENT buffer subroutine_initialize_module: /* change this line to match your library path... */ #include "/usr/local/ic/libs/ldxibase.asm" ldd SCIINT,X std interrupt_code_exit+1 ldd #interrupt_code_start std SCIINT,X rts interrupt_code_start: ldad variable_INCOMING * store INCOMING into AB cmpb #00 * compare B with 0 bhi skip * goto "skip" if (B > 0) ldx variable_BASE_ADDR * STORE ADDRESS OF ARRY IN X inx * SKIP THE FIRST (?) inx * TWO BYTES (?) inx * OFFSET TO THE HIGHER BYTE (?) stx variable_buffer_ptr * SAVE PTR VALUE bra cont skip: ldx variable_buffer_ptr * load buffer pointer into x cont: ldad variable_INCOMING * load INCOMING into AB incb * increment INCOMING cmpb #32 * compare B and 32 --EDIT TO CHANGE BUFFER SIZE-- beq reset_count * if a=32, goto reset_count bra cont1 reset_count: ldad #00 * set count to zero cont1: stad variable_INCOMING * store AB into INCOMING ldab SCSR * load SCSR (SCI status register) into B (why?) ldab SCDR * load SCSR (SCI data register) into B stab ,X * store data in array inx * increment by two bytes inx stx variable_buffer_ptr * save the pointer value ldad #01 * load 1 into AB stad variable_DATA_FLAG * store AB into DATA_FLAG (indicating data is available) interrupt_code_exit: jmp $0000 --------------18CC6AC44E2E-- From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From dakott@alpha.delta.edu Wed Jul 1 05:33:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 for ; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; Tue, 30 Jun 1998 22:34:32 -0400 (EDT) Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) From: David Kott Sender: dakott@kott.my.domain To: brian-c@technologist.com Cc: handyboard@media.mit.edu Subject: Re: microcontroller In-Reply-To: <199806291430.KAA07909@web01.globecomm.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 29 Jun 1998 brian-c@technologist.com wrote: > -I'd like to say thanks to all the folks who replied > to my question on the microcontroller speeds. > > Here's another general question about them though. > Should any unused pins be left open or should they > be grounded? > Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a 4.7K resistor... presuming, of course, that a Logic 0 on that input won't generate adverse effects, e.g. a grounded active low interrupt line might be a problem. Such inputs should be taken to +5 with a 4.7K resistor. Floating CMOS inputs have a tendency to oscillate with the merest whisper of a voltage. TTL inputs may be left floating. Driving an output externally will just heat up your CPU.. or worse. -d -- The box said "Requires Windows 95/NT or better"... So I got Unix. Free the Source. Free your Computer... http://www.FreeBSD.org http://www.NetBSD.org http://www.OpenBSD.org From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mwallace@sps1.phys.vt.edu Mon Aug 3 12:05:51 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA15988; Mon, 3 Aug 1998 12:05:51 -0400 Received: from sps1.phys.vt.edu (sps1.phys.vt.edu [128.173.176.53]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA12381 for ; Mon, 3 Aug 1998 11:16:53 -0400 (EDT) Received: from localhost (mwallace@localhost) by sps1.phys.vt.edu (8.8.7/8.8.7) with SMTP id LAA20283; Mon, 3 Aug 1998 11:16:50 -0400 Date: Mon, 3 Aug 1998 11:16:50 -0400 (EDT) From: Mark Wallace To: alf.kuchenbuch@usa.net Cc: handyboard@media.mit.edu Subject: Re: Polaroid trouble again In-Reply-To: <35C5C521.446B@eikon.e-technik.tu-muenchen.de> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I had this same problem when I got mine a few weeks ago. I ended up putting a capacitor from pin 1 to pin 3 on U2 of the sonar driver board. I also had to take out the 1k resistor from the BINH. It kept BINH at 1 V instead of Zero and that seamed to cause problems. As for the 6 ft problem, it should be closer to 9 ft. I think the problem there is the IC code you used. If you used the code for SONAR.C from the HB web site then there is a problem with it. What that program does is take the difference in time from the internal clock. the problem is that in the code it says that if the difference between start time and currnet time is negative too much time has elapsed. Well, this has a 16 bit counter so when the difference is greater the about 32,700 it becomes negative. If you do the math, that means at about 9 ft that happens so it tell you you are out of range. The way I fixed this was to slow the clock down. I looked up information on the motorola web page and found where the prescalers were for the clock. If you want to slow it down by a factor of four you can just add this line to you program in sonar_init() bit_set(0x1024, 1); I believe bit_set(0x1024, 2); will slow it down by a factor of 8 and bit_set(0x1024, 3); will slow it down by a factor of 16. There are better ways of fixing this problem but they appear much more complicated. For example the motorola chip has an overflow flag that says when the internal clock flips. You could incorporate that into your code instead of slowing the clock down. Good luck and I hope this helps. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan On Mon, 3 Aug 1998, Alf Kuchenbuch wrote: > Hi! > I am having trouble with my Polaroid sonar: > When I keep my HB hooked up > to external power, I will only get correct readings up to 20 inches. As > soon as I use battery power without hooking it up to external power, the > readings are correct up to 6 feet, not more! This sound like EMI, I > guess. I tried all the capacitor tricks from HB mailing list, but in > vain. Do you know a fix that works? > > Alf H. Kuchenbuch > From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Sep 30 12:35:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v4.0/1.1/06Jun95-8.2MPM) id AA09172; Wed, 30 Sep 1998 12:35:05 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id KAA02849 for ; Wed, 30 Sep 1998 10:46:53 -0400 (EDT) Received: from aarone (ppp-asfm03--129.sirius.net [205.134.240.129]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id HAA08635; Wed, 30 Sep 1998 07:46:49 -0700 (PDT) Message-Id: <008901bdec9a$76f469d0$63f186cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Keith - Lui" Cc: "handy" Subject: Re: output to file Date: Wed, 30 Sep 1998 10:47:58 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Yes, Write a dos/windows client that reads the serial line and then writes it to file using the C stdio library. -----Original Message----- From: Keith - Lui To: handyboard@media.mit.edu Date: Wednesday, September 30, 1998 6:55 AM Subject: output to file >Dear all, > >I would like to output some HB data to a file, is that possible? > >Keith > From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From brian-c@technologist.com Mon Jul 6 11:54:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 for ; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) From: brian-c@technologist.com Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) Message-Id: <199807062324.TAA03097@web04.globecomm.net> Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" Mime-Version: 1.0 To: Terri A Mortvedt , handyboard@media.mit.edu Subject: Re: Steppers --0-0-0-0-0-0-0-0-____====$%& Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 Dear Terri, If the motors turn sparatically, that means the coils are probably not hooked up in the correct order. Try swapping them around and see if anything improves. The motors you are using are the bipolar type. There=20 is a decent way of hooking up unipolar steppers to the HB at http://www.cctc.demon.co.uk/stepper.htm A basic difference between bipolar and unipolar is that unipolar motors have additional wires are=20 connected to the power supply. Bipolars also have more torque. Using fd(); and bk(); commands to power steppers is probably a lot to handle. I recommend trying the=20 method found on that link. There's even sample coding. You will have to modify some variables for the turn functions because your turning radius varies according to your distance between motors. I modified the step(); function to produce a gradual=20 increase in speed, and a gradual decrease in speed once the specified steps are almost complete.=20 I will attach my motors.c file as is. _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF Brian Carvalho [ brian-c@ieee.org ] DeVRY Institute New Jersey _________________________________________________ =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF --------------------------------------------------- Get free personalized email at http://www.iname.com --0-0-0-0-0-0-0-0-____====$%& Content-Type: application/octet-stream Content-disposition: inline; filename=Motors.c Content-Transfer-Encoding: base64 LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2xfYnl0ZSArPSByaWdodF9z dGVwX3RhYmxlW3JpZ2h0X21vdG9yX3BvaW50ZXJdOw0KCQkJcG9rZSgweDBlLGNvbnRyb2xfYnl0 ZSk7DQp9DQoNCnZvaWQgcmlnaHRfc3RlcChpbnQgZGlyZWN0aW9uKSAgICAgICAgICAgICAgICAg IC8qIHJpZ2h0IG1vdG9yIGNvbnRyb2wgKi8NCnsNCgkJCWlmIChkaXJlY3Rpb24gPT0gRk9SV0FS RFMpDQoJCQkJCSAgcmlnaHRfbW90b3JfcG9pbnRlciArPTE7DQoJCQllbHNlDQoJCQkJCSAgcmln aHRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVuZ3RoIC0gMSk7DQoNCgkJCXJpZ2h0X21vdG9y X3BvaW50ZXIgJj0gKGN5Y2xlX2xlbmd0aCAtIDEpOw0KDQp9DQoNCnZvaWQgbGVmdF9zdGVwKGlu dCBkaXJlY3Rpb24pICAgICAgICAgICAgICAgICAgIC8qIGxlZnQgbW90b3IgY29udHJvbCovDQp7 DQoJCQlpZiAoZGlyZWN0aW9uID09IEZPUldBUkRTKQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRl ciArPSAxOw0KCQkJZWxzZQ0KCQkJCQkgIGxlZnRfbW90b3JfcG9pbnRlciArPSAoY3ljbGVfbGVu Z3RoIC0gMSk7DQoNCgkJCWxlZnRfbW90b3JfcG9pbnRlciAmPSAoY3ljbGVfbGVuZ3RoIC0gMSk7 DQoNCn0NCg0Kdm9pZCBhYm91dF9mYWNlKGludCBkaXIpICAgICAgICAgICAgICAgIC8qIDE4MCBk ZWdyZWUgdHVybiBvbiBhIGRpbWUgKi8NCnsNCglpbnQgaTsNCg0KCWlmIChkaXIgPT0gUklHSFQp DQoJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2krKykNCgkJew0KCQkJbGVmdF9zdGVwKEZPUldBUkRT KTsNCgkJCXJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXN0ZXBwZXJzX291dCgpOw0KCQkJbXNs ZWVwKFNMT1cpOw0KCQkJYW8oKTsNCgkJIH0NCg0KCSBlbHNlDQoJCSBmb3IgKGk9MDtpPD1IQUxG VFVSTjtpKyspDQoJCSB7DQoJCQlsZWZ0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCXJpZ2h0X3N0ZXAo Rk9SV0FSRFMpOw0KCQkJc3RlcHBlcnNfb3V0KCk7DQoJCQltc2xlZXAoU0xPVyk7DQoJCQlhbygp Ow0KCQkgIH0NCn0NCg0Kdm9pZCByaWdodF90dXJuKCkgICAgICAgICAgICAgICAgICAgICAgIC8q IDkwIGRlZ3JlZSByaWdodCB0dXJuIG9uIGEgZGltZSAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZv ciAoaT0wO2k8PVFVQVJURVJUVVJOO2krKykNCgkJCXsNCgkJCQkJICBsZWZ0X3N0ZXAoRk9SV0FS RFMpOw0KCQkJCQkgIHJpZ2h0X3N0ZXAoQkFDS1dBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQo KTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQkJCSAgYW8oKTsNCgkJCX0NCg0KfQ0KDQp2b2lk IGxlZnRfdHVybigpICAgICAgICAgICAgICAgICAgICAgICAgLyogOTAgZGVncmVlIGxlZnQgdHVy biBvbiBhIGRpbWUgKi8NCnsNCgkJCWludCBpOw0KDQoJCQlmb3IgKGk9MDtpPD1RVUFSVEVSVFVS TjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEJBQ0tXQVJEUyk7DQoJCQkJCSAgcmlnaHRf c3RlcChGT1JXQVJEUyk7DQoJCQkJCSAgc3RlcHBlcnNfb3V0KCk7DQoJCQkJCSAgbXNsZWVwKFNM T1cpOw0KCQkJCQkgIGFvKCk7DQoJCQl9DQp9DQoNCnZvaWQgcmlnaHRfd2hlZWwoKSAgICAgICAg ICAgICAgICAgICAgICAvKiBncmFkdWFsIHJpZ2h0IHR1cm4gKi8NCnsNCgkJCWludCBpOw0KDQoJ CQlmb3IgKGk9MDtpPD1IQUxGVFVSTjtpKyspDQoJCQl7DQoJCQkJCSAgbGVmdF9zdGVwKEZPUldB UkRTKTsNCgkJCQkJICBzdGVwcGVyc19vdXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9 DQp9DQoNCnZvaWQgbGVmdF93aGVlbCgpICAgICAgICAgICAgICAgICAgICAgICAvKiBncmFkdWFs IGxlZnQgdHVybiAqLw0Kew0KCQkJaW50IGk7DQoNCgkJCWZvciAoaT0wO2k8PUhBTEZUVVJOO2kr KykNCgkJCXsNCgkJCQkJICByaWdodF9zdGVwKEZPUldBUkRTKTsNCgkJCQkJICBzdGVwcGVyc19v dXQoKTsNCgkJCQkJICBtc2xlZXAoU0xPVyk7DQoJCQl9DQp9DQoNCg0Kdm9pZCBzdGVwIChpbnQg ZGlyLCBpbnQgbnVtc3RlcHMsIGludCBkZWxheSkNCnsNCiAgICAgICAgaW50IHN0ZXAsc3RwOw0K ICAgICAgICBpbnQgYmVnaW49bnVtc3RlcHMvMTA7DQoJaW50IGNvbnRpbnVlOw0KICAgICAgICBs b25nIGdyYWQ9KGxvbmcpYmVnaW47DQoNCglzeXN0ZW1fcHdtX29mZigpOw0KDQoJZm9yIChzdGVw PTA7c3RlcDxiZWdpbjtzdGVwKyspDQoJew0KCQltc2xlZXAoZ3JhZCk7DQoJCWxlZnRfc3RlcChk aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K --0-0-0-0-0-0-0-0-____====$%&-- grepmail-5.3111/t/results/invalid_date_1000644 000765 000024 00000000053 12504145755 020605 0ustar00coppitstaff000000 000000 grepmail: "armageddon" is not a valid date grepmail-5.3111/t/results/all_handy_dos000644 000765 000024 00000104350 12504145755 020547 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/append_header_dos000644 000765 000024 00000105043 12504145755 021373 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailfolder: t/mailboxes/mailarc-1-dos.txt Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailfolder: t/mailboxes/mailarc-1-dos.txt Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc X-Mailfolder: t/mailboxes/mailarc-1-dos.txt --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Mailfolder: t/mailboxes/mailarc-1-dos.txt Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Mailfolder: t/mailboxes/mailarc-1-dos.txt Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 X-Mailfolder: t/mailboxes/mailarc-1-dos.txt Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc X-Mailfolder: t/mailboxes/mailarc-1-dos.txt --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/none000644 000765 000024 00000000000 12504145755 016671 0ustar00coppitstaff000000 000000 grepmail-5.3111/t/results/no_data000644 000765 000024 00000000044 12504145755 017347 0ustar00coppitstaff000000 000000 grepmail: No data on standard input grepmail-5.3111/t/results/date_3000644 000765 000024 00000027250 12504145755 017111 0ustar00coppitstaff000000 000000 From jrh@jack.securepipe.com Tue Jan 13 03:19:47 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA08834; Tue, 13 Jan 1998 03:19:47 -0500 Received: from splat.securepipe.com (splat.securepipe.com [169.207.51.74]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA00703 for ; Tue, 13 Jan 1998 02:15:36 -0500 (EST) Message-Id: <199801130715.CAA00703@aleve.media.mit.edu> Received: (qmail 7615 invoked from network); 13 Jan 1998 07:23:07 -0000 Received: from jack.securepipe.com (network-user@169.207.51.75) by splat.securepipe.com with SMTP; 13 Jan 1998 07:23:07 -0000 X-Mailer: exmh version 2.0zeta 7/24/97 From: Joshua Heling To: handyboard@media.mit.edu Subject: questions re: unix version of IC Reply-To: Joshua Heling Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Jan 1998 01:23:12 -0600 Sender: jrh@jack.securepipe.com Hi - I'm a handy-board/ic newbie, so please excuse this question if it's answers seem obvious. After two weeks of writing code in DOS/Windows (yuck), I downloaded the ic-2.860beta source code, which compiled without significant trouble in linux (redhat 5). The version is, of course, a bit different from that which came with the handy-board (from Gleason Rsch, was version 2.851). My question is, can I just copy the library files that came from Gleason Rsch. into the lib directory on the unix ic installation (it seems that I can, I just want to be sure)? Are there any other issues I should be aware of (w.r.t. the beta, or using ic from unix, end-of-line conventions on library files, etc.). I'm not particularly concerned with being able to download the pcode in unix - I do have DOS easily available... BTW, thanks to all that have contributed to this really neat project - this is my first exposure to robotics, and it's been great fun so far. ----- Begin Included Message ----- From owner-laser@ns1.qsl.net Thu May 1 09:58:06 1997 X-Authentication-Warning: ns1.qsl.net: majordom set sender to owner-laser@qsl.net using -f From: "Guy Hamblen" To: "Laser" Subject: [LASER] Which Circuit for OPT210? Date: Thu, 1 May 1997 12:53:29 -0400 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-laser@qsl.net Reply-To: "Guy Hamblen" Content-Length: 1037 Thanks everyone for sourcing information on this device. I've got several in hand, feedback resistors are in the mail. Now can I get existing OPT1210 user experience re: the following questions: 1) I assume (dangerous I know...) that the easiest circuit (per the Burr-Brown App Notes) is the Fig. 3 "Single Power Supply Operation"? 2) Is 12v operation recommended? 3) If 12v operation, did you use a 5.6v zener or lower value? 4) Did you use electrolytics to bypass to ground pins 1 & 8? 5) Did you build this circuit in a shielded box? 6) Does the on-board opamp provide sufficient output to drive a set of headphones or did you add another opamp gain circuit? If so what low noise device? Any highpass filter circuits? Is there any need for a bandpass filter circuit to get rid of audio highs? I am using a 3" PVC with a focusing lens (f/4") - - how did you mechanically place the OPT210 so the focused light source falls on the photodiode? My approach would be trial-versus-error.... Thanks in advance....Guy N7UN/2 ----- End Included Message ----- - Joshua -------- Joshua Heling jrh@securepipe.com SecurePipe Communications, Inc. From fredm@ml.media.mit.edu Tue Jan 13 10:41:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA21129; Tue, 13 Jan 1998 10:41:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA22423 for ; Tue, 13 Jan 1998 09:10:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ml.media.mit.edu (8.8.7/8.8.7) with SMTP id JAA26699; Tue, 13 Jan 1998 09:10:37 -0500 (EST) Message-Id: <199801131410.JAA26699@ml.media.mit.edu> X-Authentication-Warning: ml.media.mit.edu: localhost [127.0.0.1] didn't use HELO protocol To: Joshua Heling Cc: handyboard@media.mit.edu Subject: Re: questions re: unix version of IC In-Reply-To: Your message of "Tue, 13 Jan 98 01:23:12 CST." <199801130715.CAA00703@aleve.media.mit.edu> Date: Tue, 13 Jan 98 09:10:37 -0500 From: "Fred G. Martin" X-Mts: smtp Joshua - There should be no problems using the Gleason Research libraries (or any of the libraries that are on the web site). There are no differences between version 2.851 and 2.860 from the point of view of the libraries. There is a pre-compiled version for Linux. See ftp://cher.media.mit.edu/pub/projects/interactive-c/unix/ Fred In your message you said: > Hi - > > I'm a handy-board/ic newbie, so please excuse this question if it's answers > seem obvious. After two weeks of writing code in DOS/Windows (yuck), I > downloaded the ic-2.860beta source code, which compiled without significant > trouble in linux (redhat 5). The version is, of course, a bit different from > that which came with the handy-board (from Gleason Rsch, was version 2.851). > > My question is, can I just copy the library files that came from Gleason Rsch . > into the lib directory on the unix ic installation (it seems that I can, I > just want to be sure)? Are there any other issues I should be aware of > (w.r.t. the beta, or using ic from unix, end-of-line conventions on library > files, etc.). I'm not particularly concerned with being able to download the > pcode in unix - I do have DOS easily available... > > BTW, thanks to all that have contributed to this really neat project - this i s > my first exposure to robotics, and it's been great fun so far. > > > - Joshua > > -------- > Joshua Heling jrh@securepipe.com > SecurePipe Communications, Inc. > > > From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) From: David Kott Sender: dakott@kott.my.domain To: handyboard@media.mit.edu Subject: Re: Digital outputs. In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 31 Dec 1997, Tom Brusehaver wrote: > > G> Wich are the options to have 3 digital outputs in the handyboard? > G> No matter if i have to do little modifications to the Hardware. I > G> already know how to conect the keypad if you can tell me how > G> obtain 3 outputs.. :) > > > The SPI port is sitting there. I think you can get at 3 outputs from > those pins (SD/RD/CLK). > yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port for a much more extensible I/O system. As you know, SPI uses 4 basic control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in Embedded Controllers class is hook up a Serial In/Parallel Out (hereforward referred to as a SIPO) shift register. You must have at least ONE output available, so, this pretty much eliminates a L293 or, if you are bold enough, obtain additional outputs using a '138 as outlined in the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the SPI's CLK output to the SIPO's clock pin. Use a transparent latch to update and hold the data on the outputs of the SIPO and update it with the one output pin, perhaps a 74373. To update the new 8 bits of data appearing at your latch's output, you load the SPI's data register with the byte value that you want to have across your new outputs. This data will be shifted out during the next 8 E-clock cycles. After the SPI's data register is empty indicating that the SIPO has the output byte on it's parallel outputs, pulse the single control output to update the latch's outputs. With this arrangement, you could, in theory, have many, many SIPO shift register/Latch pairs; the Serial Data In of the next stage connected to the last Parallel Output on the previous adjacent stage. One would just have to make sure that you coordinated the number of stages with the number of bytes outshifted by the SPI data register (naturally). The downside to this arrangement is the time it takes to update a digital output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be loaded and shifted out to change just ONE output. The upside is, the data will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update time. Not suitable for time critical applications, (PWM, Communication) but not bad for bulk outputs. I don't think I have explained my little circuit here very well.. perhaps an ASCII graphic? Output originally going to an L293D +---------------------------------------+ |Or added via a '138 from the | |expansion buss. | | +--+----+ +----+---------+ +---------+ | LE | | | SPI CLK |'164 PO0|----| '373 |---- | +-----------+ CP PO1|----| |---- | 68HC11 | SPI MOSI | PO2|----| |---- | +-----------+ Data PO3|----| |---- New | | | PO4|----| |---- Digital +--------------+ | PO5|----| |---- Outputs | PO6|----| |---- | PO7|----| |---- +---------+ +-------+ Where: PO# is a "Parallel Output" on a SIPO Data is the "Serial Data Input" on a SIPO CP is the SIPO's clock -d Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 bit of competition. -UGU From fredm@ml.media.mit.edu Thu Jan 1 10:20:57 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA28944; Thu, 1 Jan 1998 10:20:57 -0500 Received: from ml.media.mit.edu (ml.media.mit.edu [18.85.13.107]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id JAA23720 for ; Thu, 1 Jan 1998 09:41:01 -0500 (EST) Received: (from fredm@localhost) by ml.media.mit.edu (8.8.7/8.8.7) id JAA32741 for handyboard; Thu, 1 Jan 1998 09:41:01 -0500 (EST) From: Fred G Martin Message-Id: <199801011441.JAA32741@ml.media.mit.edu> To: handyboard@media.mit.edu Subject: Re: Digital outputs. Thanks David for a nice explanation of how to add I/O using shift registers. Let us not all forget that the HB does have two uncommitted digital output ASIDE from the four SPI pins: PA7 (a bidirectional pin which is marked as digital input #9) and PA5 (a timer output pin which is marked as TO3 on the expansion header). It would seem silly to disconnect a motor driver signal when these two signals are available. Fred grepmail-5.3111/t/results/body_mime000644 000765 000024 00000017006 12504145755 017714 0ustar00coppitstaff000000 000000 From rshirk@sfgate.com Sun Mar 22 01:52:45 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 for ; Sun, 22 Mar 1998 01:08:09 -0500 (EST) Received: from localhost by cyber.sfgate.com with smtp (Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) From: Richard X-Sender: rshirk@cyber To: handyboard@media.mit.edu Subject: Frob nobs and IR Message-Id: Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII OK...Im now pretty happy with states of things but I still have a few questions I hope you can help me answer. The code attached works and everything, but only when i take the bit about playing the songs out. problem 1) It keeps saying that play is undefined. I saw that before and fixed it by changing the names of the labels of the songs. I tried it this time and it didnt work...i was wondering if anyone out there knows why it does this and how to correct it.... problem 2) I figured out (thanks to you guys) how to work the built in IR sensor to detect and act upon 4 signals. One is for behing hostile, 3 is for seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores it. The signal for being Hostile responds quickly and prints H on the screen but the others lag and i was wondering if you knew why this was. -Richard ---559023410-1804928587-890546857=:21628 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg ICB9DQ0gICB9DX0N ---559023410-1804928587-890546857=:21628-- grepmail-5.3111/t/results/number_1000644 000765 000024 00000112050 12504145755 017453 0ustar00coppitstaff000000 000000 1:From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 2:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 3: id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 4:Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) 5: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 6: for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) 7:Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) 8: by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; 9: Wed, 1 Jul 1998 10:56:30 -0500 (CDT) 10:Sender: dblank@comp.uark.edu 11:Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> 12:Date: Wed, 01 Jul 1998 10:56:30 -0500 13:From: Douglas Blank 14:Organization: University of Arkansas, CS 15:X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) 16:Mime-Version: 1.0 17:To: Aaron Edsinger 18:Cc: handy 19:Subject: Re: Serial Interface 20:References: <199807010601.XAA26862@mail3.sirius.com> 21:Content-Type: text/plain; charset=us-ascii 22:Content-Transfer-Encoding: 7bit 23: 24:Aaron Edsinger wrote: 25: 26:> Hello, 27:> I've been having some problems using my HandyBoard to talk directly to my 28:> PC via the serial interface. I disable Interactive C and then Poke() and 29:> Peek() as has been described on this list. I send short character strings 30:> from my PC to the HandyBoard under Windows 95. If I send strings longer 31:> than 2 characters, it seems that some of the characters get lost. This 32:> behavior seems to be affected by repositioning or slightly modifying the 33:> code, suggesting perhaps a timing issue. 34: 35:Although there is the HEXMON program, I too, have been trying to do what 36:you describe, and encountered the same problems. I found it to be a 37:timing issue, and, through trial and error, have a found some settings 38:that seem to work most of the time. 39: 40:My goal was to make C code that looked the same when compiled and run on 41:the Host is the code that ran under IC. 42: 43:I am including the host and HB programs here. If anyone knows of a 44:better way of communicating, please let us know. 45: 46:-Doug Blank 47: 48:===================================================================== 49:dblank@comp.uark.edu Douglas Blank, University of Arkansas 50:Assistant Professor Computer Science 51:==================== http://www.uark.edu/~dblank ==================== 52: 53:This code was written for MS C++4.0 running on Win95. 54: 55://************** BEGIN: serial_HOST.c 56: 57:/* VC++4.0 HandyBoard Host Programming System 58: Dr. Douglas S. Blank 59: University of Arkansas, Department of Computer Science 60: www.uark.edu/~dblank 61: 62: This code runs on a host PC. 63:*/ 64: 65:#include 66:#include 67:#include 68:#include 69: 70:#include "serial_HOST.h" 71: 72:void main(int argc, char *argv[]) 73:{ 74: motor(0, 100); 75: motor(1, 100); 76: motor(2, 100); 77: motor(3, 100); 78: sleep(1000); 79: motor(0, -100); 80: motor(1, -100); 81: motor(2, -100); 82: motor(3, -100); 83: sleep(1000); 84: ao(); 85: print("\nThis is a test"); 86: printf("Knob is %d\n", knob() ); 87: printf("Analog(0) is %d\n", analog(0)); 88: printf("Digital(0) is %d\n", digital(0)); 89: printf("Analog(1) is %d\n", analog(1)); 90: printf("Digital(1) is %d\n", digital(1)); 91: printf("Analog(2) is %d\n", analog(2)); 92: printf("Digital(2) is %d\n", digital(2)); 93: printf("Analog(3) is %d\n", analog(3)); 94: printf("Digital(3) is %d\n", digital(3)); 95: printf("Analog(4) is %d\n", analog(4)); 96: printf("Digital(4) is %d\n", digital(4)); 97: printf("Analog(5) is %d\n", analog(5)); 98: printf("Digital(5) is %d\n", digital(5)); 99: printf("Analog(6) is %d\n", analog(6)); 100: printf("Digital(6) is %d\n", digital(6)); 101: printf("Analog(7) is %d\n", analog(7)); 102: printf("Digital(7) is %d\n", digital(7)); 103: printf("Analog(8) is %d\n", analog(8)); 104: printf("Digital(8) is %d\n", digital(8)); 105: printf("Analog(9) is %d\n", analog(9)); 106: printf("Digital(9) is %d\n", digital(9)); 107: printf("Analog(10) is %d\n", analog(10)); 108: printf("Digital(10) is %d\n", digital(10)); 109: printf("Analog(11) is %d\n", analog(11)); 110: printf("Digital(11) is %d\n", digital(11)); 111: printf("Analog(12) is %d\n", analog(12)); 112: printf("Digital(12) is %d\n", digital(12)); 113: printf("Analog(13) is %d\n", analog(13)); 114: printf("Digital(13) is %d\n", digital(13)); 115: printf("Analog(14) is %d\n", analog(14)); 116: printf("Digital(14) is %d\n", digital(14)); 117: printf("Analog(15) is %d\n", analog(15)); 118: printf("Digital(15) is %d\n", digital(15)); 119: beep(); 120: sleep(1000); 121: while (! stop_button() ) { 122: sprintf(buffer, "%d.0", (knob() * 10)); 123: tone( buffer, "0.1"); 124: } 125:} 126: 127://************** END: serial_HOST.c 128: 129://************** BEGIN: serial_HOST.h 130: 131:/* VC++4.0 HandyBoard Host Programming System 132: Dr. Douglas S. Blank 133: University of Arkansas, Department of Computer Science 134: www.uark.edu/~dblank 135:*/ 136: 137:#define MOTOR 0 138:#define AO 1 139:#define ANALOG 2 140:#define DIGITAL 3 141:#define PRINTF 4 142:#define KNOB 5 143:#define BEEP 6 144:#define TONE 7 145:#define START_BUTTON 8 146:#define STOP_BUTTON 9 147:#define QUIT 113 148: 149:#define sleep(NUM) _sleep(NUM) 150:#define SERIALWAIT 5 151: 152:unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 153: 154:int send(int i) { 155: int retval; 156: retval = _outp( PORT, i); 157: _sleep(SERIALWAIT); 158: return retval; 159:} 160: 161:int receive() { 162: int retval; 163: retval = _inp( PORT); 164: _sleep(SERIALWAIT); 165: retval = _inp( PORT); 166: return retval; 167:} 168: 169:void hangup() { 170: send(QUIT); 171:} 172: 173:void print(char buffer[]) { 174: int i; 175: send(PRINTF); 176: for (i = 0; buffer[i] != 0; i++) 177: send(buffer[i]); 178: send('\0'); 179:} 180: 181:void motor(int motornum, int power) { 182: send(MOTOR); 183: send(motornum); 184: send(power + 100); // taken off on the other end 185:} 186: 187:int analog(int sensor) { 188: send(ANALOG); 189: send(sensor); 190: return receive(); 191:} 192: 193:int digital(int sensor) { 194: send(DIGITAL); 195: send(sensor); 196: return receive(); 197:} 198: 199:void ao() { 200: send(AO); 201:} 202: 203:int knob() { 204: send(KNOB); 205: return receive(); 206:} 207: 208:void beep() { 209: send(BEEP); 210:} 211: 212:void tone(char f1[], char f2[]) { 213: int i; 214: send(TONE); 215: for (i = 0; f1[i] != 0; i++) 216: send(f1[i]); 217: send('\0'); 218: for (i = 0; f2[i] != 0; i++) 219: send(f2[i]); 220: send('\0'); 221: _sleep((unsigned long) (atof(f2) * 1000)); // to keep from 222:overflowing serial line 223:} 224: 225:void interactive() 226:{ 227: char c; 228: char key = ' '; 229: while (key != 'q') { 230: key = getch(); 231: send(key); 232: printf("Sent %c\n", key); 233: c = receive(); 234: printf("Got %c as a return value\n", c); 235: } 236:} 237: 238:int start_button() { 239: send(START_BUTTON); 240: return receive(); 241:} 242: 243:int stop_button() { 244: send(STOP_BUTTON); 245: return receive(); 246:} 247://************** END: serial_HOST.h 248: 249://************** BEGIN: serial_HB.c 250: 251:/* VC++4.0 HandyBoard Programming System 252: (Parts taken from other HB programs) 253: Dr. Douglas S. Blank 254: University of Arkansas, Department of Computer Science 255: www.uark.edu/~dblank 256: 257: This code runs on the HB 258:*/ 259: 260:#define MOTOR 0 261:#define AO 1 262:#define ANALOG 2 263:#define DIGITAL 3 264:#define PRINTF 4 265:#define KNOB 5 266:#define BEEP 6 267:#define TONE 7 268:#define START_BUTTON 8 269:#define STOP_BUTTON 9 270:#define QUIT 113 271: 272:int _isspace(int a) /* returns 1 for space or tab, 0 273:otherwise */ 274: /* internal routine used by atof() and 275:cgets() */ 276: 277:{ 278: return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ 279:} 280: 281:/*****************************************************************************/ 282: 283:int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ 284: /* internal routine used by atof() */ 285: 286:{ 287: return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ 288:} 289: 290:float atof(char s[]) /* Convert a string containing a number in 291:ASCII */ 292: /* form (integer, float, or exponential float) 293:to a */ 294: /* float. Strips whitespace characters (space 295:and */ 296: /* tab) from the front of the string, but 297:stops */ 298: /* parsing at the first (unexpected) 299:non-numeric */ 300: /* character if the string has garbage at the 301:end. */ 302: /* This means that " 34.3foo78" translates to 303:34.3. */ 304: /* Modified from atof() function in the 305:standard */ 306: /* library of the Hi-Tec C compiler for 307:CP/M. */ 308: /* Note: all string literals converted to 309:decimal */ 310: /* form because IC can't deal with string 311:literals */ 312: /* in math 313:calculations. */ 314: /* Also note: very ugly code because IC will 315:not */ 316: /* allow any math operations on pointers! Thus, 317:the */ 318: /* the number string has to be treated as an 319:array! */ 320: /* Also also note: no error handling; assumes 321:that */ 322: /* the string is a valid representation of a 323:number! */ 324: /* Valid range for exponential-format numbers 325:is */ 326: /* approximately 2.0e-38 to 327:3.4e+38. */ 328: 329:{ 330: int i=0; /* index into string array */ 331: int sign=0; /* mantissa sign flag: 0=positive, 332:1=negative */ 333: int exp0=0; /* mantissa exponent counter */ 334: int eexp=0; /* E-form exponent counter */ 335: int expsign=0; /* exponent sign flag: 0=positive, 336:1=negative */ 337: float m=0.0; /* mantissa accumulator */ 338: 339: /* skip any leading whitespace (space, tab) */ 340: while (_isspace(s[i])) 341: i++; /* skip it */ 342: 343: /* check for mantissa sign */ 344: if (s[i] == 45) /* 45 is '-' */ 345: { 346: sign = 1; /* flag minus sign */ 347: i++; /* point to next */ 348: } 349: else if (s[i] == 43) /* 43 is '+' */ 350: i++; /* point to next */ 351: 352: /* now get all digits up to either a decimal point or an e/E */ 353: while (_isdigit(s[i])) 354: { 355: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 356: i++; /* point to next */ 357: } 358: 359: /* no more digits, so check for decimal point */ 360: if (s[i] == 46) /* 46 is '.' */ 361: { 362: i++; /* point to next */ 363: /* get all digits after decimal point */ 364: while (_isdigit(s[i])) 365: { 366: exp0--; 367: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ 368: i++; /* point to next */ 369: } 370: } 371: 372: /* check for e/E exponential form */ 373: if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ 374: { 375: i++; /* point to next */ 376: /* check for exponent sign */ 377: if (s[i] == 45) /* 45 is '-' */ 378: { 379: expsign = 1; /* flag negative exponent */ 380: i++; /* point to next */ 381: } 382: else if (s[i] == 43) /* 43 is '+' */ 383: i++; /* point to next */ 384: 385: /* now get exponent */ 386: while (_isdigit(s[i])) 387: { 388: eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ 389: i++; /* point to next */ 390: } 391: 392: /* adjust exponent sign */ 393: if (expsign) 394: eexp = -eexp; /* make it negative */ 395: } 396: 397: /* compute absolute value of final float */ 398: exp0 += eexp; 399: while (exp0 < 0) /* for negative exponents */ 400: { 401: m = m / 10.0; 402: exp0++; 403: } 404: while (exp0 > 0) /* for positive exponents */ 405: { 406: m = m * 10.0; 407: exp0--; 408: } 409: 410: /* adjust final float sign from mantissa */ 411: if (sign) 412: return (-m); /* negative */ 413: else 414: return (m); /* positive */ 415:} 416: 417:void disable_pcode_serial() 418:/* necessary to receive characters using serial_getchar */ 419:{ 420: poke(0x3c, 1); 421:} 422: 423:void reenable_pcode_serial() 424:/* necessary for IC to interact with board again */ 425:{ 426: poke(0x3c, 0); 427:} 428: 429:/* 430:====================================================================== 431:For sending and receiving single bytes, you can use Randy's IC code: 432:*/ 433: 434:void serial_putchar(int c) 435:{ 436: while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty 437:*/ 438: poke(0x102f, c); /* send character */ 439:} 440: 441:int serial_getchar() 442:{ 443: while (!(peek(0x102e) & 0x20)); /* wait for received character */ 444: return peek(0x102f); 445:} 446: 447:void main(void) { 448: int pos, c = ' ', var1, var2; 449: float f1, f2; 450: char buffer[80]; 451: disable_pcode_serial(); 452: beep(); 453: printf("\nSerial IO Mode!"); 454: printf("Listening..."); 455: msleep(500L); 456: while (c != 'q') { 457: c = serial_getchar(); 458:/* printf("[%d] ", c); */ 459: if (c == MOTOR) { 460: var1 = serial_getchar(); 461: var2 = serial_getchar() - 100; 462: motor(var1, var2); 463: } else if (c == AO) { 464: ao(); 465: } else if (c == ANALOG) { 466: var1 = serial_getchar(); 467: serial_putchar(analog(var1)); 468: } else if (c == DIGITAL) { 469: var1 = serial_getchar(); 470: serial_putchar(digital(var1)); 471: } else if (c == PRINTF) { 472: pos = 0; 473: while (c != 0) { 474: buffer[pos++] = c; 475: c = serial_getchar(); 476: } 477: buffer[pos] = '\0'; 478: printf(buffer); 479: } else if (c == TONE) { 480: pos = 0; 481: c = serial_getchar(); 482: while (c != 0) { 483: buffer[pos++] = c; 484: c = serial_getchar(); 485: } 486: buffer[pos] = '\0'; 487: f1 = atof(buffer); 488: pos = 0; 489: c = serial_getchar(); 490: while (c != 0) { 491: buffer[pos++] = c; 492: c = serial_getchar(); 493: } 494: buffer[pos] = '\0'; 495: f2 = atof(buffer); 496: tone(f1, f2); 497: } else if (c == START_BUTTON) { 498: serial_putchar(start_button()); 499: } else if (c == STOP_BUTTON) { 500: serial_putchar(stop_button()); 501: } else if (c == BEEP) { 502: beep(); 503: } else if (c == KNOB) { 504: serial_putchar(knob()); 505: } 506: } 507: reenable_pcode_serial(); 508: printf("\nHB Mode!"); 509:} 510: 511://************** END: serial_HB.c 512: 791:From aarone@sirius.com Wed Jul 1 02:44:06 1998 792:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 793: id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 794:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 795: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 796: for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) 797:Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) 798: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 799: for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) 800:Message-Id: <199807010601.XAA26862@mail3.sirius.com> 801:From: "Aaron Edsinger" 802:To: "handy" 803:Subject: Serial Interface 804:Date: Wed, 1 Jul 1998 02:06:39 +0100 805:X-Msmail-Priority: Normal 806:X-Priority: 3 807:X-Mailer: Microsoft Internet Mail 4.70.1162 808:Mime-Version: 1.0 809:Content-Type: text/plain; charset=ISO-8859-1 810:Content-Transfer-Encoding: 7bit 811: 812:Hello, 813: I've been having some problems using my HandyBoard to talk directly to my 814:PC via the serial interface. I disable Interactive C and then Poke() and 815:Peek() as has been described on this list. I send short character strings 816:from my PC to the HandyBoard under Windows 95. If I send strings longer 817:than 2 characters, it seems that some of the characters get lost. This 818:behavior seems to be affected by repositioning or slightly modifying the 819:code, suggesting perhaps a timing issue. 820: 821:Why might this be? Is there any way to check for an error situation? 822: 823:Thanks for any help, 824: Aaron 825:From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 826:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 827: id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 828:Received: from hq.freegate.com ([208.226.86.1]) 829: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 830: for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) 831:Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 832:Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) 833: by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 834:Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> 835:Date: Wed, 15 Jul 1998 23:21:14 -0700 836:From: Chuck McManis 837:Reply-To: cmcmanis@freegate.com 838:Organization: Freegate Corporation 839:X-Mailer: Mozilla 4.04 [en] (Win95; I) 840:Mime-Version: 1.0 841:To: David Rye 842:Cc: handyboard@media.mit.edu 843:Subject: Re: Handyboard/RWP without p-code 844:References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> 845:Content-Type: text/plain; charset=us-ascii 846:Content-Transfer-Encoding: 7bit 847: 848:Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the 849:handyboard library from their site. 850: 851:--Chuck 852: 853:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 854:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 855: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 856:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 857: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 858: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 859:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 860:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 861: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 862:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 863: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 864:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> 865:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 866:From: Scott Seaton - Systems Consultant - ESG 867:Reply-To: Scott Seaton - Systems Consultant - ESG 868:Subject: Re: Handyboard/RWP without p-code 869:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 870:Mime-Version: 1.0 871:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 872:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 873: 874:--Troop_of_Baboons_752_000 875:Content-Type: TEXT/plain; charset=us-ascii 876:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 877: 878:Hi 879: 880:I suggest that you contact ImageCraft. 881:http://www.imagecraft.com/software/index.html or info@imagecraft.com 882: 883:They have a C compiler for 68HC11 CPU's that will do what you want, including a 884:library for the HandyBoard (see attached e-mail) ! 885: 886:I have no affiliation with ImageCraft (other than as a satisfied customer). 887: 888:Hope this helps 889:Scott 890:============================================================================== 891: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 892:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 893:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 894: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 895:============================================================================== 896: 897:--Troop_of_Baboons_752_000 898:Content-Type: MESSAGE/rfc822; name=Mailbox 899:Content-Description: Mailbox 900: 901:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 902:Return-Path: 903:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 904: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 905:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 906: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 907:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 908: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 909: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 910:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 911:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 912:Message-Id: <199807100804.BAA15320@lists1.best.com> 913:From: Christina Willrich & Richard Man 914:Subject: icc11 Handyboard library available 915:Date: Fri, 10 Jul 1998 00:58:49 -0700 916:BestServHost: lists.best.com 917:MIME-Version: 1.0 918:Content-Type: text/plain; charset="us-ascii" 919:Sender: icc11-list-errors@lists.best.com 920:Errors-To: icc11-list-errors@lists.best.com 921:Reply-To: icc11-list@lists.best.com 922:To: icc11-list@lists.best.com 923:content-length: 399 924:Status: RO 925:X-Status: $$$$ 926:X-UID: 0000000001 927: 928:At long last, I dusted off Chuck McManis Handyboard library and ported it 929:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 930:out, point your browser to 931: 932:ftp://ftp.imagecraft.com/pub/libhb.zip 933: 934:Chuck really did a great job with the LCD. There are commands to scroll, 935:move etc. Make sure you try the lcdtest2.c test. 936: 937:// richard 938:someone@imagecraft.com http://www.imagecraft.com 939: 940: 941:--Troop_of_Baboons_752_000-- 942: 1142:From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 1143:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1144: id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 1145:Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) 1146: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 1147: for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) 1148:Received: from localhost (wallace@localhost) 1149: by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 1150: for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1151:Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) 1152:From: Mark Wallace 1153:To: handyboard@media.mit.edu 1154:Subject: sonar.c for the handyboard 1155:Message-Id: 1156:Mime-Version: 1.0 1157:Content-Type: TEXT/PLAIN; charset=US-ASCII 1158: 1159:Hello, 1160: I have a handyboard and 6500 series poloroid ultrasonic ranging 1161:system. I have downloaded the sonar.c programs used to drive the 1162:transducer for distance measurements. There appears to be a problem, or 1163:atleast I think there is, with it. The sonar device is supposed to give 1164:distances of up to 35ft but the TCNC time register is 16 bit and in the 1165:program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has 1166:elapsed and it returns -1. Therefore as soon as about 32700 counts goes 1167:by, that value will go negative. I believe hex goes from 0 to 32768 then 1168:-32768 to -1. In this case the difference will be < 0 if the object 1169:is greater then about 9 ft. I have taken this out of the program and can 1170:get accurate measurements up to atleast 30 ft but I have to look at the 1171:value given and add multiples of 2^16 to it to figure out where it is. 1172:Taking this out of the program also can get you stuck if you really are 1173:out of range. 1174: I have looked on the motorola web pages to see about this clock 1175:and it says that the clock goes till it reachs $ffff and then flags 1176:somewhere that there is an overflow and then starts over. I don't know 1177:how to find out were in the chip this information might be stored. I know 1178:the TCNT time register is at 0x100e from the notes on Simplified Sonar for 1179:the Handy Board but I don't know where that overflow flag is stored. I 1180:thought that maybe by setting this flag and using it in the loop you might 1181:be about to get a greater distance out of you measurement. 1182: Another question I have is about IC. I would like to display 1183:numbers greater then 32000 and right now there are several int type 1184:variables and normal C comands don't seem to work to make a "long" or any 1185:other type that are larger then 32000. How does IC handle larger numbers? 1186: I am only a student and don't have much experience with this stuff 1187:so I would appreciate any feedback I can get on either of these problems. 1188:Thanks. 1189: 1190:Mark Wallace 1191: 1192: e-mail mawalla3@vt.edu 1193: wallace@astro.phys.vt.edu 1194:Web page http://sps1.phys.vt.edu/~mwallace/index.html 1195: 1196:"What a waste it would be after 4 billion tortuous years of evolution if 1197:the dominant organism contrived its own self-destruction" 1198: Carl Sagan 1199: 1200: 1274:From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 1275:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1276: id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 1277:Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) 1278: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 1279: for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) 1280:Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) 1281: by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 1282: for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) 1283:Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) 1284: by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 1285: for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) 1286:Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> 1287:X-Sender: mawalla3@mail.vt.edu (Unverified) 1288:X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) 1289:Date: Wed, 12 Aug 1998 12:13:45 -0400 1290:To: Handyboard@media.mit.edu 1291:From: Mark Wallace 1292:Subject: serial library for C++ 1293:Mime-Version: 1.0 1294:Content-Type: text/plain; charset="us-ascii" 1295: 1296:Hello, 1297: I have a handy board with poloroid transducers and I am trying use the 1298:results of my distance measurments in a C++ program on the computer. I 1299:have found programs on the handyboard web page that should alow the 1300:handyboard to transmit information over the serial line. What I am looking 1301:for is if anyone knows were I could find a serial for Microsofts 1302:Visual C++ 5.0. I would like to find one that is free or sharware but any 1303:information on any serial that will work would be appreciated. 1304:Thanks. 1305:Mark Wallace 1306: 1307: e-mail mawalla3@vt.edu 1308: mwallace@sps1.phys.vt.edu 1309:web page http://sps1.phys.vt.ede/~mwallace 1310: 1311:"What a waist it would be after 4 billion tortuous years of evolution if 1312:the dominant organism contrived its own self-distruction" 1313: Carl Sagan 1314: 1315: 1361:From aarone@sirius.com Wed Aug 12 13:42:19 1998 1362:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1363: id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 1364:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) 1365: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 1366: for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) 1367:Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) 1368: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; 1369: Wed, 12 Aug 1998 09:48:24 -0700 (PDT) 1370:Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> 1371:From: "Aaron Edsinger" 1372:To: "Mark Wallace" 1373:Cc: "handy" 1374:Subject: Re: serial library for C++ 1375:Date: Wed, 12 Aug 1998 12:53:41 -0700 1376:Mime-Version: 1.0 1377:Content-Type: text/plain; 1378: charset="iso-8859-1" 1379:Content-Transfer-Encoding: 7bit 1380:X-Priority: 3 1381:X-Msmail-Priority: Normal 1382:X-Mailer: Microsoft Outlook Express 4.72.2106.4 1383:X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 1384: 1385: 1386: Check out this site. It works well. The only problem I had was timing 1387:issues when trying to read and write to the port too quickly. 1388: 1389:http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml 1390: 1391: 1392:-----Original Message----- 1393:From: Mark Wallace 1394:To: Handyboard@media.mit.edu 1395:Date: Wednesday, August 12, 1998 9:25 AM 1396:Subject: serial library for C++ 1397: 1398: 1399:>Hello, 1400:> I have a handy board with poloroid transducers and I am trying use the 1401:>results of my distance measurments in a C++ program on the computer. I 1402:>have found programs on the handyboard web page that should alow the 1403:>handyboard to transmit information over the serial line. What I am looking 1404:>for is if anyone knows were I could find a serial library for Microsofts 1405:>Visual C++ 5.0. I would like to find one that is free or sharware but any 1406:>information on any serial librarys that will work would be appreciated. 1407:>Thanks. 1408:>Mark Wallace 1409:> 1410:> e-mail mawalla3@vt.edu 1411:> mwallace@sps1.phys.vt.edu 1412:>web page http://sps1.phys.vt.ede/~mwallace 1413:> 1414:>"What a waist it would be after 4 billion tortuous years of evolution if 1415:>the dominant organism contrived its own self-distruction" 1416:> Carl Sagan 1417:> 1418: 1419:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 1420:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) 1421: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 1422:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) 1423: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 1424: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) 1425:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 1426:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 1427: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 1428:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1429: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 1430:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> 1431:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) 1432:From: Scott Seaton - Systems Consultant - ESG 1433:Reply-To: Scott Seaton - Systems Consultant - ESG 1434:Subject: Re: Handyboard/RWP without p-code 1435:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au 1436:Mime-Version: 1.0 1437:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 1438:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc 1439: 1440:--Troop_of_Baboons_752_000 1441:Content-Type: TEXT/plain; charset=us-ascii 1442:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== 1443: 1444:Hi 1445: 1446:I suggest that you contact ImageCraft. 1447:http://www.imagecraft.com/software/index.html or info@imagecraft.com 1448: 1449:They have a C compiler for 68HC11 CPU's that will do what you want, including a 1450:library for the HandyBoard (see attached e-mail) ! 1451: 1452:I have no affiliation with ImageCraft (other than as a satisfied customer). 1453: 1454:Hope this helps 1455:Scott 1456:============================================================================== 1457: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant 1458:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com 1459:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 1460: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 1461:============================================================================== 1462: 1463:--Troop_of_Baboons_752_000 1464:Content-Type: MESSAGE/rfc822; name=Mailbox 1465:Content-Description: Mailbox 1466: 1467:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 1468:Return-Path: 1469:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) 1470: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 1471:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 1472: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 1473:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) 1474: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 1475: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) 1476:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 1477:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) 1478:Message-Id: <199807100804.BAA15320@lists1.best.com> 1479:From: Christina Willrich & Richard Man 1480:Subject: icc11 Handyboard library available 1481:Date: Fri, 10 Jul 1998 00:58:49 -0700 1482:BestServHost: lists.best.com 1483:MIME-Version: 1.0 1484:Content-Type: text/plain; charset="us-ascii" 1485:Sender: icc11-list-errors@lists.best.com 1486:Errors-To: icc11-list-errors@lists.best.com 1487:Reply-To: icc11-list@lists.best.com 1488:To: icc11-list@lists.best.com 1489:content-length: 399 1490:Status: RO 1491:X-Status: $$$$ 1492:X-UID: 0000000001 1493: 1494:At long last, I dusted off Chuck McManis Handyboard library and ported it 1495:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it 1496:out, point your browser to 1497: 1498:ftp://ftp.imagecraft.com/pub/libhb.zip 1499: 1500:Chuck really did a great job with the LCD. There are commands to scroll, 1501:move etc. Make sure you try the lcdtest2.c test. 1502: 1503:// richard 1504:someone@imagecraft.com http://www.imagecraft.com 1505: 1506: 1507:--Troop_of_Baboons_752_000-- 1508: grepmail-5.3111/t/results/date_2000644 000765 000024 00000044241 12504145755 017107 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck grepmail-5.3111/t/results/help000644 000765 000024 00000006215 13321551665 016677 0ustar00coppitstaff000000 000000 grepmail 5.3111 usage: grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] [-e] grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -E grepmail [--help|--version] [-abBDFhHilLmrRuvVw] [-C ] [-j ] [-s ] [-d ] [-X ] [-Y ] -f At least one of -s, -d, -u, -e, and -E must be specified, and can appear in any relative order following the other flags. The -e flag is optional if pattern appears immediately before -s or -d. Files can be plain ASCII or ASCII files compressed with gzip, bzip2, lzip, or xz. -E allows for complex pattern matches involving logical operators. If no file is provided, normal or compressed ASCII input is taken from STDIN. -a Use received date instead of sent date for -d matching -b Search must match body -B Print message bodies but with only limited headers -C Specify the location of the cache file -d Specify a required date range (see below) -D Debug mode -e Explicitly name pattern (when searching for strings beginning with "-") -E Specify a complex search expression -f Read patterns from a file -F Force processing of all data as mailboxes -h Search must match header -H Print headers but not bodies of matching emails -i Ignore case in the search expression -j Search must match status (A=answered, R=read, D=deleted, O=old, F=flagged) -l Output the names of files having an email matching the expression -L Follow symbolic links (implies -R) -M Do not search non-text mime attachments -m Append "X-Mailfolder: " to all headers to indicate in which folder the match occurred -n Print the line number info (and filename if necessary) for the emails -q Quiet mode -- don't output warnings -r Output the names of the files and the number of emails matching the expression -R Recurse directories -s Specify a size range in bytes (see below) -S Ignore signatures -u Ensure that no duplicate emails are output -v Output emails that don't match the expression -V Display the version number -w Match word boundaries -X Specify a regular expression for the signature separator -Y Specify a header to search (implies -h) --help Print a help message Date constraints require Date::Parse. Date specifications must be of the form of: - a date like "today", "1st thursday in June 1992" (requires Date::Manip), "05/18/93", "12:30 Dec 12th 1880", "8:00pm december tenth", - "before", "after", or "since", followed by a date as defined above, - "between and ", where is defined as above. Size constraints must be of the form of: - 12345: match size of exactly 12345 - <12345, <=12345, >12345, >=12345: match size less than, less than or equal, greater than, or greater than or equal to 12345 - 10000-12345: match size between 10000 and 12345 inclusive grepmail-5.3111/t/results/all_handy000644 000765 000024 00000102527 12504145755 017706 0ustar00coppitstaff000000 000000 From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; Wed, 1 Jul 1998 10:56:30 -0500 (CDT) Sender: dblank@comp.uark.edu Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> Date: Wed, 01 Jul 1998 10:56:30 -0500 From: Douglas Blank Organization: University of Arkansas, CS X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) Mime-Version: 1.0 To: Aaron Edsinger Cc: handy Subject: Re: Serial Interface References: <199807010601.XAA26862@mail3.sirius.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Aaron Edsinger wrote: > Hello, > I've been having some problems using my HandyBoard to talk directly to my > PC via the serial interface. I disable Interactive C and then Poke() and > Peek() as has been described on this list. I send short character strings > from my PC to the HandyBoard under Windows 95. If I send strings longer > than 2 characters, it seems that some of the characters get lost. This > behavior seems to be affected by repositioning or slightly modifying the > code, suggesting perhaps a timing issue. Although there is the HEXMON program, I too, have been trying to do what you describe, and encountered the same problems. I found it to be a timing issue, and, through trial and error, have a found some settings that seem to work most of the time. My goal was to make C code that looked the same when compiled and run on the Host is the code that ran under IC. I am including the host and HB programs here. If anyone knows of a better way of communicating, please let us know. -Doug Blank ===================================================================== dblank@comp.uark.edu Douglas Blank, University of Arkansas Assistant Professor Computer Science ==================== http://www.uark.edu/~dblank ==================== This code was written for MS C++4.0 running on Win95. //************** BEGIN: serial_HOST.c /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on a host PC. */ #include #include #include #include #include "serial_HOST.h" void main(int argc, char *argv[]) { motor(0, 100); motor(1, 100); motor(2, 100); motor(3, 100); sleep(1000); motor(0, -100); motor(1, -100); motor(2, -100); motor(3, -100); sleep(1000); ao(); print("\nThis is a test"); printf("Knob is %d\n", knob() ); printf("Analog(0) is %d\n", analog(0)); printf("Digital(0) is %d\n", digital(0)); printf("Analog(1) is %d\n", analog(1)); printf("Digital(1) is %d\n", digital(1)); printf("Analog(2) is %d\n", analog(2)); printf("Digital(2) is %d\n", digital(2)); printf("Analog(3) is %d\n", analog(3)); printf("Digital(3) is %d\n", digital(3)); printf("Analog(4) is %d\n", analog(4)); printf("Digital(4) is %d\n", digital(4)); printf("Analog(5) is %d\n", analog(5)); printf("Digital(5) is %d\n", digital(5)); printf("Analog(6) is %d\n", analog(6)); printf("Digital(6) is %d\n", digital(6)); printf("Analog(7) is %d\n", analog(7)); printf("Digital(7) is %d\n", digital(7)); printf("Analog(8) is %d\n", analog(8)); printf("Digital(8) is %d\n", digital(8)); printf("Analog(9) is %d\n", analog(9)); printf("Digital(9) is %d\n", digital(9)); printf("Analog(10) is %d\n", analog(10)); printf("Digital(10) is %d\n", digital(10)); printf("Analog(11) is %d\n", analog(11)); printf("Digital(11) is %d\n", digital(11)); printf("Analog(12) is %d\n", analog(12)); printf("Digital(12) is %d\n", digital(12)); printf("Analog(13) is %d\n", analog(13)); printf("Digital(13) is %d\n", digital(13)); printf("Analog(14) is %d\n", analog(14)); printf("Digital(14) is %d\n", digital(14)); printf("Analog(15) is %d\n", analog(15)); printf("Digital(15) is %d\n", digital(15)); beep(); sleep(1000); while (! stop_button() ) { sprintf(buffer, "%d.0", (knob() * 10)); tone( buffer, "0.1"); } } //************** END: serial_HOST.c //************** BEGIN: serial_HOST.h /* VC++4.0 HandyBoard Host Programming System Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 #define sleep(NUM) _sleep(NUM) #define SERIALWAIT 5 unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 int send(int i) { int retval; retval = _outp( PORT, i); _sleep(SERIALWAIT); return retval; } int receive() { int retval; retval = _inp( PORT); _sleep(SERIALWAIT); retval = _inp( PORT); return retval; } void hangup() { send(QUIT); } void print(char buffer[]) { int i; send(PRINTF); for (i = 0; buffer[i] != 0; i++) send(buffer[i]); send('\0'); } void motor(int motornum, int power) { send(MOTOR); send(motornum); send(power + 100); // taken off on the other end } int analog(int sensor) { send(ANALOG); send(sensor); return receive(); } int digital(int sensor) { send(DIGITAL); send(sensor); return receive(); } void ao() { send(AO); } int knob() { send(KNOB); return receive(); } void beep() { send(BEEP); } void tone(char f1[], char f2[]) { int i; send(TONE); for (i = 0; f1[i] != 0; i++) send(f1[i]); send('\0'); for (i = 0; f2[i] != 0; i++) send(f2[i]); send('\0'); _sleep((unsigned long) (atof(f2) * 1000)); // to keep from overflowing serial line } void interactive() { char c; char key = ' '; while (key != 'q') { key = getch(); send(key); printf("Sent %c\n", key); c = receive(); printf("Got %c as a return value\n", c); } } int start_button() { send(START_BUTTON); return receive(); } int stop_button() { send(STOP_BUTTON); return receive(); } //************** END: serial_HOST.h //************** BEGIN: serial_HB.c /* VC++4.0 HandyBoard Programming System (Parts taken from other HB programs) Dr. Douglas S. Blank University of Arkansas, Department of Computer Science www.uark.edu/~dblank This code runs on the HB */ #define MOTOR 0 #define AO 1 #define ANALOG 2 #define DIGITAL 3 #define PRINTF 4 #define KNOB 5 #define BEEP 6 #define TONE 7 #define START_BUTTON 8 #define STOP_BUTTON 9 #define QUIT 113 int _isspace(int a) /* returns 1 for space or tab, 0 otherwise */ /* internal routine used by atof() and cgets() */ { return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ } /*****************************************************************************/ int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ /* internal routine used by atof() */ { return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ } float atof(char s[]) /* Convert a string containing a number in ASCII */ /* form (integer, float, or exponential float) to a */ /* float. Strips whitespace characters (space and */ /* tab) from the front of the string, but stops */ /* parsing at the first (unexpected) non-numeric */ /* character if the string has garbage at the end. */ /* This means that " 34.3foo78" translates to 34.3. */ /* Modified from atof() function in the standard */ /* library of the Hi-Tec C compiler for CP/M. */ /* Note: all string literals converted to decimal */ /* form because IC can't deal with string literals */ /* in math calculations. */ /* Also note: very ugly code because IC will not */ /* allow any math operations on pointers! Thus, the */ /* the number string has to be treated as an array! */ /* Also also note: no error handling; assumes that */ /* the string is a valid representation of a number! */ /* Valid range for exponential-format numbers is */ /* approximately 2.0e-38 to 3.4e+38. */ { int i=0; /* index into string array */ int sign=0; /* mantissa sign flag: 0=positive, 1=negative */ int exp0=0; /* mantissa exponent counter */ int eexp=0; /* E-form exponent counter */ int expsign=0; /* exponent sign flag: 0=positive, 1=negative */ float m=0.0; /* mantissa accumulator */ /* skip any leading whitespace (space, tab) */ while (_isspace(s[i])) i++; /* skip it */ /* check for mantissa sign */ if (s[i] == 45) /* 45 is '-' */ { sign = 1; /* flag minus sign */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get all digits up to either a decimal point or an e/E */ while (_isdigit(s[i])) { m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } /* no more digits, so check for decimal point */ if (s[i] == 46) /* 46 is '.' */ { i++; /* point to next */ /* get all digits after decimal point */ while (_isdigit(s[i])) { exp0--; m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ i++; /* point to next */ } } /* check for e/E exponential form */ if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ { i++; /* point to next */ /* check for exponent sign */ if (s[i] == 45) /* 45 is '-' */ { expsign = 1; /* flag negative exponent */ i++; /* point to next */ } else if (s[i] == 43) /* 43 is '+' */ i++; /* point to next */ /* now get exponent */ while (_isdigit(s[i])) { eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ i++; /* point to next */ } /* adjust exponent sign */ if (expsign) eexp = -eexp; /* make it negative */ } /* compute absolute value of final float */ exp0 += eexp; while (exp0 < 0) /* for negative exponents */ { m = m / 10.0; exp0++; } while (exp0 > 0) /* for positive exponents */ { m = m * 10.0; exp0--; } /* adjust final float sign from mantissa */ if (sign) return (-m); /* negative */ else return (m); /* positive */ } void disable_pcode_serial() /* necessary to receive characters using serial_getchar */ { poke(0x3c, 1); } void reenable_pcode_serial() /* necessary for IC to interact with board again */ { poke(0x3c, 0); } /* ====================================================================== For sending and receiving single bytes, you can use Randy's IC code: */ void serial_putchar(int c) { while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty */ poke(0x102f, c); /* send character */ } int serial_getchar() { while (!(peek(0x102e) & 0x20)); /* wait for received character */ return peek(0x102f); } void main(void) { int pos, c = ' ', var1, var2; float f1, f2; char buffer[80]; disable_pcode_serial(); beep(); printf("\nSerial IO Mode!"); printf("Listening..."); msleep(500L); while (c != 'q') { c = serial_getchar(); /* printf("[%d] ", c); */ if (c == MOTOR) { var1 = serial_getchar(); var2 = serial_getchar() - 100; motor(var1, var2); } else if (c == AO) { ao(); } else if (c == ANALOG) { var1 = serial_getchar(); serial_putchar(analog(var1)); } else if (c == DIGITAL) { var1 = serial_getchar(); serial_putchar(digital(var1)); } else if (c == PRINTF) { pos = 0; while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; printf(buffer); } else if (c == TONE) { pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f1 = atof(buffer); pos = 0; c = serial_getchar(); while (c != 0) { buffer[pos++] = c; c = serial_getchar(); } buffer[pos] = '\0'; f2 = atof(buffer); tone(f1, f2); } else if (c == START_BUTTON) { serial_putchar(start_button()); } else if (c == STOP_BUTTON) { serial_putchar(stop_button()); } else if (c == BEEP) { beep(); } else if (c == KNOB) { serial_putchar(knob()); } } reenable_pcode_serial(); printf("\nHB Mode!"); } //************** END: serial_HB.c From aarone@sirius.com Wed Jul 1 02:44:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) Message-Id: <199807010601.XAA26862@mail3.sirius.com> From: "Aaron Edsinger" To: "handy" Subject: Serial Interface Date: Wed, 1 Jul 1998 02:06:39 +0100 X-Msmail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1162 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I've been having some problems using my HandyBoard to talk directly to my PC via the serial interface. I disable Interactive C and then Poke() and Peek() as has been described on this list. I send short character strings from my PC to the HandyBoard under Windows 95. If I send strings longer than 2 characters, it seems that some of the characters get lost. This behavior seems to be affected by repositioning or slightly modifying the code, suggesting perhaps a timing issue. Why might this be? Is there any way to check for an error situation? Thanks for any help, Aaron From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 Received: from hq.freegate.com ([208.226.86.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> Date: Wed, 15 Jul 1998 23:21:14 -0700 From: Chuck McManis Reply-To: cmcmanis@freegate.com Organization: Freegate Corporation X-Mailer: Mozilla 4.04 [en] (Win95; I) Mime-Version: 1.0 To: David Rye Cc: handyboard@media.mit.edu Subject: Re: Handyboard/RWP without p-code References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the handyboard library from their site. --Chuck From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) Received: from localhost (wallace@localhost) by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) From: Mark Wallace To: handyboard@media.mit.edu Subject: sonar.c for the handyboard Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, I have a handyboard and 6500 series poloroid ultrasonic ranging system. I have downloaded the sonar.c programs used to drive the transducer for distance measurements. There appears to be a problem, or atleast I think there is, with it. The sonar device is supposed to give distances of up to 35ft but the TCNC time register is 16 bit and in the program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has elapsed and it returns -1. Therefore as soon as about 32700 counts goes by, that value will go negative. I believe hex goes from 0 to 32768 then -32768 to -1. In this case the difference will be < 0 if the object is greater then about 9 ft. I have taken this out of the program and can get accurate measurements up to atleast 30 ft but I have to look at the value given and add multiples of 2^16 to it to figure out where it is. Taking this out of the program also can get you stuck if you really are out of range. I have looked on the motorola web pages to see about this clock and it says that the clock goes till it reachs $ffff and then flags somewhere that there is an overflow and then starts over. I don't know how to find out were in the chip this information might be stored. I know the TCNT time register is at 0x100e from the notes on Simplified Sonar for the Handy Board but I don't know where that overflow flag is stored. I thought that maybe by setting this flag and using it in the loop you might be about to get a greater distance out of you measurement. Another question I have is about IC. I would like to display numbers greater then 32000 and right now there are several int type variables and normal C comands don't seem to work to make a "long" or any other type that are larger then 32000. How does IC handle larger numbers? I am only a student and don't have much experience with this stuff so I would appreciate any feedback I can get on either of these problems. Thanks. Mark Wallace e-mail mawalla3@vt.edu wallace@astro.phys.vt.edu Web page http://sps1.phys.vt.edu/~mwallace/index.html "What a waste it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-destruction" Carl Sagan From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> X-Sender: mawalla3@mail.vt.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 12 Aug 1998 12:13:45 -0400 To: Handyboard@media.mit.edu From: Mark Wallace Subject: serial library for C++ Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I have a handy board with poloroid transducers and I am trying use the results of my distance measurments in a C++ program on the computer. I have found programs on the handyboard web page that should alow the handyboard to transmit information over the serial line. What I am looking for is if anyone knows were I could find a serial for Microsofts Visual C++ 5.0. I would like to find one that is free or sharware but any information on any serial that will work would be appreciated. Thanks. Mark Wallace e-mail mawalla3@vt.edu mwallace@sps1.phys.vt.edu web page http://sps1.phys.vt.ede/~mwallace "What a waist it would be after 4 billion tortuous years of evolution if the dominant organism contrived its own self-distruction" Carl Sagan From aarone@sirius.com Wed Aug 12 13:42:19 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; Wed, 12 Aug 1998 09:48:24 -0700 (PDT) Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> From: "Aaron Edsinger" To: "Mark Wallace" Cc: "handy" Subject: Re: serial library for C++ Date: Wed, 12 Aug 1998 12:53:41 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Check out this site. It works well. The only problem I had was timing issues when trying to read and write to the port too quickly. http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml -----Original Message----- From: Mark Wallace To: Handyboard@media.mit.edu Date: Wednesday, August 12, 1998 9:25 AM Subject: serial library for C++ >Hello, > I have a handy board with poloroid transducers and I am trying use the >results of my distance measurments in a C++ program on the computer. I >have found programs on the handyboard web page that should alow the >handyboard to transmit information over the serial line. What I am looking >for is if anyone knows were I could find a serial library for Microsofts >Visual C++ 5.0. I would like to find one that is free or sharware but any >information on any serial librarys that will work would be appreciated. >Thanks. >Mark Wallace > > e-mail mawalla3@vt.edu > mwallace@sps1.phys.vt.edu >web page http://sps1.phys.vt.ede/~mwallace > >"What a waist it would be after 4 billion tortuous years of evolution if >the dominant organism contrived its own self-distruction" > Carl Sagan > From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) From: Scott Seaton - Systems Consultant - ESG Reply-To: Scott Seaton - Systems Consultant - ESG Subject: Re: Handyboard/RWP without p-code To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au Mime-Version: 1.0 Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc --Troop_of_Baboons_752_000 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== Hi I suggest that you contact ImageCraft. http://www.imagecraft.com/software/index.html or info@imagecraft.com They have a C compiler for 68HC11 CPU's that will do what you want, including a library for the HandyBoard (see attached e-mail) ! I have no affiliation with ImageCraft (other than as a satisfied customer). Hope this helps Scott ============================================================================== ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant / \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com \_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 ============================================================================== --Troop_of_Baboons_752_000 Content-Type: MESSAGE/rfc822; name=Mailbox Content-Description: Mailbox From someone@imagecraft.com Fri Jul 10 18:59:26 1998 Return-Path: Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 Received: from earth.sun.com by Aus.Sun.COM id SAA24238 (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) Message-Id: <199807100804.BAA15320@lists1.best.com> From: Christina Willrich & Richard Man Subject: icc11 Handyboard library available Date: Fri, 10 Jul 1998 00:58:49 -0700 BestServHost: lists.best.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: icc11-list-errors@lists.best.com Errors-To: icc11-list-errors@lists.best.com Reply-To: icc11-list@lists.best.com To: icc11-list@lists.best.com content-length: 399 Status: RO X-Status: $$$$ X-UID: 0000000001 At long last, I dusted off Chuck McManis Handyboard library and ported it to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it out, point your browser to ftp://ftp.imagecraft.com/pub/libhb.zip Chuck really did a great job with the LCD. There are commands to scroll, move etc. Make sure you try the lcdtest2.c test. // richard someone@imagecraft.com http://www.imagecraft.com --Troop_of_Baboons_752_000-- grepmail-5.3111/t/results/number_append_header000644 000765 000024 00000210441 12504145755 022075 0ustar00coppitstaff000000 000000 t/mailboxes/mailarc-1.txt:1:From dblank@comp.uark.edu Wed Jul 1 13:17:17 1998 t/mailboxes/mailarc-1.txt:2:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:3: id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 t/mailboxes/mailarc-1.txt:4:Received: from comp.uark.edu (root@comp.uark.edu [130.184.252.197]) t/mailboxes/mailarc-1.txt:5: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 t/mailboxes/mailarc-1.txt:6: for ; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) t/mailboxes/mailarc-1.txt:7:Received: from comp.uark.edu (IDENT:dblank@dangermouse.uark.edu [130.184.201.233]) t/mailboxes/mailarc-1.txt:8: by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; t/mailboxes/mailarc-1.txt:9: Wed, 1 Jul 1998 10:56:30 -0500 (CDT) t/mailboxes/mailarc-1.txt:10:Sender: dblank@comp.uark.edu t/mailboxes/mailarc-1.txt:11:Message-Id: <359A5C2E.202B4BA3@comp.uark.edu> t/mailboxes/mailarc-1.txt:12:Date: Wed, 01 Jul 1998 10:56:30 -0500 t/mailboxes/mailarc-1.txt:13:From: Douglas Blank t/mailboxes/mailarc-1.txt:14:Organization: University of Arkansas, CS t/mailboxes/mailarc-1.txt:15:X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) t/mailboxes/mailarc-1.txt:16:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:17:To: Aaron Edsinger t/mailboxes/mailarc-1.txt:18:Cc: handy t/mailboxes/mailarc-1.txt:19:Subject: Re: Serial Interface t/mailboxes/mailarc-1.txt:20:References: <199807010601.XAA26862@mail3.sirius.com> t/mailboxes/mailarc-1.txt:21:Content-Type: text/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:22:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:23: t/mailboxes/mailarc-1.txt:24:Aaron Edsinger wrote: t/mailboxes/mailarc-1.txt:25: t/mailboxes/mailarc-1.txt:26:> Hello, t/mailboxes/mailarc-1.txt:27:> I've been having some problems using my HandyBoard to talk directly to my t/mailboxes/mailarc-1.txt:28:> PC via the serial interface. I disable Interactive C and then Poke() and t/mailboxes/mailarc-1.txt:29:> Peek() as has been described on this list. I send short character strings t/mailboxes/mailarc-1.txt:30:> from my PC to the HandyBoard under Windows 95. If I send strings longer t/mailboxes/mailarc-1.txt:31:> than 2 characters, it seems that some of the characters get lost. This t/mailboxes/mailarc-1.txt:32:> behavior seems to be affected by repositioning or slightly modifying the t/mailboxes/mailarc-1.txt:33:> code, suggesting perhaps a timing issue. t/mailboxes/mailarc-1.txt:34: t/mailboxes/mailarc-1.txt:35:Although there is the HEXMON program, I too, have been trying to do what t/mailboxes/mailarc-1.txt:36:you describe, and encountered the same problems. I found it to be a t/mailboxes/mailarc-1.txt:37:timing issue, and, through trial and error, have a found some settings t/mailboxes/mailarc-1.txt:38:that seem to work most of the time. t/mailboxes/mailarc-1.txt:39: t/mailboxes/mailarc-1.txt:40:My goal was to make C code that looked the same when compiled and run on t/mailboxes/mailarc-1.txt:41:the Host is the code that ran under IC. t/mailboxes/mailarc-1.txt:42: t/mailboxes/mailarc-1.txt:43:I am including the host and HB programs here. If anyone knows of a t/mailboxes/mailarc-1.txt:44:better way of communicating, please let us know. t/mailboxes/mailarc-1.txt:45: t/mailboxes/mailarc-1.txt:46:-Doug Blank t/mailboxes/mailarc-1.txt:47: t/mailboxes/mailarc-1.txt:48:===================================================================== t/mailboxes/mailarc-1.txt:49:dblank@comp.uark.edu Douglas Blank, University of Arkansas t/mailboxes/mailarc-1.txt:50:Assistant Professor Computer Science t/mailboxes/mailarc-1.txt:51:==================== http://www.uark.edu/~dblank ==================== t/mailboxes/mailarc-1.txt:52: t/mailboxes/mailarc-1.txt:53:This code was written for MS C++4.0 running on Win95. t/mailboxes/mailarc-1.txt:54: t/mailboxes/mailarc-1.txt:55://************** BEGIN: serial_HOST.c t/mailboxes/mailarc-1.txt:56: t/mailboxes/mailarc-1.txt:57:/* VC++4.0 HandyBoard Host Programming System t/mailboxes/mailarc-1.txt:58: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:59: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:60: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:61: t/mailboxes/mailarc-1.txt:62: This code runs on a host PC. t/mailboxes/mailarc-1.txt:63:*/ t/mailboxes/mailarc-1.txt:64: t/mailboxes/mailarc-1.txt:65:#include t/mailboxes/mailarc-1.txt:66:#include t/mailboxes/mailarc-1.txt:67:#include t/mailboxes/mailarc-1.txt:68:#include t/mailboxes/mailarc-1.txt:69: t/mailboxes/mailarc-1.txt:70:#include "serial_HOST.h" t/mailboxes/mailarc-1.txt:71: t/mailboxes/mailarc-1.txt:72:void main(int argc, char *argv[]) t/mailboxes/mailarc-1.txt:73:{ t/mailboxes/mailarc-1.txt:74: motor(0, 100); t/mailboxes/mailarc-1.txt:75: motor(1, 100); t/mailboxes/mailarc-1.txt:76: motor(2, 100); t/mailboxes/mailarc-1.txt:77: motor(3, 100); t/mailboxes/mailarc-1.txt:78: sleep(1000); t/mailboxes/mailarc-1.txt:79: motor(0, -100); t/mailboxes/mailarc-1.txt:80: motor(1, -100); t/mailboxes/mailarc-1.txt:81: motor(2, -100); t/mailboxes/mailarc-1.txt:82: motor(3, -100); t/mailboxes/mailarc-1.txt:83: sleep(1000); t/mailboxes/mailarc-1.txt:84: ao(); t/mailboxes/mailarc-1.txt:85: print("\nThis is a test"); t/mailboxes/mailarc-1.txt:86: printf("Knob is %d\n", knob() ); t/mailboxes/mailarc-1.txt:87: printf("Analog(0) is %d\n", analog(0)); t/mailboxes/mailarc-1.txt:88: printf("Digital(0) is %d\n", digital(0)); t/mailboxes/mailarc-1.txt:89: printf("Analog(1) is %d\n", analog(1)); t/mailboxes/mailarc-1.txt:90: printf("Digital(1) is %d\n", digital(1)); t/mailboxes/mailarc-1.txt:91: printf("Analog(2) is %d\n", analog(2)); t/mailboxes/mailarc-1.txt:92: printf("Digital(2) is %d\n", digital(2)); t/mailboxes/mailarc-1.txt:93: printf("Analog(3) is %d\n", analog(3)); t/mailboxes/mailarc-1.txt:94: printf("Digital(3) is %d\n", digital(3)); t/mailboxes/mailarc-1.txt:95: printf("Analog(4) is %d\n", analog(4)); t/mailboxes/mailarc-1.txt:96: printf("Digital(4) is %d\n", digital(4)); t/mailboxes/mailarc-1.txt:97: printf("Analog(5) is %d\n", analog(5)); t/mailboxes/mailarc-1.txt:98: printf("Digital(5) is %d\n", digital(5)); t/mailboxes/mailarc-1.txt:99: printf("Analog(6) is %d\n", analog(6)); t/mailboxes/mailarc-1.txt:100: printf("Digital(6) is %d\n", digital(6)); t/mailboxes/mailarc-1.txt:101: printf("Analog(7) is %d\n", analog(7)); t/mailboxes/mailarc-1.txt:102: printf("Digital(7) is %d\n", digital(7)); t/mailboxes/mailarc-1.txt:103: printf("Analog(8) is %d\n", analog(8)); t/mailboxes/mailarc-1.txt:104: printf("Digital(8) is %d\n", digital(8)); t/mailboxes/mailarc-1.txt:105: printf("Analog(9) is %d\n", analog(9)); t/mailboxes/mailarc-1.txt:106: printf("Digital(9) is %d\n", digital(9)); t/mailboxes/mailarc-1.txt:107: printf("Analog(10) is %d\n", analog(10)); t/mailboxes/mailarc-1.txt:108: printf("Digital(10) is %d\n", digital(10)); t/mailboxes/mailarc-1.txt:109: printf("Analog(11) is %d\n", analog(11)); t/mailboxes/mailarc-1.txt:110: printf("Digital(11) is %d\n", digital(11)); t/mailboxes/mailarc-1.txt:111: printf("Analog(12) is %d\n", analog(12)); t/mailboxes/mailarc-1.txt:112: printf("Digital(12) is %d\n", digital(12)); t/mailboxes/mailarc-1.txt:113: printf("Analog(13) is %d\n", analog(13)); t/mailboxes/mailarc-1.txt:114: printf("Digital(13) is %d\n", digital(13)); t/mailboxes/mailarc-1.txt:115: printf("Analog(14) is %d\n", analog(14)); t/mailboxes/mailarc-1.txt:116: printf("Digital(14) is %d\n", digital(14)); t/mailboxes/mailarc-1.txt:117: printf("Analog(15) is %d\n", analog(15)); t/mailboxes/mailarc-1.txt:118: printf("Digital(15) is %d\n", digital(15)); t/mailboxes/mailarc-1.txt:119: beep(); t/mailboxes/mailarc-1.txt:120: sleep(1000); t/mailboxes/mailarc-1.txt:121: while (! stop_button() ) { t/mailboxes/mailarc-1.txt:122: sprintf(buffer, "%d.0", (knob() * 10)); t/mailboxes/mailarc-1.txt:123: tone( buffer, "0.1"); t/mailboxes/mailarc-1.txt:124: } t/mailboxes/mailarc-1.txt:125:} t/mailboxes/mailarc-1.txt:126: t/mailboxes/mailarc-1.txt:127://************** END: serial_HOST.c t/mailboxes/mailarc-1.txt:128: t/mailboxes/mailarc-1.txt:129://************** BEGIN: serial_HOST.h t/mailboxes/mailarc-1.txt:130: t/mailboxes/mailarc-1.txt:131:/* VC++4.0 HandyBoard Host Programming System t/mailboxes/mailarc-1.txt:132: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:133: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:134: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:135:*/ t/mailboxes/mailarc-1.txt:136: t/mailboxes/mailarc-1.txt:137:#define MOTOR 0 t/mailboxes/mailarc-1.txt:138:#define AO 1 t/mailboxes/mailarc-1.txt:139:#define ANALOG 2 t/mailboxes/mailarc-1.txt:140:#define DIGITAL 3 t/mailboxes/mailarc-1.txt:141:#define PRINTF 4 t/mailboxes/mailarc-1.txt:142:#define KNOB 5 t/mailboxes/mailarc-1.txt:143:#define BEEP 6 t/mailboxes/mailarc-1.txt:144:#define TONE 7 t/mailboxes/mailarc-1.txt:145:#define START_BUTTON 8 t/mailboxes/mailarc-1.txt:146:#define STOP_BUTTON 9 t/mailboxes/mailarc-1.txt:147:#define QUIT 113 t/mailboxes/mailarc-1.txt:148: t/mailboxes/mailarc-1.txt:149:#define sleep(NUM) _sleep(NUM) t/mailboxes/mailarc-1.txt:150:#define SERIALWAIT 5 t/mailboxes/mailarc-1.txt:151: t/mailboxes/mailarc-1.txt:152:unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 t/mailboxes/mailarc-1.txt:153: t/mailboxes/mailarc-1.txt:154:int send(int i) { t/mailboxes/mailarc-1.txt:155: int retval; t/mailboxes/mailarc-1.txt:156: retval = _outp( PORT, i); t/mailboxes/mailarc-1.txt:157: _sleep(SERIALWAIT); t/mailboxes/mailarc-1.txt:158: return retval; t/mailboxes/mailarc-1.txt:159:} t/mailboxes/mailarc-1.txt:160: t/mailboxes/mailarc-1.txt:161:int receive() { t/mailboxes/mailarc-1.txt:162: int retval; t/mailboxes/mailarc-1.txt:163: retval = _inp( PORT); t/mailboxes/mailarc-1.txt:164: _sleep(SERIALWAIT); t/mailboxes/mailarc-1.txt:165: retval = _inp( PORT); t/mailboxes/mailarc-1.txt:166: return retval; t/mailboxes/mailarc-1.txt:167:} t/mailboxes/mailarc-1.txt:168: t/mailboxes/mailarc-1.txt:169:void hangup() { t/mailboxes/mailarc-1.txt:170: send(QUIT); t/mailboxes/mailarc-1.txt:171:} t/mailboxes/mailarc-1.txt:172: t/mailboxes/mailarc-1.txt:173:void print(char buffer[]) { t/mailboxes/mailarc-1.txt:174: int i; t/mailboxes/mailarc-1.txt:175: send(PRINTF); t/mailboxes/mailarc-1.txt:176: for (i = 0; buffer[i] != 0; i++) t/mailboxes/mailarc-1.txt:177: send(buffer[i]); t/mailboxes/mailarc-1.txt:178: send('\0'); t/mailboxes/mailarc-1.txt:179:} t/mailboxes/mailarc-1.txt:180: t/mailboxes/mailarc-1.txt:181:void motor(int motornum, int power) { t/mailboxes/mailarc-1.txt:182: send(MOTOR); t/mailboxes/mailarc-1.txt:183: send(motornum); t/mailboxes/mailarc-1.txt:184: send(power + 100); // taken off on the other end t/mailboxes/mailarc-1.txt:185:} t/mailboxes/mailarc-1.txt:186: t/mailboxes/mailarc-1.txt:187:int analog(int sensor) { t/mailboxes/mailarc-1.txt:188: send(ANALOG); t/mailboxes/mailarc-1.txt:189: send(sensor); t/mailboxes/mailarc-1.txt:190: return receive(); t/mailboxes/mailarc-1.txt:191:} t/mailboxes/mailarc-1.txt:192: t/mailboxes/mailarc-1.txt:193:int digital(int sensor) { t/mailboxes/mailarc-1.txt:194: send(DIGITAL); t/mailboxes/mailarc-1.txt:195: send(sensor); t/mailboxes/mailarc-1.txt:196: return receive(); t/mailboxes/mailarc-1.txt:197:} t/mailboxes/mailarc-1.txt:198: t/mailboxes/mailarc-1.txt:199:void ao() { t/mailboxes/mailarc-1.txt:200: send(AO); t/mailboxes/mailarc-1.txt:201:} t/mailboxes/mailarc-1.txt:202: t/mailboxes/mailarc-1.txt:203:int knob() { t/mailboxes/mailarc-1.txt:204: send(KNOB); t/mailboxes/mailarc-1.txt:205: return receive(); t/mailboxes/mailarc-1.txt:206:} t/mailboxes/mailarc-1.txt:207: t/mailboxes/mailarc-1.txt:208:void beep() { t/mailboxes/mailarc-1.txt:209: send(BEEP); t/mailboxes/mailarc-1.txt:210:} t/mailboxes/mailarc-1.txt:211: t/mailboxes/mailarc-1.txt:212:void tone(char f1[], char f2[]) { t/mailboxes/mailarc-1.txt:213: int i; t/mailboxes/mailarc-1.txt:214: send(TONE); t/mailboxes/mailarc-1.txt:215: for (i = 0; f1[i] != 0; i++) t/mailboxes/mailarc-1.txt:216: send(f1[i]); t/mailboxes/mailarc-1.txt:217: send('\0'); t/mailboxes/mailarc-1.txt:218: for (i = 0; f2[i] != 0; i++) t/mailboxes/mailarc-1.txt:219: send(f2[i]); t/mailboxes/mailarc-1.txt:220: send('\0'); t/mailboxes/mailarc-1.txt:221: _sleep((unsigned long) (atof(f2) * 1000)); // to keep from t/mailboxes/mailarc-1.txt:222:overflowing serial line t/mailboxes/mailarc-1.txt:223:} t/mailboxes/mailarc-1.txt:224: t/mailboxes/mailarc-1.txt:225:void interactive() t/mailboxes/mailarc-1.txt:226:{ t/mailboxes/mailarc-1.txt:227: char c; t/mailboxes/mailarc-1.txt:228: char key = ' '; t/mailboxes/mailarc-1.txt:229: while (key != 'q') { t/mailboxes/mailarc-1.txt:230: key = getch(); t/mailboxes/mailarc-1.txt:231: send(key); t/mailboxes/mailarc-1.txt:232: printf("Sent %c\n", key); t/mailboxes/mailarc-1.txt:233: c = receive(); t/mailboxes/mailarc-1.txt:234: printf("Got %c as a return value\n", c); t/mailboxes/mailarc-1.txt:235: } t/mailboxes/mailarc-1.txt:236:} t/mailboxes/mailarc-1.txt:237: t/mailboxes/mailarc-1.txt:238:int start_button() { t/mailboxes/mailarc-1.txt:239: send(START_BUTTON); t/mailboxes/mailarc-1.txt:240: return receive(); t/mailboxes/mailarc-1.txt:241:} t/mailboxes/mailarc-1.txt:242: t/mailboxes/mailarc-1.txt:243:int stop_button() { t/mailboxes/mailarc-1.txt:244: send(STOP_BUTTON); t/mailboxes/mailarc-1.txt:245: return receive(); t/mailboxes/mailarc-1.txt:246:} t/mailboxes/mailarc-1.txt:247://************** END: serial_HOST.h t/mailboxes/mailarc-1.txt:248: t/mailboxes/mailarc-1.txt:249://************** BEGIN: serial_HB.c t/mailboxes/mailarc-1.txt:250: t/mailboxes/mailarc-1.txt:251:/* VC++4.0 HandyBoard Programming System t/mailboxes/mailarc-1.txt:252: (Parts taken from other HB programs) t/mailboxes/mailarc-1.txt:253: Dr. Douglas S. Blank t/mailboxes/mailarc-1.txt:254: University of Arkansas, Department of Computer Science t/mailboxes/mailarc-1.txt:255: www.uark.edu/~dblank t/mailboxes/mailarc-1.txt:256: t/mailboxes/mailarc-1.txt:257: This code runs on the HB t/mailboxes/mailarc-1.txt:258:*/ t/mailboxes/mailarc-1.txt:259: t/mailboxes/mailarc-1.txt:260:#define MOTOR 0 t/mailboxes/mailarc-1.txt:261:#define AO 1 t/mailboxes/mailarc-1.txt:262:#define ANALOG 2 t/mailboxes/mailarc-1.txt:263:#define DIGITAL 3 t/mailboxes/mailarc-1.txt:264:#define PRINTF 4 t/mailboxes/mailarc-1.txt:265:#define KNOB 5 t/mailboxes/mailarc-1.txt:266:#define BEEP 6 t/mailboxes/mailarc-1.txt:267:#define TONE 7 t/mailboxes/mailarc-1.txt:268:#define START_BUTTON 8 t/mailboxes/mailarc-1.txt:269:#define STOP_BUTTON 9 t/mailboxes/mailarc-1.txt:270:#define QUIT 113 t/mailboxes/mailarc-1.txt:271: t/mailboxes/mailarc-1.txt:272:int _isspace(int a) /* returns 1 for space or tab, 0 t/mailboxes/mailarc-1.txt:273:otherwise */ t/mailboxes/mailarc-1.txt:274: /* internal routine used by atof() and t/mailboxes/mailarc-1.txt:275:cgets() */ t/mailboxes/mailarc-1.txt:276: t/mailboxes/mailarc-1.txt:277:{ t/mailboxes/mailarc-1.txt:278: return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ t/mailboxes/mailarc-1.txt:279:} t/mailboxes/mailarc-1.txt:280: t/mailboxes/mailarc-1.txt:281:/*****************************************************************************/ t/mailboxes/mailarc-1.txt:282: t/mailboxes/mailarc-1.txt:283:int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ t/mailboxes/mailarc-1.txt:284: /* internal routine used by atof() */ t/mailboxes/mailarc-1.txt:285: t/mailboxes/mailarc-1.txt:286:{ t/mailboxes/mailarc-1.txt:287: return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ t/mailboxes/mailarc-1.txt:288:} t/mailboxes/mailarc-1.txt:289: t/mailboxes/mailarc-1.txt:290:float atof(char s[]) /* Convert a string containing a number in t/mailboxes/mailarc-1.txt:291:ASCII */ t/mailboxes/mailarc-1.txt:292: /* form (integer, float, or exponential float) t/mailboxes/mailarc-1.txt:293:to a */ t/mailboxes/mailarc-1.txt:294: /* float. Strips whitespace characters (space t/mailboxes/mailarc-1.txt:295:and */ t/mailboxes/mailarc-1.txt:296: /* tab) from the front of the string, but t/mailboxes/mailarc-1.txt:297:stops */ t/mailboxes/mailarc-1.txt:298: /* parsing at the first (unexpected) t/mailboxes/mailarc-1.txt:299:non-numeric */ t/mailboxes/mailarc-1.txt:300: /* character if the string has garbage at the t/mailboxes/mailarc-1.txt:301:end. */ t/mailboxes/mailarc-1.txt:302: /* This means that " 34.3foo78" translates to t/mailboxes/mailarc-1.txt:303:34.3. */ t/mailboxes/mailarc-1.txt:304: /* Modified from atof() function in the t/mailboxes/mailarc-1.txt:305:standard */ t/mailboxes/mailarc-1.txt:306: /* library of the Hi-Tec C compiler for t/mailboxes/mailarc-1.txt:307:CP/M. */ t/mailboxes/mailarc-1.txt:308: /* Note: all string literals converted to t/mailboxes/mailarc-1.txt:309:decimal */ t/mailboxes/mailarc-1.txt:310: /* form because IC can't deal with string t/mailboxes/mailarc-1.txt:311:literals */ t/mailboxes/mailarc-1.txt:312: /* in math t/mailboxes/mailarc-1.txt:313:calculations. */ t/mailboxes/mailarc-1.txt:314: /* Also note: very ugly code because IC will t/mailboxes/mailarc-1.txt:315:not */ t/mailboxes/mailarc-1.txt:316: /* allow any math operations on pointers! Thus, t/mailboxes/mailarc-1.txt:317:the */ t/mailboxes/mailarc-1.txt:318: /* the number string has to be treated as an t/mailboxes/mailarc-1.txt:319:array! */ t/mailboxes/mailarc-1.txt:320: /* Also also note: no error handling; assumes t/mailboxes/mailarc-1.txt:321:that */ t/mailboxes/mailarc-1.txt:322: /* the string is a valid representation of a t/mailboxes/mailarc-1.txt:323:number! */ t/mailboxes/mailarc-1.txt:324: /* Valid range for exponential-format numbers t/mailboxes/mailarc-1.txt:325:is */ t/mailboxes/mailarc-1.txt:326: /* approximately 2.0e-38 to t/mailboxes/mailarc-1.txt:327:3.4e+38. */ t/mailboxes/mailarc-1.txt:328: t/mailboxes/mailarc-1.txt:329:{ t/mailboxes/mailarc-1.txt:330: int i=0; /* index into string array */ t/mailboxes/mailarc-1.txt:331: int sign=0; /* mantissa sign flag: 0=positive, t/mailboxes/mailarc-1.txt:332:1=negative */ t/mailboxes/mailarc-1.txt:333: int exp0=0; /* mantissa exponent counter */ t/mailboxes/mailarc-1.txt:334: int eexp=0; /* E-form exponent counter */ t/mailboxes/mailarc-1.txt:335: int expsign=0; /* exponent sign flag: 0=positive, t/mailboxes/mailarc-1.txt:336:1=negative */ t/mailboxes/mailarc-1.txt:337: float m=0.0; /* mantissa accumulator */ t/mailboxes/mailarc-1.txt:338: t/mailboxes/mailarc-1.txt:339: /* skip any leading whitespace (space, tab) */ t/mailboxes/mailarc-1.txt:340: while (_isspace(s[i])) t/mailboxes/mailarc-1.txt:341: i++; /* skip it */ t/mailboxes/mailarc-1.txt:342: t/mailboxes/mailarc-1.txt:343: /* check for mantissa sign */ t/mailboxes/mailarc-1.txt:344: if (s[i] == 45) /* 45 is '-' */ t/mailboxes/mailarc-1.txt:345: { t/mailboxes/mailarc-1.txt:346: sign = 1; /* flag minus sign */ t/mailboxes/mailarc-1.txt:347: i++; /* point to next */ t/mailboxes/mailarc-1.txt:348: } t/mailboxes/mailarc-1.txt:349: else if (s[i] == 43) /* 43 is '+' */ t/mailboxes/mailarc-1.txt:350: i++; /* point to next */ t/mailboxes/mailarc-1.txt:351: t/mailboxes/mailarc-1.txt:352: /* now get all digits up to either a decimal point or an e/E */ t/mailboxes/mailarc-1.txt:353: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:354: { t/mailboxes/mailarc-1.txt:355: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ t/mailboxes/mailarc-1.txt:356: i++; /* point to next */ t/mailboxes/mailarc-1.txt:357: } t/mailboxes/mailarc-1.txt:358: t/mailboxes/mailarc-1.txt:359: /* no more digits, so check for decimal point */ t/mailboxes/mailarc-1.txt:360: if (s[i] == 46) /* 46 is '.' */ t/mailboxes/mailarc-1.txt:361: { t/mailboxes/mailarc-1.txt:362: i++; /* point to next */ t/mailboxes/mailarc-1.txt:363: /* get all digits after decimal point */ t/mailboxes/mailarc-1.txt:364: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:365: { t/mailboxes/mailarc-1.txt:366: exp0--; t/mailboxes/mailarc-1.txt:367: m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ t/mailboxes/mailarc-1.txt:368: i++; /* point to next */ t/mailboxes/mailarc-1.txt:369: } t/mailboxes/mailarc-1.txt:370: } t/mailboxes/mailarc-1.txt:371: t/mailboxes/mailarc-1.txt:372: /* check for e/E exponential form */ t/mailboxes/mailarc-1.txt:373: if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ t/mailboxes/mailarc-1.txt:374: { t/mailboxes/mailarc-1.txt:375: i++; /* point to next */ t/mailboxes/mailarc-1.txt:376: /* check for exponent sign */ t/mailboxes/mailarc-1.txt:377: if (s[i] == 45) /* 45 is '-' */ t/mailboxes/mailarc-1.txt:378: { t/mailboxes/mailarc-1.txt:379: expsign = 1; /* flag negative exponent */ t/mailboxes/mailarc-1.txt:380: i++; /* point to next */ t/mailboxes/mailarc-1.txt:381: } t/mailboxes/mailarc-1.txt:382: else if (s[i] == 43) /* 43 is '+' */ t/mailboxes/mailarc-1.txt:383: i++; /* point to next */ t/mailboxes/mailarc-1.txt:384: t/mailboxes/mailarc-1.txt:385: /* now get exponent */ t/mailboxes/mailarc-1.txt:386: while (_isdigit(s[i])) t/mailboxes/mailarc-1.txt:387: { t/mailboxes/mailarc-1.txt:388: eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ t/mailboxes/mailarc-1.txt:389: i++; /* point to next */ t/mailboxes/mailarc-1.txt:390: } t/mailboxes/mailarc-1.txt:391: t/mailboxes/mailarc-1.txt:392: /* adjust exponent sign */ t/mailboxes/mailarc-1.txt:393: if (expsign) t/mailboxes/mailarc-1.txt:394: eexp = -eexp; /* make it negative */ t/mailboxes/mailarc-1.txt:395: } t/mailboxes/mailarc-1.txt:396: t/mailboxes/mailarc-1.txt:397: /* compute absolute value of final float */ t/mailboxes/mailarc-1.txt:398: exp0 += eexp; t/mailboxes/mailarc-1.txt:399: while (exp0 < 0) /* for negative exponents */ t/mailboxes/mailarc-1.txt:400: { t/mailboxes/mailarc-1.txt:401: m = m / 10.0; t/mailboxes/mailarc-1.txt:402: exp0++; t/mailboxes/mailarc-1.txt:403: } t/mailboxes/mailarc-1.txt:404: while (exp0 > 0) /* for positive exponents */ t/mailboxes/mailarc-1.txt:405: { t/mailboxes/mailarc-1.txt:406: m = m * 10.0; t/mailboxes/mailarc-1.txt:407: exp0--; t/mailboxes/mailarc-1.txt:408: } t/mailboxes/mailarc-1.txt:409: t/mailboxes/mailarc-1.txt:410: /* adjust final float sign from mantissa */ t/mailboxes/mailarc-1.txt:411: if (sign) t/mailboxes/mailarc-1.txt:412: return (-m); /* negative */ t/mailboxes/mailarc-1.txt:413: else t/mailboxes/mailarc-1.txt:414: return (m); /* positive */ t/mailboxes/mailarc-1.txt:415:} t/mailboxes/mailarc-1.txt:416: t/mailboxes/mailarc-1.txt:417:void disable_pcode_serial() t/mailboxes/mailarc-1.txt:418:/* necessary to receive characters using serial_getchar */ t/mailboxes/mailarc-1.txt:419:{ t/mailboxes/mailarc-1.txt:420: poke(0x3c, 1); t/mailboxes/mailarc-1.txt:421:} t/mailboxes/mailarc-1.txt:422: t/mailboxes/mailarc-1.txt:423:void reenable_pcode_serial() t/mailboxes/mailarc-1.txt:424:/* necessary for IC to interact with board again */ t/mailboxes/mailarc-1.txt:425:{ t/mailboxes/mailarc-1.txt:426: poke(0x3c, 0); t/mailboxes/mailarc-1.txt:427:} t/mailboxes/mailarc-1.txt:428: t/mailboxes/mailarc-1.txt:429:/* t/mailboxes/mailarc-1.txt:430:====================================================================== t/mailboxes/mailarc-1.txt:431:For sending and receiving single bytes, you can use Randy's IC code: t/mailboxes/mailarc-1.txt:432:*/ t/mailboxes/mailarc-1.txt:433: t/mailboxes/mailarc-1.txt:434:void serial_putchar(int c) t/mailboxes/mailarc-1.txt:435:{ t/mailboxes/mailarc-1.txt:436: while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty t/mailboxes/mailarc-1.txt:437:*/ t/mailboxes/mailarc-1.txt:438: poke(0x102f, c); /* send character */ t/mailboxes/mailarc-1.txt:439:} t/mailboxes/mailarc-1.txt:440: t/mailboxes/mailarc-1.txt:441:int serial_getchar() t/mailboxes/mailarc-1.txt:442:{ t/mailboxes/mailarc-1.txt:443: while (!(peek(0x102e) & 0x20)); /* wait for received character */ t/mailboxes/mailarc-1.txt:444: return peek(0x102f); t/mailboxes/mailarc-1.txt:445:} t/mailboxes/mailarc-1.txt:446: t/mailboxes/mailarc-1.txt:447:void main(void) { t/mailboxes/mailarc-1.txt:448: int pos, c = ' ', var1, var2; t/mailboxes/mailarc-1.txt:449: float f1, f2; t/mailboxes/mailarc-1.txt:450: char buffer[80]; t/mailboxes/mailarc-1.txt:451: disable_pcode_serial(); t/mailboxes/mailarc-1.txt:452: beep(); t/mailboxes/mailarc-1.txt:453: printf("\nSerial IO Mode!"); t/mailboxes/mailarc-1.txt:454: printf("Listening..."); t/mailboxes/mailarc-1.txt:455: msleep(500L); t/mailboxes/mailarc-1.txt:456: while (c != 'q') { t/mailboxes/mailarc-1.txt:457: c = serial_getchar(); t/mailboxes/mailarc-1.txt:458:/* printf("[%d] ", c); */ t/mailboxes/mailarc-1.txt:459: if (c == MOTOR) { t/mailboxes/mailarc-1.txt:460: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:461: var2 = serial_getchar() - 100; t/mailboxes/mailarc-1.txt:462: motor(var1, var2); t/mailboxes/mailarc-1.txt:463: } else if (c == AO) { t/mailboxes/mailarc-1.txt:464: ao(); t/mailboxes/mailarc-1.txt:465: } else if (c == ANALOG) { t/mailboxes/mailarc-1.txt:466: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:467: serial_putchar(analog(var1)); t/mailboxes/mailarc-1.txt:468: } else if (c == DIGITAL) { t/mailboxes/mailarc-1.txt:469: var1 = serial_getchar(); t/mailboxes/mailarc-1.txt:470: serial_putchar(digital(var1)); t/mailboxes/mailarc-1.txt:471: } else if (c == PRINTF) { t/mailboxes/mailarc-1.txt:472: pos = 0; t/mailboxes/mailarc-1.txt:473: while (c != 0) { t/mailboxes/mailarc-1.txt:474: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:475: c = serial_getchar(); t/mailboxes/mailarc-1.txt:476: } t/mailboxes/mailarc-1.txt:477: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:478: printf(buffer); t/mailboxes/mailarc-1.txt:479: } else if (c == TONE) { t/mailboxes/mailarc-1.txt:480: pos = 0; t/mailboxes/mailarc-1.txt:481: c = serial_getchar(); t/mailboxes/mailarc-1.txt:482: while (c != 0) { t/mailboxes/mailarc-1.txt:483: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:484: c = serial_getchar(); t/mailboxes/mailarc-1.txt:485: } t/mailboxes/mailarc-1.txt:486: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:487: f1 = atof(buffer); t/mailboxes/mailarc-1.txt:488: pos = 0; t/mailboxes/mailarc-1.txt:489: c = serial_getchar(); t/mailboxes/mailarc-1.txt:490: while (c != 0) { t/mailboxes/mailarc-1.txt:491: buffer[pos++] = c; t/mailboxes/mailarc-1.txt:492: c = serial_getchar(); t/mailboxes/mailarc-1.txt:493: } t/mailboxes/mailarc-1.txt:494: buffer[pos] = '\0'; t/mailboxes/mailarc-1.txt:495: f2 = atof(buffer); t/mailboxes/mailarc-1.txt:496: tone(f1, f2); t/mailboxes/mailarc-1.txt:497: } else if (c == START_BUTTON) { t/mailboxes/mailarc-1.txt:498: serial_putchar(start_button()); t/mailboxes/mailarc-1.txt:499: } else if (c == STOP_BUTTON) { t/mailboxes/mailarc-1.txt:500: serial_putchar(stop_button()); t/mailboxes/mailarc-1.txt:501: } else if (c == BEEP) { t/mailboxes/mailarc-1.txt:502: beep(); t/mailboxes/mailarc-1.txt:503: } else if (c == KNOB) { t/mailboxes/mailarc-1.txt:504: serial_putchar(knob()); t/mailboxes/mailarc-1.txt:505: } t/mailboxes/mailarc-1.txt:506: } t/mailboxes/mailarc-1.txt:507: reenable_pcode_serial(); t/mailboxes/mailarc-1.txt:508: printf("\nHB Mode!"); t/mailboxes/mailarc-1.txt:509:} t/mailboxes/mailarc-1.txt:510: t/mailboxes/mailarc-1.txt:511://************** END: serial_HB.c t/mailboxes/mailarc-1.txt:512: t/mailboxes/mailarc-1.txt:791:From aarone@sirius.com Wed Jul 1 02:44:06 1998 t/mailboxes/mailarc-1.txt:792:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:793: id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 t/mailboxes/mailarc-1.txt:794:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) t/mailboxes/mailarc-1.txt:795: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 t/mailboxes/mailarc-1.txt:796: for ; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) t/mailboxes/mailarc-1.txt:797:Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) t/mailboxes/mailarc-1.txt:798: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 t/mailboxes/mailarc-1.txt:799: for ; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) t/mailboxes/mailarc-1.txt:800:Message-Id: <199807010601.XAA26862@mail3.sirius.com> t/mailboxes/mailarc-1.txt:801:From: "Aaron Edsinger" t/mailboxes/mailarc-1.txt:802:To: "handy" t/mailboxes/mailarc-1.txt:803:Subject: Serial Interface t/mailboxes/mailarc-1.txt:804:Date: Wed, 1 Jul 1998 02:06:39 +0100 t/mailboxes/mailarc-1.txt:805:X-Msmail-Priority: Normal t/mailboxes/mailarc-1.txt:806:X-Priority: 3 t/mailboxes/mailarc-1.txt:807:X-Mailer: Microsoft Internet Mail 4.70.1162 t/mailboxes/mailarc-1.txt:808:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:809:Content-Type: text/plain; charset=ISO-8859-1 t/mailboxes/mailarc-1.txt:810:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:811: t/mailboxes/mailarc-1.txt:812:Hello, t/mailboxes/mailarc-1.txt:813: I've been having some problems using my HandyBoard to talk directly to my t/mailboxes/mailarc-1.txt:814:PC via the serial interface. I disable Interactive C and then Poke() and t/mailboxes/mailarc-1.txt:815:Peek() as has been described on this list. I send short character strings t/mailboxes/mailarc-1.txt:816:from my PC to the HandyBoard under Windows 95. If I send strings longer t/mailboxes/mailarc-1.txt:817:than 2 characters, it seems that some of the characters get lost. This t/mailboxes/mailarc-1.txt:818:behavior seems to be affected by repositioning or slightly modifying the t/mailboxes/mailarc-1.txt:819:code, suggesting perhaps a timing issue. t/mailboxes/mailarc-1.txt:820: t/mailboxes/mailarc-1.txt:821:Why might this be? Is there any way to check for an error situation? t/mailboxes/mailarc-1.txt:822: t/mailboxes/mailarc-1.txt:823:Thanks for any help, t/mailboxes/mailarc-1.txt:824: Aaron t/mailboxes/mailarc-1.txt:825:From cmcmanis@freegate.com Thu Jul 16 03:13:49 1998 t/mailboxes/mailarc-1.txt:826:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:827: id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 t/mailboxes/mailarc-1.txt:828:Received: from hq.freegate.com ([208.226.86.1]) t/mailboxes/mailarc-1.txt:829: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 t/mailboxes/mailarc-1.txt:830: for ; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) t/mailboxes/mailarc-1.txt:831:Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 t/mailboxes/mailarc-1.txt:832:Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) t/mailboxes/mailarc-1.txt:833: by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 t/mailboxes/mailarc-1.txt:834:Message-Id: <35AD9BDA.3A9EC8F7@freegate.com> t/mailboxes/mailarc-1.txt:835:Date: Wed, 15 Jul 1998 23:21:14 -0700 t/mailboxes/mailarc-1.txt:836:From: Chuck McManis t/mailboxes/mailarc-1.txt:837:Reply-To: cmcmanis@freegate.com t/mailboxes/mailarc-1.txt:838:Organization: Freegate Corporation t/mailboxes/mailarc-1.txt:839:X-Mailer: Mozilla 4.04 [en] (Win95; I) t/mailboxes/mailarc-1.txt:840:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:841:To: David Rye t/mailboxes/mailarc-1.txt:842:Cc: handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:843:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:844:References: <3.0.32.19980716151646.00809d20@nemo.mech.eng.usyd.edu.au> t/mailboxes/mailarc-1.txt:845:Content-Type: text/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:846:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:847: t/mailboxes/mailarc-1.txt:848:Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the t/mailboxes/mailarc-1.txt:849:handyboard library from their site. t/mailboxes/mailarc-1.txt:850: t/mailboxes/mailarc-1.txt:851:--Chuck t/mailboxes/mailarc-1.txt:852: t/mailboxes/mailarc-1.txt:853:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 t/mailboxes/mailarc-1.txt:854:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:855: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 t/mailboxes/mailarc-1.txt:856:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) t/mailboxes/mailarc-1.txt:857: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 t/mailboxes/mailarc-1.txt:858: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) t/mailboxes/mailarc-1.txt:859:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 t/mailboxes/mailarc-1.txt:860:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 t/mailboxes/mailarc-1.txt:861: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 t/mailboxes/mailarc-1.txt:862:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:863: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 t/mailboxes/mailarc-1.txt:864:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> t/mailboxes/mailarc-1.txt:865:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) t/mailboxes/mailarc-1.txt:866:From: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:867:Reply-To: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:868:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:869:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au t/mailboxes/mailarc-1.txt:870:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:871:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:872:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:873: t/mailboxes/mailarc-1.txt:874:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:875:Content-Type: TEXT/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:876:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== t/mailboxes/mailarc-1.txt:877: t/mailboxes/mailarc-1.txt:878:Hi t/mailboxes/mailarc-1.txt:879: t/mailboxes/mailarc-1.txt:880:I suggest that you contact ImageCraft. t/mailboxes/mailarc-1.txt:881:http://www.imagecraft.com/software/index.html or info@imagecraft.com t/mailboxes/mailarc-1.txt:882: t/mailboxes/mailarc-1.txt:883:They have a C compiler for 68HC11 CPU's that will do what you want, including a t/mailboxes/mailarc-1.txt:884:library for the HandyBoard (see attached e-mail) ! t/mailboxes/mailarc-1.txt:885: t/mailboxes/mailarc-1.txt:886:I have no affiliation with ImageCraft (other than as a satisfied customer). t/mailboxes/mailarc-1.txt:887: t/mailboxes/mailarc-1.txt:888:Hope this helps t/mailboxes/mailarc-1.txt:889:Scott t/mailboxes/mailarc-1.txt:890:============================================================================== t/mailboxes/mailarc-1.txt:891: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant t/mailboxes/mailarc-1.txt:892:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com t/mailboxes/mailarc-1.txt:893:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 t/mailboxes/mailarc-1.txt:894: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 t/mailboxes/mailarc-1.txt:895:============================================================================== t/mailboxes/mailarc-1.txt:896: t/mailboxes/mailarc-1.txt:897:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:898:Content-Type: MESSAGE/rfc822; name=Mailbox t/mailboxes/mailarc-1.txt:899:Content-Description: Mailbox t/mailboxes/mailarc-1.txt:900: t/mailboxes/mailarc-1.txt:901:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 t/mailboxes/mailarc-1.txt:902:Return-Path: t/mailboxes/mailarc-1.txt:903:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:904: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 t/mailboxes/mailarc-1.txt:905:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 t/mailboxes/mailarc-1.txt:906: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 t/mailboxes/mailarc-1.txt:907:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) t/mailboxes/mailarc-1.txt:908: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 t/mailboxes/mailarc-1.txt:909: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) t/mailboxes/mailarc-1.txt:910:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 t/mailboxes/mailarc-1.txt:911:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) t/mailboxes/mailarc-1.txt:912:Message-Id: <199807100804.BAA15320@lists1.best.com> t/mailboxes/mailarc-1.txt:913:From: Christina Willrich & Richard Man t/mailboxes/mailarc-1.txt:914:Subject: icc11 Handyboard library available t/mailboxes/mailarc-1.txt:915:Date: Fri, 10 Jul 1998 00:58:49 -0700 t/mailboxes/mailarc-1.txt:916:BestServHost: lists.best.com t/mailboxes/mailarc-1.txt:917:MIME-Version: 1.0 t/mailboxes/mailarc-1.txt:918:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt:919:Sender: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:920:Errors-To: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:921:Reply-To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:922:To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:923:content-length: 399 t/mailboxes/mailarc-1.txt:924:Status: RO t/mailboxes/mailarc-1.txt:925:X-Status: $$$$ t/mailboxes/mailarc-1.txt:926:X-UID: 0000000001 t/mailboxes/mailarc-1.txt:927: t/mailboxes/mailarc-1.txt:928:At long last, I dusted off Chuck McManis Handyboard library and ported it t/mailboxes/mailarc-1.txt:929:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it t/mailboxes/mailarc-1.txt:930:out, point your browser to t/mailboxes/mailarc-1.txt:931: t/mailboxes/mailarc-1.txt:932:ftp://ftp.imagecraft.com/pub/libhb.zip t/mailboxes/mailarc-1.txt:933: t/mailboxes/mailarc-1.txt:934:Chuck really did a great job with the LCD. There are commands to scroll, t/mailboxes/mailarc-1.txt:935:move etc. Make sure you try the lcdtest2.c test. t/mailboxes/mailarc-1.txt:936: t/mailboxes/mailarc-1.txt:937:// richard t/mailboxes/mailarc-1.txt:938:someone@imagecraft.com http://www.imagecraft.com t/mailboxes/mailarc-1.txt:939: t/mailboxes/mailarc-1.txt:940: t/mailboxes/mailarc-1.txt:941:--Troop_of_Baboons_752_000-- t/mailboxes/mailarc-1.txt:942: t/mailboxes/mailarc-1.txt:1142:From wallace@theory.phys.vt.edu Mon Jul 27 18:34:05 1998 t/mailboxes/mailarc-1.txt:1143:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1144: id AA00723; Mon, 27 Jul 1998 18:34:05 -0400 t/mailboxes/mailarc-1.txt:1145:Received: from theory.phys.vt.edu (theory.phys.vt.edu [128.173.176.33]) t/mailboxes/mailarc-1.txt:1146: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id RAA19984 t/mailboxes/mailarc-1.txt:1147: for ; Mon, 27 Jul 1998 17:22:26 -0400 (EDT) t/mailboxes/mailarc-1.txt:1148:Received: from localhost (wallace@localhost) t/mailboxes/mailarc-1.txt:1149: by theory.phys.vt.edu (8.8.5/8.8.5) with SMTP id RAA00312 t/mailboxes/mailarc-1.txt:1150: for ; Mon, 27 Jul 1998 17:22:24 -0400 (EDT) t/mailboxes/mailarc-1.txt:1151:Date: Mon, 27 Jul 1998 17:22:24 -0400 (EDT) t/mailboxes/mailarc-1.txt:1152:From: Mark Wallace t/mailboxes/mailarc-1.txt:1153:To: handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1154:Subject: sonar.c for the handyboard t/mailboxes/mailarc-1.txt:1155:Message-Id: t/mailboxes/mailarc-1.txt:1156:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1157:Content-Type: TEXT/PLAIN; charset=US-ASCII t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:1158: t/mailboxes/mailarc-1.txt:1159:Hello, t/mailboxes/mailarc-1.txt:1160: I have a handyboard and 6500 series poloroid ultrasonic ranging t/mailboxes/mailarc-1.txt:1161:system. I have downloaded the sonar.c programs used to drive the t/mailboxes/mailarc-1.txt:1162:transducer for distance measurements. There appears to be a problem, or t/mailboxes/mailarc-1.txt:1163:atleast I think there is, with it. The sonar device is supposed to give t/mailboxes/mailarc-1.txt:1164:distances of up to 35ft but the TCNC time register is 16 bit and in the t/mailboxes/mailarc-1.txt:1165:program it says "if ((peekwork(0x100e)-start_time) < 0)" too much time has t/mailboxes/mailarc-1.txt:1166:elapsed and it returns -1. Therefore as soon as about 32700 counts goes t/mailboxes/mailarc-1.txt:1167:by, that value will go negative. I believe hex goes from 0 to 32768 then t/mailboxes/mailarc-1.txt:1168:-32768 to -1. In this case the difference will be < 0 if the object t/mailboxes/mailarc-1.txt:1169:is greater then about 9 ft. I have taken this out of the program and can t/mailboxes/mailarc-1.txt:1170:get accurate measurements up to atleast 30 ft but I have to look at the t/mailboxes/mailarc-1.txt:1171:value given and add multiples of 2^16 to it to figure out where it is. t/mailboxes/mailarc-1.txt:1172:Taking this out of the program also can get you stuck if you really are t/mailboxes/mailarc-1.txt:1173:out of range. t/mailboxes/mailarc-1.txt:1174: I have looked on the motorola web pages to see about this clock t/mailboxes/mailarc-1.txt:1175:and it says that the clock goes till it reachs $ffff and then flags t/mailboxes/mailarc-1.txt:1176:somewhere that there is an overflow and then starts over. I don't know t/mailboxes/mailarc-1.txt:1177:how to find out were in the chip this information might be stored. I know t/mailboxes/mailarc-1.txt:1178:the TCNT time register is at 0x100e from the notes on Simplified Sonar for t/mailboxes/mailarc-1.txt:1179:the Handy Board but I don't know where that overflow flag is stored. I t/mailboxes/mailarc-1.txt:1180:thought that maybe by setting this flag and using it in the loop you might t/mailboxes/mailarc-1.txt:1181:be about to get a greater distance out of you measurement. t/mailboxes/mailarc-1.txt:1182: Another question I have is about IC. I would like to display t/mailboxes/mailarc-1.txt:1183:numbers greater then 32000 and right now there are several int type t/mailboxes/mailarc-1.txt:1184:variables and normal C comands don't seem to work to make a "long" or any t/mailboxes/mailarc-1.txt:1185:other type that are larger then 32000. How does IC handle larger numbers? t/mailboxes/mailarc-1.txt:1186: I am only a student and don't have much experience with this stuff t/mailboxes/mailarc-1.txt:1187:so I would appreciate any feedback I can get on either of these problems. t/mailboxes/mailarc-1.txt:1188:Thanks. t/mailboxes/mailarc-1.txt:1189: t/mailboxes/mailarc-1.txt:1190:Mark Wallace t/mailboxes/mailarc-1.txt:1191: t/mailboxes/mailarc-1.txt:1192: e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1193: wallace@astro.phys.vt.edu t/mailboxes/mailarc-1.txt:1194:Web page http://sps1.phys.vt.edu/~mwallace/index.html t/mailboxes/mailarc-1.txt:1195: t/mailboxes/mailarc-1.txt:1196:"What a waste it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1197:the dominant organism contrived its own self-destruction" t/mailboxes/mailarc-1.txt:1198: Carl Sagan t/mailboxes/mailarc-1.txt:1199: t/mailboxes/mailarc-1.txt:1200: t/mailboxes/mailarc-1.txt:1274:From mawalla3@vt.edu Wed Aug 12 13:10:06 1998 t/mailboxes/mailarc-1.txt:1275:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1276: id AA07529; Wed, 12 Aug 1998 13:10:06 -0400 t/mailboxes/mailarc-1.txt:1277:Received: from quackerjack.cc.vt.edu (root@quackerjack.cc.vt.edu [198.82.160.250]) t/mailboxes/mailarc-1.txt:1278: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA05729 t/mailboxes/mailarc-1.txt:1279: for ; Wed, 12 Aug 1998 12:13:53 -0400 (EDT) t/mailboxes/mailarc-1.txt:1280:Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) t/mailboxes/mailarc-1.txt:1281: by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id MAA20678 t/mailboxes/mailarc-1.txt:1282: for ; Wed, 12 Aug 1998 12:20:09 -0400 (EDT) t/mailboxes/mailarc-1.txt:1283:Received: from research10.phys.vt.edu (dhcp9.phys.vt.edu [128.173.176.166]) t/mailboxes/mailarc-1.txt:1284: by sable.cc.vt.edu (8.8.8/8.8.8) with SMTP id MAA05159 t/mailboxes/mailarc-1.txt:1285: for ; Wed, 12 Aug 1998 12:13:51 -0400 (EDT) t/mailboxes/mailarc-1.txt:1286:Message-Id: <3.0.5.32.19980812121345.00796960@mail.vt.edu> t/mailboxes/mailarc-1.txt:1287:X-Sender: mawalla3@mail.vt.edu (Unverified) t/mailboxes/mailarc-1.txt:1288:X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) t/mailboxes/mailarc-1.txt:1289:Date: Wed, 12 Aug 1998 12:13:45 -0400 t/mailboxes/mailarc-1.txt:1290:To: Handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1291:From: Mark Wallace t/mailboxes/mailarc-1.txt:1292:Subject: serial library for C++ t/mailboxes/mailarc-1.txt:1293:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1294:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:1295: t/mailboxes/mailarc-1.txt:1296:Hello, t/mailboxes/mailarc-1.txt:1297: I have a handy board with poloroid transducers and I am trying use the t/mailboxes/mailarc-1.txt:1298:results of my distance measurments in a C++ program on the computer. I t/mailboxes/mailarc-1.txt:1299:have found programs on the handyboard web page that should alow the t/mailboxes/mailarc-1.txt:1300:handyboard to transmit information over the serial line. What I am looking t/mailboxes/mailarc-1.txt:1301:for is if anyone knows were I could find a serial for Microsofts t/mailboxes/mailarc-1.txt:1302:Visual C++ 5.0. I would like to find one that is free or sharware but any t/mailboxes/mailarc-1.txt:1303:information on any serial that will work would be appreciated. t/mailboxes/mailarc-1.txt:1304:Thanks. t/mailboxes/mailarc-1.txt:1305:Mark Wallace t/mailboxes/mailarc-1.txt:1306: t/mailboxes/mailarc-1.txt:1307: e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1308: mwallace@sps1.phys.vt.edu t/mailboxes/mailarc-1.txt:1309:web page http://sps1.phys.vt.ede/~mwallace t/mailboxes/mailarc-1.txt:1310: t/mailboxes/mailarc-1.txt:1311:"What a waist it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1312:the dominant organism contrived its own self-distruction" t/mailboxes/mailarc-1.txt:1313: Carl Sagan t/mailboxes/mailarc-1.txt:1314: t/mailboxes/mailarc-1.txt:1315: t/mailboxes/mailarc-1.txt:1361:From aarone@sirius.com Wed Aug 12 13:42:19 1998 t/mailboxes/mailarc-1.txt:1362:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1363: id AA13439; Wed, 12 Aug 1998 13:42:19 -0400 t/mailboxes/mailarc-1.txt:1364:Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) t/mailboxes/mailarc-1.txt:1365: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id MAA10630 t/mailboxes/mailarc-1.txt:1366: for ; Wed, 12 Aug 1998 12:48:27 -0400 (EDT) t/mailboxes/mailarc-1.txt:1367:Received: from aarone (ppp-asfm05--041.sirius.net [205.134.241.41]) t/mailboxes/mailarc-1.txt:1368: by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with SMTP id JAA20821; t/mailboxes/mailarc-1.txt:1369: Wed, 12 Aug 1998 09:48:24 -0700 (PDT) t/mailboxes/mailarc-1.txt:1370:Message-Id: <004401bdc62a$e8ecc8c0$70f086cd@aarone.sirius.com> t/mailboxes/mailarc-1.txt:1371:From: "Aaron Edsinger" t/mailboxes/mailarc-1.txt:1372:To: "Mark Wallace" t/mailboxes/mailarc-1.txt:1373:Cc: "handy" t/mailboxes/mailarc-1.txt:1374:Subject: Re: serial library for C++ t/mailboxes/mailarc-1.txt:1375:Date: Wed, 12 Aug 1998 12:53:41 -0700 t/mailboxes/mailarc-1.txt:1376:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1377:Content-Type: text/plain; t/mailboxes/mailarc-1.txt:1378: charset="iso-8859-1" t/mailboxes/mailarc-1.txt:1379:Content-Transfer-Encoding: 7bit t/mailboxes/mailarc-1.txt:1380:X-Priority: 3 t/mailboxes/mailarc-1.txt:1381:X-Msmail-Priority: Normal t/mailboxes/mailarc-1.txt:1382:X-Mailer: Microsoft Outlook Express 4.72.2106.4 t/mailboxes/mailarc-1.txt:1383:X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:1384: t/mailboxes/mailarc-1.txt:1385: t/mailboxes/mailarc-1.txt:1386: Check out this site. It works well. The only problem I had was timing t/mailboxes/mailarc-1.txt:1387:issues when trying to read and write to the port too quickly. t/mailboxes/mailarc-1.txt:1388: t/mailboxes/mailarc-1.txt:1389:http://www.codeguru.com/show.cgi?general=/misc/misc_toc.shtml t/mailboxes/mailarc-1.txt:1390: t/mailboxes/mailarc-1.txt:1391: t/mailboxes/mailarc-1.txt:1392:-----Original Message----- t/mailboxes/mailarc-1.txt:1393:From: Mark Wallace t/mailboxes/mailarc-1.txt:1394:To: Handyboard@media.mit.edu t/mailboxes/mailarc-1.txt:1395:Date: Wednesday, August 12, 1998 9:25 AM t/mailboxes/mailarc-1.txt:1396:Subject: serial library for C++ t/mailboxes/mailarc-1.txt:1397: t/mailboxes/mailarc-1.txt:1398: t/mailboxes/mailarc-1.txt:1399:>Hello, t/mailboxes/mailarc-1.txt:1400:> I have a handy board with poloroid transducers and I am trying use the t/mailboxes/mailarc-1.txt:1401:>results of my distance measurments in a C++ program on the computer. I t/mailboxes/mailarc-1.txt:1402:>have found programs on the handyboard web page that should alow the t/mailboxes/mailarc-1.txt:1403:>handyboard to transmit information over the serial line. What I am looking t/mailboxes/mailarc-1.txt:1404:>for is if anyone knows were I could find a serial library for Microsofts t/mailboxes/mailarc-1.txt:1405:>Visual C++ 5.0. I would like to find one that is free or sharware but any t/mailboxes/mailarc-1.txt:1406:>information on any serial librarys that will work would be appreciated. t/mailboxes/mailarc-1.txt:1407:>Thanks. t/mailboxes/mailarc-1.txt:1408:>Mark Wallace t/mailboxes/mailarc-1.txt:1409:> t/mailboxes/mailarc-1.txt:1410:> e-mail mawalla3@vt.edu t/mailboxes/mailarc-1.txt:1411:> mwallace@sps1.phys.vt.edu t/mailboxes/mailarc-1.txt:1412:>web page http://sps1.phys.vt.ede/~mwallace t/mailboxes/mailarc-1.txt:1413:> t/mailboxes/mailarc-1.txt:1414:>"What a waist it would be after 4 billion tortuous years of evolution if t/mailboxes/mailarc-1.txt:1415:>the dominant organism contrived its own self-distruction" t/mailboxes/mailarc-1.txt:1416:> Carl Sagan t/mailboxes/mailarc-1.txt:1417:> t/mailboxes/mailarc-1.txt:1418: t/mailboxes/mailarc-1.txt:1419:From Scott.Seaton@Aus.Sun.COM Thu Jul 16 03:42:38 1998 t/mailboxes/mailarc-1.txt:1420:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-1.txt:1421: id AA24945; Thu, 16 Jul 1998 03:42:38 -0400 t/mailboxes/mailarc-1.txt:1422:Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) t/mailboxes/mailarc-1.txt:1423: by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA07415 t/mailboxes/mailarc-1.txt:1424: for ; Thu, 16 Jul 1998 02:44:58 -0400 (EDT) t/mailboxes/mailarc-1.txt:1425:Received: from Aus.Sun.COM ([129.158.80.6]) by mercury.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id XAA29734; Wed, 15 Jul 1998 23:44:52 -0700 t/mailboxes/mailarc-1.txt:1426:Received: from war.Aus.Sun.COM by Aus.Sun.COM id QAA03011 t/mailboxes/mailarc-1.txt:1427: (SMI-8.6/SMI-4.1 for <>); Thu, 16 Jul 1998 16:44:50 +1000 t/mailboxes/mailarc-1.txt:1428:Received: from drone by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:1429: id QAA10921; Thu, 16 Jul 1998 16:44:20 +1000 t/mailboxes/mailarc-1.txt:1430:Message-Id: <199807160644.QAA10921@war.Aus.Sun.COM> t/mailboxes/mailarc-1.txt:1431:Date: Thu, 16 Jul 1998 16:41:56 +1000 (EST) t/mailboxes/mailarc-1.txt:1432:From: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:1433:Reply-To: Scott Seaton - Systems Consultant - ESG t/mailboxes/mailarc-1.txt:1434:Subject: Re: Handyboard/RWP without p-code t/mailboxes/mailarc-1.txt:1435:To: handyboard@media.mit.edu, rye@mech.eng.usyd.edu.au t/mailboxes/mailarc-1.txt:1436:Mime-Version: 1.0 t/mailboxes/mailarc-1.txt:1437:Content-Type: MULTIPART/mixed; BOUNDARY=Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1438:X-Mailer: dtmail 1.2.0 CDE Version 1.2 SunOS 5.6 sun4u sparc t/mailboxes/mailarc-1.txt: :X-Mailfolder: t/mailboxes/mailarc-1.txt t/mailboxes/mailarc-1.txt:1439: t/mailboxes/mailarc-1.txt:1440:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1441:Content-Type: TEXT/plain; charset=us-ascii t/mailboxes/mailarc-1.txt:1442:Content-MD5: i/HKSIa/Vk0mZT5ml+q21A== t/mailboxes/mailarc-1.txt:1443: t/mailboxes/mailarc-1.txt:1444:Hi t/mailboxes/mailarc-1.txt:1445: t/mailboxes/mailarc-1.txt:1446:I suggest that you contact ImageCraft. t/mailboxes/mailarc-1.txt:1447:http://www.imagecraft.com/software/index.html or info@imagecraft.com t/mailboxes/mailarc-1.txt:1448: t/mailboxes/mailarc-1.txt:1449:They have a C compiler for 68HC11 CPU's that will do what you want, including a t/mailboxes/mailarc-1.txt:1450:library for the HandyBoard (see attached e-mail) ! t/mailboxes/mailarc-1.txt:1451: t/mailboxes/mailarc-1.txt:1452:I have no affiliation with ImageCraft (other than as a satisfied customer). t/mailboxes/mailarc-1.txt:1453: t/mailboxes/mailarc-1.txt:1454:Hope this helps t/mailboxes/mailarc-1.txt:1455:Scott t/mailboxes/mailarc-1.txt:1456:============================================================================== t/mailboxes/mailarc-1.txt:1457: ,-_|\ Scott Seaton - Sun Enterprise Services - Systems Consultant t/mailboxes/mailarc-1.txt:1458:/ \ Sun Microsystems Australia Pty Ltd E-mail : scott.seaton@aus.sun.com t/mailboxes/mailarc-1.txt:1459:\_,-\_+ 828 Pacific Highway Phone : +61 2 9844 5381 t/mailboxes/mailarc-1.txt:1460: v Gordon, N.S.W., 2072, AUSTRALIA Fax : +61 2 9844 5161 t/mailboxes/mailarc-1.txt:1461:============================================================================== t/mailboxes/mailarc-1.txt:1462: t/mailboxes/mailarc-1.txt:1463:--Troop_of_Baboons_752_000 t/mailboxes/mailarc-1.txt:1464:Content-Type: MESSAGE/rfc822; name=Mailbox t/mailboxes/mailarc-1.txt:1465:Content-Description: Mailbox t/mailboxes/mailarc-1.txt:1466: t/mailboxes/mailarc-1.txt:1467:From someone@imagecraft.com Fri Jul 10 18:59:26 1998 t/mailboxes/mailarc-1.txt:1468:Return-Path: t/mailboxes/mailarc-1.txt:1469:Received: from Aus.Sun.COM by war.Aus.Sun.COM (SMI-8.6/SMI-SVR4) t/mailboxes/mailarc-1.txt:1470: id SAA14426; Fri, 10 Jul 1998 18:59:26 +1000 t/mailboxes/mailarc-1.txt:1471:Received: from earth.sun.com by Aus.Sun.COM id SAA24238 t/mailboxes/mailarc-1.txt:1472: (SMI-8.6/SMI-4.1 for <>); Fri, 10 Jul 1998 18:59:48 +1000 t/mailboxes/mailarc-1.txt:1473:Received: from iisesun.iise.CSIRO.AU (iisesun.iise.csiro.au [130.155.5.44]) t/mailboxes/mailarc-1.txt:1474: by earth.sun.com (8.8.8/8.8.8) with SMTP id BAA18609 t/mailboxes/mailarc-1.txt:1475: for ; Fri, 10 Jul 1998 01:59:44 -0700 (PDT) t/mailboxes/mailarc-1.txt:1476:Received: from lists1.best.com (lists1.best.com [206.86.8.15]) by iisesun.iise.CSIRO.AU (SMI-8.6/8.6.12-IISE-SWA) with ESMTP id SAA25847 for ; Fri, 10 Jul 1998 18:49:31 +1000 t/mailboxes/mailarc-1.txt:1477:Received: (from daemon@localhost) by lists1.best.com (8.9.0/8.8.BEST) id BAA15320 for icc11-list-errors@lists.best.com; Fri, 10 Jul 1998 01:04:34 -0700 (PDT) t/mailboxes/mailarc-1.txt:1478:Message-Id: <199807100804.BAA15320@lists1.best.com> t/mailboxes/mailarc-1.txt:1479:From: Christina Willrich & Richard Man t/mailboxes/mailarc-1.txt:1480:Subject: icc11 Handyboard library available t/mailboxes/mailarc-1.txt:1481:Date: Fri, 10 Jul 1998 00:58:49 -0700 t/mailboxes/mailarc-1.txt:1482:BestServHost: lists.best.com t/mailboxes/mailarc-1.txt:1483:MIME-Version: 1.0 t/mailboxes/mailarc-1.txt:1484:Content-Type: text/plain; charset="us-ascii" t/mailboxes/mailarc-1.txt:1485:Sender: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:1486:Errors-To: icc11-list-errors@lists.best.com t/mailboxes/mailarc-1.txt:1487:Reply-To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:1488:To: icc11-list@lists.best.com t/mailboxes/mailarc-1.txt:1489:content-length: 399 t/mailboxes/mailarc-1.txt:1490:Status: RO t/mailboxes/mailarc-1.txt:1491:X-Status: $$$$ t/mailboxes/mailarc-1.txt:1492:X-UID: 0000000001 t/mailboxes/mailarc-1.txt:1493: t/mailboxes/mailarc-1.txt:1494:At long last, I dusted off Chuck McManis Handyboard library and ported it t/mailboxes/mailarc-1.txt:1495:to V5. No reason why it can't work with V4.5 either ;-) Anyway, to try it t/mailboxes/mailarc-1.txt:1496:out, point your browser to t/mailboxes/mailarc-1.txt:1497: t/mailboxes/mailarc-1.txt:1498:ftp://ftp.imagecraft.com/pub/libhb.zip t/mailboxes/mailarc-1.txt:1499: t/mailboxes/mailarc-1.txt:1500:Chuck really did a great job with the LCD. There are commands to scroll, t/mailboxes/mailarc-1.txt:1501:move etc. Make sure you try the lcdtest2.c test. t/mailboxes/mailarc-1.txt:1502: t/mailboxes/mailarc-1.txt:1503:// richard t/mailboxes/mailarc-1.txt:1504:someone@imagecraft.com http://www.imagecraft.com t/mailboxes/mailarc-1.txt:1505: t/mailboxes/mailarc-1.txt:1506: t/mailboxes/mailarc-1.txt:1507:--Troop_of_Baboons_752_000-- t/mailboxes/mailarc-1.txt:1508: t/mailboxes/mailarc-2.txt:156:From dakott@alpha.delta.edu Thu Jan 1 05:56:53 1998 t/mailboxes/mailarc-2.txt:157:Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) t/mailboxes/mailarc-2.txt:158: id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 t/mailboxes/mailarc-2.txt:159:Received: from kott.my.domain (root@pm233-26.dialip.mich.net [198.110.144.127]) t/mailboxes/mailarc-2.txt:160: by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 t/mailboxes/mailarc-2.txt:161: for ; Thu, 1 Jan 1998 05:06:14 -0500 (EST) t/mailboxes/mailarc-2.txt:162:Received: from kott.my.domain (dakott@kott.my.domain [192.168.0.1]) t/mailboxes/mailarc-2.txt:163: by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 t/mailboxes/mailarc-2.txt:164: for ; Thu, 1 Jan 1998 05:06:33 -0500 (EST) t/mailboxes/mailarc-2.txt:165:Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) t/mailboxes/mailarc-2.txt:166:From: David Kott t/mailboxes/mailarc-2.txt:167:Sender: dakott@kott.my.domain t/mailboxes/mailarc-2.txt:168:To: handyboard@media.mit.edu t/mailboxes/mailarc-2.txt:169:Subject: Re: Digital outputs. t/mailboxes/mailarc-2.txt:170:In-Reply-To: <199712312227.QAA03595@augusta.netperceptions.com> t/mailboxes/mailarc-2.txt:171:Message-Id: t/mailboxes/mailarc-2.txt:172:Mime-Version: 1.0 t/mailboxes/mailarc-2.txt:173:Content-Type: TEXT/PLAIN; charset=US-ASCII t/mailboxes/mailarc-2.txt: :X-Mailfolder: t/mailboxes/mailarc-2.txt t/mailboxes/mailarc-2.txt:174: t/mailboxes/mailarc-2.txt:175:On Wed, 31 Dec 1997, Tom Brusehaver wrote: t/mailboxes/mailarc-2.txt:176: t/mailboxes/mailarc-2.txt:177: t/mailboxes/mailarc-2.txt:178:> t/mailboxes/mailarc-2.txt:179:> G> Wich are the options to have 3 digital outputs in the handyboard? t/mailboxes/mailarc-2.txt:180:> G> No matter if i have to do little modifications to the Hardware. I t/mailboxes/mailarc-2.txt:181:> G> already know how to conect the keypad if you can tell me how t/mailboxes/mailarc-2.txt:182:> G> obtain 3 outputs.. :) t/mailboxes/mailarc-2.txt:183:> t/mailboxes/mailarc-2.txt:184:> t/mailboxes/mailarc-2.txt:185:> The SPI port is sitting there. I think you can get at 3 outputs from t/mailboxes/mailarc-2.txt:186:> those pins (SD/RD/CLK). t/mailboxes/mailarc-2.txt:187:> t/mailboxes/mailarc-2.txt:188: t/mailboxes/mailarc-2.txt:189: t/mailboxes/mailarc-2.txt:190:yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port t/mailboxes/mailarc-2.txt:191:for a much more extensible I/O system. As you know, SPI uses 4 basic t/mailboxes/mailarc-2.txt:192:control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in t/mailboxes/mailarc-2.txt:193:Embedded Controllers class is hook up a Serial In/Parallel Out t/mailboxes/mailarc-2.txt:194:(hereforward referred to as a SIPO) shift register. You must have at t/mailboxes/mailarc-2.txt:195:least ONE output available, so, this pretty much eliminates a L293 or, if t/mailboxes/mailarc-2.txt:196:you are bold enough, obtain additional outputs using a '138 as outlined in t/mailboxes/mailarc-2.txt:197:the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. t/mailboxes/mailarc-2.txt:198: t/mailboxes/mailarc-2.txt:199:Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the t/mailboxes/mailarc-2.txt:200:SPI's CLK output to the SIPO's clock pin. Use a transparent latch to t/mailboxes/mailarc-2.txt:201:update and hold the data on the outputs of the SIPO and update it with the t/mailboxes/mailarc-2.txt:202:one output pin, perhaps a 74373. t/mailboxes/mailarc-2.txt:203: t/mailboxes/mailarc-2.txt:204:To update the new 8 bits of data appearing at your latch's output, you load t/mailboxes/mailarc-2.txt:205:the SPI's data register with the byte value that you want to have across t/mailboxes/mailarc-2.txt:206:your new outputs. This data will be shifted out during the next 8 E-clock t/mailboxes/mailarc-2.txt:207:cycles. After the SPI's data register is empty indicating that the SIPO t/mailboxes/mailarc-2.txt:208:has the output byte on it's parallel outputs, pulse the single control t/mailboxes/mailarc-2.txt:209:output to update the latch's outputs. t/mailboxes/mailarc-2.txt:210: t/mailboxes/mailarc-2.txt:211:With this arrangement, you could, in theory, have many, many SIPO shift t/mailboxes/mailarc-2.txt:212:register/Latch pairs; the Serial Data In of the next stage connected to t/mailboxes/mailarc-2.txt:213:the last Parallel Output on the previous adjacent stage. t/mailboxes/mailarc-2.txt:214: t/mailboxes/mailarc-2.txt:215:One would just have to make sure that you coordinated the number of stages t/mailboxes/mailarc-2.txt:216:with the number of bytes outshifted by the SPI data register (naturally). t/mailboxes/mailarc-2.txt:217:The downside to this arrangement is the time it takes to update a digital t/mailboxes/mailarc-2.txt:218:output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be t/mailboxes/mailarc-2.txt:219:loaded and shifted out to change just ONE output. The upside is, the data t/mailboxes/mailarc-2.txt:220:will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update t/mailboxes/mailarc-2.txt:221:time. Not suitable for time critical applications, (PWM, Communication) t/mailboxes/mailarc-2.txt:222:but not bad for bulk outputs. t/mailboxes/mailarc-2.txt:223: t/mailboxes/mailarc-2.txt:224:I don't think I have explained my little circuit here very well.. perhaps t/mailboxes/mailarc-2.txt:225:an ASCII graphic? t/mailboxes/mailarc-2.txt:226: t/mailboxes/mailarc-2.txt:227: Output originally going to an L293D t/mailboxes/mailarc-2.txt:228: +---------------------------------------+ t/mailboxes/mailarc-2.txt:229: |Or added via a '138 from the | t/mailboxes/mailarc-2.txt:230: |expansion buss. | t/mailboxes/mailarc-2.txt:231: | +--+----+ t/mailboxes/mailarc-2.txt:232:+----+---------+ +---------+ | LE | t/mailboxes/mailarc-2.txt:233:| | SPI CLK |'164 PO0|----| '373 |---- t/mailboxes/mailarc-2.txt:234:| +-----------+ CP PO1|----| |---- t/mailboxes/mailarc-2.txt:235:| 68HC11 | SPI MOSI | PO2|----| |---- t/mailboxes/mailarc-2.txt:236:| +-----------+ Data PO3|----| |---- New t/mailboxes/mailarc-2.txt:237:| | | PO4|----| |---- Digital t/mailboxes/mailarc-2.txt:238:+--------------+ | PO5|----| |---- Outputs t/mailboxes/mailarc-2.txt:239: | PO6|----| |---- t/mailboxes/mailarc-2.txt:240: | PO7|----| |---- t/mailboxes/mailarc-2.txt:241: +---------+ +-------+ t/mailboxes/mailarc-2.txt:242: t/mailboxes/mailarc-2.txt:243: t/mailboxes/mailarc-2.txt:244:Where: t/mailboxes/mailarc-2.txt:245: PO# is a "Parallel Output" on a SIPO t/mailboxes/mailarc-2.txt:246: Data is the "Serial Data Input" on a SIPO t/mailboxes/mailarc-2.txt:247: CP is the SIPO's clock t/mailboxes/mailarc-2.txt:248: t/mailboxes/mailarc-2.txt:249: t/mailboxes/mailarc-2.txt:250: -d t/mailboxes/mailarc-2.txt:251: t/mailboxes/mailarc-2.txt:252: t/mailboxes/mailarc-2.txt:253:Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to t/mailboxes/mailarc-2.txt:254:an 8 bit operating system originally coded for a 4 bit microprocessor, t/mailboxes/mailarc-2.txt:255:written by a 2 bit company that can't stand 1 bit of competition. -UGU t/mailboxes/mailarc-2.txt:256: t/mailboxes/mailarc-2.txt:257: t/mailboxes/mailarc-2.txt:258: grepmail-5.3111/t/Test/Utils.pm000644 000765 000024 00000005173 13320460525 016673 0ustar00coppitstaff000000 000000 package Test::Utils; use strict; use Exporter; use Test::More; use FileHandle; use File::Spec::Functions qw( :ALL ); use File::Temp; use File::Slurper qw(read_text); use Config; use vars qw( @EXPORT @ISA ); use Mail::Mbox::MessageParser; @ISA = qw( Exporter ); @EXPORT = qw( Do_Diff Module_Installed %PROGRAMS $TEMPDIR No_such_file_or_directory $single_quote $command_separator $set_env perl_with_inc catbin ); use vars qw( $TEMPDIR %PROGRAMS $single_quote $command_separator $set_env ); $TEMPDIR = File::Temp::tempdir(); if ($^O eq 'MSWin32') { $set_env = 'set'; $single_quote = '"'; $command_separator = '&'; } else { $set_env = ''; $single_quote = "'"; $command_separator = ''; } %PROGRAMS = ( 'gzip' => '/usr/cs/contrib/bin/gzip', 'compress' => '/usr/cs/contrib/bin/gzip', 'bzip' => undef, 'bzip2' => undef, 'lzip' => undef, 'xz' => undef, ); # --------------------------------------------------------------------------- sub Do_Diff { my $filename = shift; my $output_filename = shift; local $Test::Builder::Level = 2; my @data1 = read_text($filename, undef, 1); my @data2 = read_text($output_filename, undef, 1); is_deeply(\@data1,\@data2,"$filename compared to $output_filename"); } # --------------------------------------------------------------------------- sub Module_Installed { my $module_name = shift; $module_name =~ s#::#/#g; $module_name .= '.pm'; foreach my $inc (@INC) { return 1 if -e catfile($inc,$module_name); } return 0; } # --------------------------------------------------------------------------- sub No_such_file_or_directory { my $filename = 0; $filename++ while -e $filename; local $!; my $foo = new FileHandle; $foo->open($filename); die q{Couldn't determine local text for "No such file or directory"} if $! eq ''; return $!; } # --------------------------------------------------------------------------- sub perl_with_inc { my $path_to_perl = $Config{perlpath}; my @standard_inc = split /###/, `"$path_to_perl" -e '\$" = "###";print "\@INC"'`; my @extra_inc; foreach my $inc (@INC) { push @extra_inc, "$single_quote$inc$single_quote" unless grep { /^$inc$/ } @standard_inc; } if (@extra_inc) { local $" = ' -I'; return qq{"$path_to_perl" -I@extra_inc}; } else { return qq{"$path_to_perl"}; } } # --------------------------------------------------------------------------- # Unfortunately ExtUtils::Command::cat() doesn't do binmode sub catbin { local $/ = \4096; binmode STDOUT; foreach my $arg (@ARGV) { open IN, $arg or die "Can't open $arg: $!"; binmode IN; print while ; } } 1; grepmail-5.3111/t/Test/ConfigureGrepmail.pm000644 000765 000024 00000001713 13320454742 021175 0ustar00coppitstaff000000 000000 package Test::ConfigureGrepmail; use strict; use File::Slurper qw(read_text write_text); sub Set_Caching_And_Grep { my $filename = shift; my $enable_caching = shift; my $enable_grep = shift; my $code = read_text($filename, undef, 1); $code =~ s/^\$USE_CACHING = (\d+);/\$USE_CACHING = $enable_caching;/m; $code =~ s/^\$USE_GREP = (\d+);/\$USE_GREP = $enable_grep;/m; write_text($filename, $code, undef, 1); } # -------------------------------------------------------------------------- sub Set_Cache_File { my $filename = shift; my $cache_file = shift; my $code = read_text($filename, undef, 1); if ($code =~ /(Mail::Mbox::MessageParser::SETUP_CACHE\( {.*?} *\))/s) { my $original_cache_setup = $1; my $new_cache_setup = $original_cache_setup; $new_cache_setup =~ s/('file_name'\s*=>\s*)".*?"/$1"$cache_file"/; $code =~ s/\Q$original_cache_setup\E/$new_cache_setup/; } write_text($filename, $code, undef, 1); } 1; grepmail-5.3111/inc/File/000755 000765 000024 00000000000 13321551743 015501 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/Module/000755 000765 000024 00000000000 13321551743 016047 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/URI/000755 000765 000024 00000000000 13321551743 015261 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/URI/Escape.pm000644 000765 000024 00000004316 13321551652 017022 0ustar00coppitstaff000000 000000 #line 1 package URI::Escape; use strict; use warnings; #line 138 use Exporter 'import'; our %escapes; our @EXPORT = qw(uri_escape uri_unescape uri_escape_utf8); our @EXPORT_OK = qw(%escapes); our $VERSION = "3.31"; use Carp (); # Build a char->hex map for (0..255) { $escapes{chr($_)} = sprintf("%%%02X", $_); } my %subst; # compiled patterns my %Unsafe = ( RFC2732 => qr/[^A-Za-z0-9\-_.!~*'()]/, RFC3986 => qr/[^A-Za-z0-9\-\._~]/, ); sub uri_escape { my($text, $patn) = @_; return undef unless defined $text; if (defined $patn){ unless (exists $subst{$patn}) { # Because we can't compile the regex we fake it with a cached sub (my $tmp = $patn) =~ s,/,\\/,g; eval "\$subst{\$patn} = sub {\$_[0] =~ s/([$tmp])/\$escapes{\$1} || _fail_hi(\$1)/ge; }"; Carp::croak("uri_escape: $@") if $@; } &{$subst{$patn}}($text); } else { $text =~ s/($Unsafe{RFC3986})/$escapes{$1} || _fail_hi($1)/ge; } $text; } sub _fail_hi { my $chr = shift; Carp::croak(sprintf "Can't escape \\x{%04X}, try uri_escape_utf8() instead", ord($chr)); } sub uri_escape_utf8 { my $text = shift; utf8::encode($text); return uri_escape($text, @_); } sub uri_unescape { # Note from RFC1630: "Sequences which start with a percent sign # but are not followed by two hexadecimal characters are reserved # for future extension" my $str = shift; if (@_ && wantarray) { # not executed for the common case of a single argument my @str = ($str, @_); # need to copy for (@str) { s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; } return @str; } $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg if defined $str; $str; } # XXX FIXME escape_char is buggy as it assigns meaning to the string's storage format. sub escape_char { # Old versions of utf8::is_utf8() didn't properly handle magical vars (e.g. $1). # The following forces a fetch to occur beforehand. my $dummy = substr($_[0], 0, 0); if (utf8::is_utf8($_[0])) { my $s = shift; utf8::encode($s); unshift(@_, $s); } return join '', @URI::Escape::escapes{split //, $_[0]}; } 1; grepmail-5.3111/inc/Module/Install/000755 000765 000024 00000000000 13321551743 017455 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/Module/AutoInstall.pm000644 000765 000024 00000062311 13321551653 020647 0ustar00coppitstaff000000 000000 #line 1 package Module::AutoInstall; use strict; use Cwd (); use File::Spec (); use ExtUtils::MakeMaker (); use vars qw{$VERSION}; BEGIN { $VERSION = '1.19'; } # special map on pre-defined feature sets my %FeatureMap = ( '' => 'Core Features', # XXX: deprecated '-core' => 'Core Features', ); # various lexical flags my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS ); my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps, $UpgradeDeps ); my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps, $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps, $PostambleActionsListAllDeps, $PostambleUsed, $NoTest); # See if it's a testing or non-interactive session _accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); _init(); sub _accept_default { $AcceptDefault = shift; } sub _installdeps_target { $InstallDepsTarget = shift; } sub missing_modules { return @Missing; } sub do_install { __PACKAGE__->install( [ $Config ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) : () ], @Missing, ); } # initialize various flags, and/or perform install sub _init { foreach my $arg ( @ARGV, split( /[\s\t]+/, $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || '' ) ) { if ( $arg =~ /^--config=(.*)$/ ) { $Config = [ split( ',', $1 ) ]; } elsif ( $arg =~ /^--installdeps=(.*)$/ ) { __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) { $UpgradeDeps = 1; __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--default(?:deps)?$/ ) { $AcceptDefault = 1; } elsif ( $arg =~ /^--check(?:deps)?$/ ) { $CheckOnly = 1; } elsif ( $arg =~ /^--skip(?:deps)?$/ ) { $SkipInstall = 1; } elsif ( $arg =~ /^--test(?:only)?$/ ) { $TestOnly = 1; } elsif ( $arg =~ /^--all(?:deps)?$/ ) { $AllDeps = 1; } } } # overrides MakeMaker's prompt() to automatically accept the default choice sub _prompt { goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault; my ( $prompt, $default ) = @_; my $y = ( $default =~ /^[Yy]/ ); print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] '; print "$default\n"; return $default; } # the workhorse sub import { my $class = shift; my @args = @_ or return; my $core_all; print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; my $cwd = Cwd::getcwd(); $Config = []; my $maxlen = length( ( sort { length($b) <=> length($a) } grep { /^[^\-]/ } map { ref($_) ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} ) : '' } map { +{@args}->{$_} } grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} } )[0] ); # We want to know if we're under CPAN early to avoid prompting, but # if we aren't going to try and install anything anyway then skip the # check entirely since we don't want to have to load (and configure) # an old CPAN just for a cosmetic message $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget; while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) { my ( @required, @tests, @skiptests ); my $default = 1; my $conflict = 0; if ( $feature =~ m/^-(\w+)$/ ) { my $option = lc($1); # check for a newer version of myself _update_to( $modules, @_ ) and return if $option eq 'version'; # sets CPAN configuration options $Config = $modules if $option eq 'config'; # promote every features to core status $core_all = ( $modules =~ /^all$/i ) and next if $option eq 'core'; next unless $option eq 'core'; } print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n"; $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { my $option = lc($1); $default = $arg if ( $option eq 'default' ); $conflict = $arg if ( $option eq 'conflict' ); @tests = @{$arg} if ( $option eq 'tests' ); @skiptests = @{$arg} if ( $option eq 'skiptests' ); next; } printf( "- %-${maxlen}s ...", $mod ); if ( $arg and $arg =~ /^\D/ ) { unshift @$modules, $arg; $arg = 0; } # XXX: check for conflicts and uninstalls(!) them. my $cur = _version_of($mod); if (_version_cmp ($cur, $arg) >= 0) { print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n"; push @Existing, $mod => $arg; $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { if (not defined $cur) # indeed missing { print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n"; } else { # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above print "too old. ($cur < $arg)\n"; } push @required, $mod => $arg; } } next unless @required; my $mandatory = ( $feature eq '-core' or $core_all ); if ( !$SkipInstall and ( $CheckOnly or ($mandatory and $UnderCPAN) or $AllDeps or $InstallDepsTarget or _prompt( qq{==> Auto-install the } . ( @required / 2 ) . ( $mandatory ? ' mandatory' : ' optional' ) . qq{ module(s) from CPAN?}, $default ? 'y' : 'n', ) =~ /^[Yy]/ ) ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } elsif ( !$SkipInstall and $default and $mandatory and _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', ) =~ /^[Nn]/ ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { $DisabledTests{$_} = 1 for map { glob($_) } @tests; } } if ( @Missing and not( $CheckOnly or $UnderCPAN) ) { require Config; my $make = $Config::Config{make}; if ($InstallDepsTarget) { print "*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n"; } else { print "*** Dependencies will be installed the next time you type '$make'.\n"; } # make an educated guess of whether we'll need root permission. print " (You may need to do that as the 'root' user.)\n" if eval '$>'; } print "*** $class configuration finished.\n"; chdir $cwd; # import to main:: no strict 'refs'; *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main'; return (@Existing, @Missing); } sub _running_under { my $thing = shift; print <<"END_MESSAGE"; *** Since we're running under ${thing}, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } # Check to see if we are currently running under CPAN.pm and/or CPANPLUS; # if we are, then we simply let it taking care of our dependencies sub _check_lock { return unless @Missing or @_; if ($ENV{PERL5_CPANM_IS_RUNNING}) { return _running_under('cpanminus'); } my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING}; if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) { return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS'); } require CPAN; if ($CPAN::VERSION > '1.89') { if ($cpan_env) { return _running_under('CPAN'); } return; # CPAN.pm new enough, don't need to check further } # last ditch attempt, this -will- configure CPAN, very sorry _load_cpan(1); # force initialize even though it's already loaded # Find the CPAN lock-file my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" ); return unless -f $lock; # Check the lock local *LOCK; return unless open(LOCK, $lock); if ( ( $^O eq 'MSWin32' ? _under_cpan() : == getppid() ) and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore' ) { print <<'END_MESSAGE'; *** Since we're running under CPAN, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } close LOCK; return; } sub install { my $class = shift; my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); my ( @modules, @installed, @modules_to_upgrade ); while (my ($pkg, $ver) = splice(@_, 0, 2)) { # grep out those already installed if (_version_cmp(_version_of($pkg), $ver) >= 0) { push @installed, $pkg; if ($UpgradeDeps) { push @modules_to_upgrade, $pkg, $ver; } } else { push @modules, $pkg, $ver; } } if ($UpgradeDeps) { push @modules, @modules_to_upgrade; @installed = (); @modules_to_upgrade = (); } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell print "*** Installing dependencies...\n"; return unless _connected_to('cpan.org'); my %args = @config; my %failed; local *FAILED; if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) { while () { chomp; $failed{$_}++ } close FAILED; my @newmod; while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) { push @newmod, ( $k => $v ) unless $failed{$k}; } @modules = @newmod; } if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) { _install_cpanplus( \@modules, \@config ); } else { _install_cpan( \@modules, \@config ); } print "*** $class installation finished.\n"; # see if we have successfully installed them while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { push @installed, $pkg; } elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) { print FAILED "$pkg\n"; } } close FAILED if $args{do_once}; return @installed; } sub _install_cpanplus { my @modules = @{ +shift }; my @config = _cpanplus_config( @{ +shift } ); my $installed = 0; require CPANPLUS::Backend; my $cp = CPANPLUS::Backend->new; my $conf = $cp->configure_object; return unless $conf->can('conf') # 0.05x+ with "sudo" support or _can_write($conf->_get_build('base')); # 0.04x # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $conf->get_conf('makeflags') || ''; if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) { # 0.03+ uses a hashref here $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST}; } else { # 0.02 and below uses a scalar $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); } $conf->set_conf( makeflags => $makeflags ); $conf->set_conf( prereqs => 1 ); while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) { $conf->set_conf( $key, $val ); } my $modtree = $cp->module_tree; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { print "*** Installing $pkg...\n"; MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; my $success; my $obj = $modtree->{$pkg}; if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = $cp->install( modules => [ $obj->{module} ] ); if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation cancelled.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _cpanplus_config { my @config = (); while ( @_ ) { my ($key, $value) = (shift(), shift()); if ( $key eq 'prerequisites_policy' ) { if ( $value eq 'follow' ) { $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL(); } elsif ( $value eq 'ask' ) { $value = CPANPLUS::Internals::Constants::PREREQ_ASK(); } elsif ( $value eq 'ignore' ) { $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE(); } else { die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n"; } push @config, 'prereqs', $value; } elsif ( $key eq 'force' ) { push @config, $key, $value; } elsif ( $key eq 'notest' ) { push @config, 'skiptest', $value; } else { die "*** Cannot convert option $key to CPANPLUS version.\n"; } } return @config; } sub _install_cpan { my @modules = @{ +shift }; my @config = @{ +shift }; my $installed = 0; my %args; _load_cpan(); require Config; if (CPAN->VERSION < 1.80) { # no "sudo" support, probe for writableness return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) ) and _can_write( $Config::Config{sitelib} ); } # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $CPAN::Config->{make_install_arg} || ''; $CPAN::Config->{make_install_arg} = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); # don't show start-up info $CPAN::Config->{inhibit_startup_message} = 1; # set additional options while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { die "Your version of CPAN is too old to support the 'notest' pragma"; } local $CPAN::Config->{prerequisites_policy} = 'follow'; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; print "*** Installing $pkg...\n"; my $obj = CPAN::Shell->expand( Module => $pkg ); my $success = 0; if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = do { if ($args{force}) { CPAN::Shell->force( install => $pkg ) } elsif ($args{notest}) { CPAN::Shell->notest( install => $pkg ) } else { CPAN::Shell->install($pkg) } }; $rv ||= eval { $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, ) ->{install} if $CPAN::META; }; if ( $rv eq 'YES' ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation failed.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _has_cpanplus { return ( $HasCPANPLUS = ( $INC{'CPANPLUS/Config.pm'} or _load('CPANPLUS::Shell::Default') ) ); } # make guesses on whether we're under the CPAN installation directory sub _under_cpan { require Cwd; require File::Spec; my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); } sub _update_to { my $class = __PACKAGE__; my $ver = shift; return if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade if ( _prompt( "==> A newer version of $class ($ver) is required. Install?", 'y' ) =~ /^[Nn]/ ) { die "*** Please install $class $ver manually.\n"; } print << "."; *** Trying to fetch it from CPAN... . # install ourselves _load($class) and return $class->import(@_) if $class->install( [], $class, $ver ); print << '.'; exit 1; *** Cannot bootstrap myself. :-( Installation terminated. . } # check if we're connected to some host, using inet_aton sub _connected_to { my $site = shift; return ( ( _load('Socket') and Socket::inet_aton($site) ) or _prompt( qq( *** Your host cannot resolve the domain name '$site', which probably means the Internet connections are unavailable. ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/ ); } # check if a directory is writable; may create it on demand sub _can_write { my $path = shift; mkdir( $path, 0755 ) unless -e $path; return 1 if -w $path; print << "."; *** You are not allowed to write to the directory '$path'; the installation may fail due to insufficient permissions. . if ( eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt( qq( ==> Should we try to re-execute the autoinstall process with 'sudo'?), ((-t STDIN) ? 'y' : 'n') ) =~ /^[Yy]/ ) { # try to bootstrap ourselves from sudo print << "."; *** Trying to re-execute the autoinstall process with 'sudo'... . my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; return unless system( 'sudo', $^X, $0, "--config=$config", "--installdeps=$missing" ); print << "."; *** The 'sudo' command exited with error! Resuming... . } return _prompt( qq( ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/; } # load a module and return the version it reports sub _load { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; local $@; return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 ); } # report version without loading a module sub _version_of { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; foreach my $dir ( @INC ) { next if ref $dir; my $path = File::Spec->catfile($dir, $file); next unless -e $path; require ExtUtils::MM_Unix; return ExtUtils::MM_Unix->parse_version($path); } return undef; } # Load CPAN.pm and it's configuration sub _load_cpan { return if $CPAN::VERSION and $CPAN::Config and not @_; require CPAN; # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to # CPAN::HandleConfig->load. CPAN reports that the redirection # is deprecated in a warning printed at the user. # CPAN-1.81 expects CPAN::HandleConfig->load, does not have # $CPAN::HandleConfig::VERSION but cannot handle # CPAN::Config->load # Which "versions expect CPAN::Config->load? if ( $CPAN::HandleConfig::VERSION || CPAN::HandleConfig->can('load') ) { # Newer versions of CPAN have a HandleConfig module CPAN::HandleConfig->load; } else { # Older versions had the load method in Config directly CPAN::Config->load; } } # compare two versions, either use Sort::Versions or plain comparison # return values same as <=> sub _version_cmp { my ( $cur, $min ) = @_; return -1 unless defined $cur; # if 0 keep comparing return 1 unless $min; $cur =~ s/\s+$//; # check for version numbers that are not in decimal format if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) { if ( ( $version::VERSION or defined( _load('version') )) and version->can('new') ) { # use version.pm if it is installed. return version->new($cur) <=> version->new($min); } elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) ) { # use Sort::Versions as the sorting algorithm for a.b.c versions return Sort::Versions::versioncmp( $cur, $min ); } warn "Cannot reliably compare non-decimal formatted versions.\n" . "Please install version.pm or Sort::Versions.\n"; } # plain comparison local $^W = 0; # shuts off 'not numeric' bugs return $cur <=> $min; } # nothing; this usage is deprecated. sub main::PREREQ_PM { return {}; } sub _make_args { my %args = @_; $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing } if $UnderCPAN or $TestOnly; if ( $args{EXE_FILES} and -e 'MANIFEST' ) { require ExtUtils::Manifest; my $manifest = ExtUtils::Manifest::maniread('MANIFEST'); $args{EXE_FILES} = [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ]; } $args{test}{TESTS} ||= 't/*.t'; $args{test}{TESTS} = join( ' ', grep { !exists( $DisabledTests{$_} ) } map { glob($_) } split( /\s+/, $args{test}{TESTS} ) ); my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; $PostambleActions = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); my $deps_list = join( ',', @Missing, @Existing ); $PostambleActionsUpgradeDeps = "\$(PERL) $0 --config=$config --upgradedeps=$deps_list"; my $config_notest = join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}), 'notest', 1 ) if $Config; $PostambleActionsNoTest = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); $PostambleActionsUpgradeDepsNoTest = "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list"; $PostambleActionsListDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing); my @all = (@Missing, @Existing); $PostambleActionsListAllDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all); return %args; } # a wrapper to ExtUtils::MakeMaker::WriteMakefile sub Write { require Carp; Carp::croak "WriteMakefile: Need even number of args" if @_ % 2; if ($CheckOnly) { print << "."; *** Makefile not written in check-only mode. . return; } my %args = _make_args(@_); no strict 'refs'; $PostambleUsed = 0; local *MY::postamble = \&postamble unless defined &MY::postamble; ExtUtils::MakeMaker::WriteMakefile(%args); print << "." unless $PostambleUsed; *** WARNING: Makefile written with customized MY::postamble() without including contents from Module::AutoInstall::postamble() -- auto installation features disabled. Please contact the author. . return 1; } sub postamble { $PostambleUsed = 1; my $fragment; $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget; config :: installdeps \t\$(NOECHO) \$(NOOP) AUTO_INSTALL $fragment .= <<"END_MAKE"; checkdeps :: \t\$(PERL) $0 --checkdeps installdeps :: \t$PostambleActions installdeps_notest :: \t$PostambleActionsNoTest upgradedeps :: \t$PostambleActionsUpgradeDeps upgradedeps_notest :: \t$PostambleActionsUpgradeDepsNoTest listdeps :: \t$PostambleActionsListDeps listalldeps :: \t$PostambleActionsListAllDeps END_MAKE return $fragment; } 1; __END__ #line 1197 grepmail-5.3111/inc/Module/Install.pm000644 000765 000024 00000027145 13321551652 020023 0ustar00coppitstaff000000 000000 #line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.19'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS'; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( {no_chdir => 1, wanted => sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($File::Find::name); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }}, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. grepmail-5.3111/inc/Module/Install/Fetch.pm000644 000765 000024 00000004627 13321551653 021055 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; grepmail-5.3111/inc/Module/Install/AutomatedTester.pm000644 000765 000024 00000000512 13321551653 023123 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::AutomatedTester; use strict; use warnings; use base qw(Module::Install::Base); use vars qw($VERSION); $VERSION = '0.04'; sub auto_tester { return if $Module::Install::AUTHOR; return $ENV{AUTOMATED_TESTING}; } sub cpan_tester { &auto_tester; } 'ARE WE BEING SMOKED?'; __END__ #line 78 grepmail-5.3111/inc/Module/Install/Metadata.pm000644 000765 000024 00000043302 13321551652 021534 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; grepmail-5.3111/inc/Module/Install/Bugtracker.pm000644 000765 000024 00000001123 13321551652 022100 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Bugtracker; use 5.006; use strict; use warnings; use base qw(Module::Install::Base); our $VERSION = sprintf "%d.%02d%02d", q/0.3.6/ =~ /(\d+)/g; sub auto_set_bugtracker { my $self = shift; if ($self->name) { $self->include_deps('URI::Escape'); require URI::Escape; $self->bugtracker( sprintf 'http://rt.cpan.org/Public/Dist/Display.html?Name=%s', URI::Escape::uri_escape($self->name), ); } else { warn "can't set bugtracker if 'name' is not set\n"; } } 1; __END__ #line 101 grepmail-5.3111/inc/Module/Install/AutoLicense.pm000644 000765 000024 00000003166 13321551653 022234 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::AutoLicense; use strict; use warnings; use base qw(Module::Install::Base); use vars qw($VERSION); $VERSION = '0.10'; my %licenses = ( perl => 'Software::License::Perl_5', apache => 'Software::License::Apache_2_0', artistic => 'Software::License::Artistic_1_0', artistic_2 => 'Software::License::Artistic_2_0', lgpl2 => 'Software::License::LGPL_2_1', lgpl3 => 'Software::License::LGPL_3_0', bsd => 'Software::License::BSD', gpl => 'Software::License::GPL_1', gpl2 => 'Software::License::GPL_2', gpl3 => 'Software::License::GPL_3', mit => 'Software::License::MIT', mozilla => 'Software::License::Mozilla_1_1', ); sub auto_license { my $self = shift; return unless $Module::Install::AUTHOR; my %opts = @_; $opts{lc $_} = delete $opts{$_} for keys %opts; my $holder = $opts{holder} || _get_authors( $self ); #my $holder = $opts{holder} || $self->author; my $license = $self->license(); unless ( defined $licenses{ $license } ) { warn "No license definition for '$license', aborting\n"; return 1; } my $class = $licenses{ $license }; eval "require $class"; my $sl = $class->new( { holder => $holder } ); open LICENSE, '>LICENSE' or die "$!\n"; print LICENSE $sl->fulltext; close LICENSE; $self->postamble(<<"END"); distclean :: license_clean license_clean: \t\$(RM_F) LICENSE END return 1; } sub _get_authors { my $self = shift; my $joined = join ', ', @{ $self->author() || [] }; return $joined; } 'Licensed to auto'; __END__ #line 125 grepmail-5.3111/inc/Module/Install/Win32.pm000644 000765 000024 00000003403 13321551653 020715 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; grepmail-5.3111/inc/Module/Install/CustomInstallationPath.pm000644 000765 000024 00000002114 13321551652 024461 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::CustomInstallationPath; use strict; use 5.005; use File::HomeDir; use Config; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.10.48/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub check_custom_installation { my $self = shift; $self->include_deps('File::HomeDir',0); return if (grep {/^PREFIX=/} @ARGV) || (grep {/^INSTALLDIRS=/} @ARGV); my $install_location = $self->prompt( "Would you like to install this package into a location other than the\n" . "default Perl location (i.e. change the PREFIX)?" => 'n'); if ($install_location eq 'y') { my $home = home(); die "Your home directory could not be determined. Aborting." unless defined $home; print "\n","-"x78,"\n\n"; my $prefix = $self->prompt( "What PREFIX should I use?\n=>" => $home); push @ARGV,"PREFIX=$prefix"; } } 1; # --------------------------------------------------------------------------- #line 108 grepmail-5.3111/inc/Module/Install/WriteAll.pm000644 000765 000024 00000002376 13321551653 021546 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; grepmail-5.3111/inc/Module/Install/Can.pm000644 000765 000024 00000006405 13321551652 020520 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; if ($^O eq 'VMS') { require ExtUtils::CBuilder; my $builder = ExtUtils::CBuilder->new( quiet => 1, ); return $builder->have_compiler; } my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 245 grepmail-5.3111/inc/Module/Install/StandardTests.pm000644 000765 000024 00000006717 13321551653 022611 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::StandardTests; use warnings; use strict; use File::Spec; use base 'Module::Install::Base'; our $VERSION = '0.05'; sub use_standard_tests { my ($self, %specs) = @_; my %with = map { $_ => 1 } qw/compile pod pod_coverage perl_critic/; if (exists $specs{without}) { $specs{without} = [ $specs{without} ] unless ref $specs{without}; delete $with{$_} for @{ $specs{without} }; } $self->build_requires('Test::More'); $self->build_requires('UNIVERSAL::require'); # Unlike other tests, this is mandatory. $self->build_requires('Test::Compile'); $self->write_standard_test_compile; # no if; this is mandatory $self->write_standard_test_pod if $with{pod}; $self->write_standard_test_pod_coverage if $with{pod_coverage}; $self->write_standard_test_perl_critic if $with{perl_critic}; } sub write_test_file { my ($self, $filename, $code) = @_; $filename = File::Spec->catfile('t', $filename); # Outdent the code somewhat. Remove first empty line, if any. Then # determine the indent of the first line. Throw that amount of indenting # away from any line. This allows you to indent the code so it's visually # clearer (see methods below) while creating output that's indented more # or less correctly. Smoke result HTML pages link to the .t files, so it # looks neater. $code =~ s/^ *\n//; (my $indent = $code) =~ s/^( *).*/$1/s; $code =~ s/^$indent//gm; print "Creating $filename\n"; open(my $fh, ">$filename") or die "can't create $filename $!"; my $perl = $^X; print $fh <realclean_files($filename); } sub write_standard_test_compile { my $self = shift; $self->write_test_file('000_standard__compile.t', q/ BEGIN { use Test::More; eval "use Test::Compile"; Test::More->builder->BAIL_OUT( "Test::Compile required for testing compilation") if $@; all_pm_files_ok(); } /); } sub write_standard_test_pod { my $self = shift; $self->write_test_file('000_standard__pod.t', q/ use Test::More; eval "use Test::Pod"; plan skip_all => "Test::Pod required for testing POD" if $@; all_pod_files_ok(); /); } sub write_standard_test_pod_coverage { my $self = shift; $self->write_test_file('000_standard__pod_coverage.t', q/ use Test::More; eval "use Test::Pod::Coverage"; plan skip_all => "Test::Pod::Coverage required for testing POD coverage" if $@; all_pod_coverage_ok(); /); } sub write_standard_test_perl_critic { my $self = shift; $self->write_test_file('000_standard__perl_critic.t', q/ use FindBin '$Bin'; use File::Spec; use UNIVERSAL::require; use Test::More; plan skip_all => 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.' unless $ENV{TEST_AUTHOR}; my %opt; my $rc_file = File::Spec->catfile($Bin, 'perlcriticrc'); $opt{'-profile'} = $rc_file if -r $rc_file; if (Perl::Critic->require('1.078') && Test::Perl::Critic->require && Test::Perl::Critic->import(%opt)) { all_critic_ok("lib"); } else { plan skip_all => $@; } /); } 1; __END__ #line 249 grepmail-5.3111/inc/Module/Install/PRIVATE/000755 000765 000024 00000000000 13321551743 020567 5ustar00coppitstaff000000 000000 grepmail-5.3111/inc/Module/Install/Include.pm000644 000765 000024 00000001015 13321551652 021372 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Include; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub include { shift()->admin->include(@_); } sub include_deps { shift()->admin->include_deps(@_); } sub auto_include { shift()->admin->auto_include(@_); } sub auto_include_deps { shift()->admin->auto_include_deps(@_); } sub auto_include_dependent_dists { shift()->admin->auto_include_dependent_dists(@_); } 1; grepmail-5.3111/inc/Module/Install/Makefile.pm000644 000765 000024 00000027437 13321551652 021544 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 grepmail-5.3111/inc/Module/Install/CheckOptional.pm000644 000765 000024 00000002173 13321551653 022541 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::CheckOptional; use strict; use 5.005; use Carp; # For module install and version checks use Module::AutoInstall; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base Module::AutoInstall ); $VERSION = sprintf "%d.%02d%02d", q/0.11.5/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub check_optional { my ($self, $module, $version, $message) = @_; # Tell Module::Install to include this, since we use it. $self->perl_version('5.005'); $self->include('Module::AutoInstall', 0); croak "check_optional requires a dependency and version such as \"Carp => 1.03\"" unless defined $module and defined $version; return if Module::AutoInstall::_version_cmp( Module::AutoInstall::_load($module), $version ) >= 0; print<can_run('git'); my $remote = shift || 'origin'; local $ENV{LC_ALL}='C'; local $ENV{LANG}='C'; return unless my ($git_url) = `git remote show -n $remote` =~ /URL: (.*)$/m; return unless $git_url =~ /github\.com/; # Not a Github repository my $http_url = $git_url; $git_url =~ s![\w\-]+\@([^:]+):!git://$1/!; $http_url =~ s![\w\-]+\@([^:]+):!https://$1/!; $http_url =~ s!\.git$!/!; $self->repository( $git_url ); $self->homepage( $http_url ) unless $self->homepage(); return 1; } sub _under_git { return 1 if -e '.git'; my $cwd = getcwd; my $last = $cwd; my $found = 0; while (1) { chdir '..' or last; my $current = getcwd; last if $last eq $current; $last = $current; if ( -e '.git' ) { $found = 1; last; } } chdir $cwd; return $found; } 'Github'; __END__ #line 113 grepmail-5.3111/inc/Module/Install/Scripts.pm000644 000765 000024 00000001011 13321551653 021433 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Scripts; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.19'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub install_script { my $self = shift; my $args = $self->makemaker_args; my $exe = $args->{EXE_FILES} ||= []; foreach ( @_ ) { if ( -f $_ ) { push @$exe, $_; } elsif ( -d 'script' and -f "script/$_" ) { push @$exe, "script/$_"; } else { die("Cannot find script '$_'"); } } } 1; grepmail-5.3111/inc/Module/Install/Base.pm000644 000765 000024 00000002147 13321551652 020670 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.19'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 grepmail-5.3111/inc/Module/Install/PRIVATE/Add_Test_Target.pm000644 000765 000024 00000001055 13321551653 024123 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::PRIVATE::Add_Test_Target; use strict; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.10.0/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub Add_Test_Target { my ($self, $target, $test) = @_; *main::MY::postamble = sub { return &Module::AutoInstall::postamble . <perl_version('5.005'); $self->include_deps('File::Slurper', 0); require File::Slurper; File::Slurper->import('read_text', 'write_text'); # Update compile test { my $test = read_text('t/000_standard__compile.t', undef, 1); $test =~ s#all_pm_files_ok\(\)#all_pl_files_ok('blib/script/$script_name')# or die "Couldn't update compile test"; write_text('t/000_standard__compile.t', $test, undef, 1); } # Update critic test { my $test = read_text('t/000_standard__perl_critic.t', undef, 1); $test =~ s#all_critic_ok\("lib"\)#all_critic_ok("blib")# or die "Couldn't update critic test"; write_text('t/000_standard__perl_critic.t', $test, undef, 1); } } 1; grepmail-5.3111/inc/Module/Install/PRIVATE/Enable_Verbose_CPAN_Testing.pm000644 000765 000024 00000002255 13321551653 026302 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::PRIVATE::Enable_Verbose_CPAN_Testing; use strict; use warnings; use lib 'inc'; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.1.0/ =~ /(\d+)/g; our( $ORIG_TEST_VIA_HARNESS ); # --------------------------------------------------------------------------- sub enable_verbose_cpan_testing { my ($self, @args) = @_; # Tell Module::Install to include this, since we use it. $self->perl_version('5.005'); $self->include_deps('Module::Install::AutomatedTester', 0); # Avoid subroutine redefined errors if (!defined(&Module::Install::AutomatedTester::auto_tester)) { require Module::Install::AutomatedTester; } return unless Module::Install::AutomatedTester::auto_tester(); unless(defined $ORIG_TEST_VIA_HARNESS) { $ORIG_TEST_VIA_HARNESS = MY->can('test_via_harness'); no warnings 'redefine'; *MY::test_via_harness = \&_force_verbose; } } sub _force_verbose { my($self, $perl, $tests) = @_; my $command = MY->$ORIG_TEST_VIA_HARNESS($perl || '$(FULLPERLRUN)', $tests); $command =~ s/\$\(TEST_VERBOSE\)/1/; return $command; } 1; grepmail-5.3111/inc/Module/Install/PRIVATE/Update_Test_Version.pm000644 000765 000024 00000002143 13321551653 025053 0ustar00coppitstaff000000 000000 #line 1 package Module::Install::PRIVATE::Update_Test_Version; use strict; use vars qw( @ISA $VERSION ); use Module::Install::Base; @ISA = qw( Module::Install::Base ); $VERSION = sprintf "%d.%02d%02d", q/0.10.0/ =~ /(\d+)/g; # --------------------------------------------------------------------------- sub Update_Test_Version { my $self = shift; my $file_with_version = shift; my $test_case_file = shift; $self->include_deps('File::Slurper', 0); require File::Slurper; File::Slurper->import('read_text', 'write_text'); open SOURCE, $file_with_version or die "Couldn't open grepmail file: $!"; my $found = 0; while (my $line = ) { if ($line =~ /^\$VERSION = (.*q\/(.*?)\/.*);/) { $found = 1; my $version = eval $1; my $test_case_code = read_text($test_case_file, undef, 1); $test_case_code =~ s/^grepmail .*$/grepmail $version/m; unlink $test_case_file; write_text("$test_case_file", $test_case_code, undef, 1); last; } } die "Couldn't find version line in $file_with_version" unless $found; close SOURCE; } 1; grepmail-5.3111/inc/File/HomeDir.pm000644 000765 000024 00000016653 13321551652 017400 0ustar00coppitstaff000000 000000 #line 1 package File::HomeDir; # See POD at end for documentation use 5.008003; use strict; use warnings; use Carp (); use Config (); use File::Spec (); use File::Which (); # Globals use vars qw{$VERSION @EXPORT @EXPORT_OK $IMPLEMENTED_BY}; ## no critic qw(AutomaticExportation) use base qw(Exporter); BEGIN { $VERSION = '1.004'; # Inherit manually require Exporter; @EXPORT = qw{home}; @EXPORT_OK = qw{ home my_home my_desktop my_documents my_music my_pictures my_videos my_data my_dist_config my_dist_data users_home users_desktop users_documents users_music users_pictures users_videos users_data }; } # Inlined Params::Util functions sub _CLASS ($) ## no critic qw(SubroutinePrototypes) { (defined $_[0] and not ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s) ? $_[0] : undef; } sub _DRIVER ($$) ## no critic qw(SubroutinePrototypes) { (defined _CLASS($_[0]) and eval "require $_[0]; 1" and $_[0]->isa($_[1]) and $_[0] ne $_[1]) ? $_[0] : undef; } # Platform detection if ($IMPLEMENTED_BY) { # Allow for custom HomeDir classes # Leave it as the existing value } elsif ($^O eq 'MSWin32') { # All versions of Windows $IMPLEMENTED_BY = 'File::HomeDir::Windows'; } elsif ($^O eq 'darwin') { # 1st: try Mac::SystemDirectory by chansen if (eval "require Mac::SystemDirectory; 1") { $IMPLEMENTED_BY = 'File::HomeDir::Darwin::Cocoa'; } elsif (eval "require Mac::Files; 1") { # 2nd try Mac::Files: Carbon - unmaintained since 2006 except some 64bit fixes $IMPLEMENTED_BY = 'File::HomeDir::Darwin::Carbon'; } else { # 3rd: fallback: pure perl $IMPLEMENTED_BY = 'File::HomeDir::Darwin'; } } elsif ($^O eq 'MacOS') { # Legacy Mac OS $IMPLEMENTED_BY = 'File::HomeDir::MacOS9'; } elsif (File::Which::which('xdg-user-dir')) { # freedesktop unixes $IMPLEMENTED_BY = 'File::HomeDir::FreeDesktop'; } else { # Default to Unix semantics $IMPLEMENTED_BY = 'File::HomeDir::Unix'; } unless (_DRIVER($IMPLEMENTED_BY, 'File::HomeDir::Driver')) { Carp::croak("Missing or invalid File::HomeDir driver $IMPLEMENTED_BY"); } ##################################################################### # Current User Methods sub my_home { $IMPLEMENTED_BY->my_home; } sub my_desktop { $IMPLEMENTED_BY->can('my_desktop') ? $IMPLEMENTED_BY->my_desktop : Carp::croak("The my_desktop method is not implemented on this platform"); } sub my_documents { $IMPLEMENTED_BY->can('my_documents') ? $IMPLEMENTED_BY->my_documents : Carp::croak("The my_documents method is not implemented on this platform"); } sub my_music { $IMPLEMENTED_BY->can('my_music') ? $IMPLEMENTED_BY->my_music : Carp::croak("The my_music method is not implemented on this platform"); } sub my_pictures { $IMPLEMENTED_BY->can('my_pictures') ? $IMPLEMENTED_BY->my_pictures : Carp::croak("The my_pictures method is not implemented on this platform"); } sub my_videos { $IMPLEMENTED_BY->can('my_videos') ? $IMPLEMENTED_BY->my_videos : Carp::croak("The my_videos method is not implemented on this platform"); } sub my_data { $IMPLEMENTED_BY->can('my_data') ? $IMPLEMENTED_BY->my_data : Carp::croak("The my_data method is not implemented on this platform"); } sub my_dist_data { my $params = ref $_[-1] eq 'HASH' ? pop : {}; my $dist = pop or Carp::croak("The my_dist_data method requires an argument"); my $data = my_data(); # If datadir is not defined, there's nothing we can do: bail out # and return nothing... return undef unless defined $data; # On traditional unixes, hide the top-level directory my $var = $data eq home() ? File::Spec->catdir($data, '.perl', 'dist', $dist) : File::Spec->catdir($data, 'Perl', 'dist', $dist); # directory exists: return it return $var if -d $var; # directory doesn't exist: check if we need to create it... return undef unless $params->{create}; # user requested directory creation require File::Path; File::Path::mkpath($var); return $var; } sub my_dist_config { my $params = ref $_[-1] eq 'HASH' ? pop : {}; my $dist = pop or Carp::croak("The my_dist_config method requires an argument"); # not all platforms support a specific my_config() method my $config = $IMPLEMENTED_BY->can('my_config') ? $IMPLEMENTED_BY->my_config : $IMPLEMENTED_BY->my_documents; # If neither configdir nor my_documents is defined, there's # nothing we can do: bail out and return nothing... return undef unless defined $config; # On traditional unixes, hide the top-level dir my $etc = $config eq home() ? File::Spec->catdir($config, '.perl', $dist) : File::Spec->catdir($config, 'Perl', $dist); # directory exists: return it return $etc if -d $etc; # directory doesn't exist: check if we need to create it... return undef unless $params->{create}; # user requested directory creation require File::Path; File::Path::mkpath($etc); return $etc; } ##################################################################### # General User Methods sub users_home { $IMPLEMENTED_BY->can('users_home') ? $IMPLEMENTED_BY->users_home($_[-1]) : Carp::croak("The users_home method is not implemented on this platform"); } sub users_desktop { $IMPLEMENTED_BY->can('users_desktop') ? $IMPLEMENTED_BY->users_desktop($_[-1]) : Carp::croak("The users_desktop method is not implemented on this platform"); } sub users_documents { $IMPLEMENTED_BY->can('users_documents') ? $IMPLEMENTED_BY->users_documents($_[-1]) : Carp::croak("The users_documents method is not implemented on this platform"); } sub users_music { $IMPLEMENTED_BY->can('users_music') ? $IMPLEMENTED_BY->users_music($_[-1]) : Carp::croak("The users_music method is not implemented on this platform"); } sub users_pictures { $IMPLEMENTED_BY->can('users_pictures') ? $IMPLEMENTED_BY->users_pictures($_[-1]) : Carp::croak("The users_pictures method is not implemented on this platform"); } sub users_videos { $IMPLEMENTED_BY->can('users_videos') ? $IMPLEMENTED_BY->users_videos($_[-1]) : Carp::croak("The users_videos method is not implemented on this platform"); } sub users_data { $IMPLEMENTED_BY->can('users_data') ? $IMPLEMENTED_BY->users_data($_[-1]) : Carp::croak("The users_data method is not implemented on this platform"); } ##################################################################### # Legacy Methods # Find the home directory of an arbitrary user sub home (;$) ## no critic qw(SubroutinePrototypes) { # Allow to be called as a method if ($_[0] and $_[0] eq 'File::HomeDir') { shift(); } # No params means my home return my_home() unless @_; # Check the param my $name = shift; if (!defined $name) { Carp::croak("Can't use undef as a username"); } if (!length $name) { Carp::croak("Can't use empty-string (\"\") as a username"); } # A dot also means my home ### Is this meant to mean File::Spec->curdir? if ($name eq '.') { return my_home(); } # Now hand off to the implementor $IMPLEMENTED_BY->users_home($name); } 1; __END__ #line 721 grepmail-5.3111/inc/File/Slurper.pm000644 000765 000024 00000005554 13321551653 017504 0ustar00coppitstaff000000 000000 #line 1 package File::Slurper; $File::Slurper::VERSION = '0.012'; use strict; use warnings; use Carp 'croak'; use Exporter 5.57 'import'; use Encode 2.11 qw/FB_CROAK STOP_AT_PARTIAL/; use PerlIO::encoding; our @EXPORT_OK = qw/read_binary read_text read_lines write_binary write_text read_dir/; sub read_binary { my $filename = shift; # This logic is a bit ugly, but gives a significant speed boost # because slurpy readline is not optimized for non-buffered usage open my $fh, '<:unix', $filename or croak "Couldn't open $filename: $!"; if (my $size = -s $fh) { my $buf; my ($pos, $read) = 0; do { defined($read = read $fh, ${$buf}, $size - $pos, $pos) or croak "Couldn't read $filename: $!"; $pos += $read; } while ($read && $pos < $size); return ${$buf}; } else { return do { local $/; <$fh> }; } } use constant { CRLF_DEFAULT => $^O eq 'MSWin32', HAS_UTF8_STRICT => scalar do { local $@; eval { require PerlIO::utf8_strict } }, }; sub _text_layers { my ($encoding, $crlf) = @_; $crlf = CRLF_DEFAULT if $crlf && $crlf eq 'auto'; if (HAS_UTF8_STRICT && $encoding =~ /^utf-?8\b/i) { return $crlf ? ':unix:utf8_strict:crlf' : ':unix:utf8_strict'; } else { # non-ascii compatible encodings such as UTF-16 need encoding before crlf return $crlf ? ":raw:encoding($encoding):crlf" : ":raw:encoding($encoding)"; } } sub read_text { my ($filename, $encoding, $crlf) = @_; $encoding ||= 'utf-8'; my $layer = _text_layers($encoding, $crlf); local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK; open my $fh, "<$layer", $filename or croak "Couldn't open $filename: $!"; return do { local $/; <$fh> }; } sub write_text { my ($filename, undef, $encoding, $crlf) = @_; $encoding ||= 'utf-8'; my $layer = _text_layers($encoding, $crlf); local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK; open my $fh, ">$layer", $filename or croak "Couldn't open $filename: $!"; print $fh $_[1] or croak "Couldn't write to $filename: $!"; close $fh or croak "Couldn't write to $filename: $!"; return; } sub write_binary { my $filename = $_[0]; open my $fh, ">:raw", $filename or croak "Couldn't open $filename: $!"; print $fh $_[1] or croak "Couldn't write to $filename: $!"; close $fh or croak "Couldn't write to $filename: $!"; return; } sub read_lines { my ($filename, $encoding, $crlf, $skip_chomp) = @_; $encoding ||= 'utf-8'; my $layer = _text_layers($encoding, $crlf); local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK; open my $fh, "<$layer", $filename or croak "Couldn't open $filename: $!"; return <$fh> if $skip_chomp; my @buf = <$fh>; close $fh; chomp @buf; return @buf; } sub read_dir { my ($dirname) = @_; opendir my ($dir), $dirname or croak "Could not open $dirname: $!"; return grep { not m/ \A \.\.? \z /x } readdir $dir; } 1; # ABSTRACT: A simple, sane and efficient module to slurp a file __END__ #line 206 grepmail-5.3111/inc/File/Which.pm000644 000765 000024 00000006355 13321551652 017111 0ustar00coppitstaff000000 000000 #line 1 package File::Which; use strict; use warnings; use Exporter (); use File::Spec (); # ABSTRACT: Perl implementation of the which utility as an API our $VERSION = '1.22'; # VERSION our @ISA = 'Exporter'; our @EXPORT = 'which'; our @EXPORT_OK = 'where'; use constant IS_VMS => ($^O eq 'VMS'); use constant IS_MAC => ($^O eq 'MacOS'); use constant IS_DOS => ($^O eq 'MSWin32' or $^O eq 'dos' or $^O eq 'os2'); use constant IS_CYG => ($^O eq 'cygwin' || $^O eq 'msys'); # For Win32 systems, stores the extensions used for # executable files # For others, the empty string is used # because 'perl' . '' eq 'perl' => easier my @PATHEXT = (''); if ( IS_DOS ) { # WinNT. PATHEXT might be set on Cygwin, but not used. if ( $ENV{PATHEXT} ) { push @PATHEXT, split ';', $ENV{PATHEXT}; } else { # Win9X or other: doesn't have PATHEXT, so needs hardcoded. push @PATHEXT, qw{.com .exe .bat}; } } elsif ( IS_VMS ) { push @PATHEXT, qw{.exe .com}; } elsif ( IS_CYG ) { # See this for more info # http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-exe push @PATHEXT, qw{.exe .com}; } sub which { my ($exec) = @_; return undef unless defined $exec; return undef if $exec eq ''; my $all = wantarray; my @results = (); # check for aliases first if ( IS_VMS ) { my $symbol = `SHOW SYMBOL $exec`; chomp($symbol); unless ( $? ) { return $symbol unless $all; push @results, $symbol; } } if ( IS_MAC ) { my @aliases = split /\,/, $ENV{Aliases}; foreach my $alias ( @aliases ) { # This has not been tested!! # PPT which says MPW-Perl cannot resolve `Alias $alias`, # let's just hope it's fixed if ( lc($alias) eq lc($exec) ) { chomp(my $file = `Alias $alias`); last unless $file; # if it failed, just go on the normal way return $file unless $all; push @results, $file; # we can stop this loop as if it finds more aliases matching, # it'll just be the same result anyway last; } } } return $exec if !IS_VMS and !IS_MAC and !IS_DOS and $exec =~ /\// and -f $exec and -x $exec; my @path = File::Spec->path; if ( IS_DOS or IS_VMS or IS_MAC ) { unshift @path, File::Spec->curdir; } foreach my $base ( map { File::Spec->catfile($_, $exec) } @path ) { for my $ext ( @PATHEXT ) { my $file = $base.$ext; # We don't want dirs (as they are -x) next if -d $file; if ( # Executable, normal case -x _ or ( # MacOS doesn't mark as executable so we check -e IS_MAC || ( ( IS_DOS or IS_CYG ) and grep { $file =~ /$_\z/i } @PATHEXT[1..$#PATHEXT] ) # DOSish systems don't pass -x on # non-exe/bat/com files. so we check -e. # However, we don't want to pass -e on files # that aren't in PATHEXT, like README. and -e _ ) ) { return $file unless $all; push @results, $file; } } } if ( $all ) { return @results; } else { return undef; } } sub where { # force wantarray my @res = which($_[0]); return @res; } 1; __END__ #line 336