To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 5699
5698  |  5700
Subject: 
Re: serial communications
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Mon, 1 Mar 1999 20:18:51 GMT
Original-From: 
Simon Schulz <simon.schulz@!IHateSpam!hagener-tgz.de>
Viewed: 
860 times
  
some days ago i played with this too. i send you my files ...
hope it helps ;)

/* beginning of serial.c */

int char1;

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);
}

int serial_getchar()
{
   while ((!(peek(0x102e) & 0x20))&&(!start_button())); /* wait for received
character */
   return peek(0x102f);
}

void serial_putchar(int c)
{
   while (!(peek(0x102e) & 0x80));  /* wait until serial transmit empty */
   poke(0x102f, c);             /* send character */
}
/* beginning of my work below !*/

void echo() {
        /* echo looks for a received char and sends it twice back */
        disable_pcode_serial();

        while (!start_button()) {
                char1=serial_getchar();

                 /* prints the actual char , the last char and the ascii
numbers in brakes on screen */
                printf("Actual:%c(%d)
Last:%c(%d)\n",char1,char1,char1,char1);

                serial_putchar(char1);
                serial_putchar(char1);
        }
        reenable_pcode_serial();
        printf("PCODE-SERiAL ENABLED!");
}

/* end of file */

just check out the echo(); function . it waits for a send character
(transmitted by hyper term win95) and sends
it backk twice.
hope i have no errors in the code, cause  i rewrote it for you because i
already modified my version.
hope it helps !

bye, Simon



Message is in Reply To:
  serial communications
 
I want to disconnect interactive C from the handy board and send instructions to it via the hyper terminal on Windows 95. I have followed the instructions given in the HB technical reference. I am confused as to the procedure for accomplishing my (...) (26 years ago, 1-Mar-99, to lugnet.robotics.handyboard)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR