From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed7254edc3f957d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-14 12:54:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!deine.net!freenix!enst!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: ?how to read just single bit for a serial port? Date: Sun, 14 Apr 2002 14:53:29 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1018814042 13472 137.194.161.2 (14 Apr 2002 19:54:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 14 Apr 2002 19:54:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Original-Cc: kz105@student.cs.york.ac.uk Xref: archiver1.google.com comp.lang.ada:22526 Date: 2002-04-14T14:53:29-05:00 Since the physical reads from a serial port are eight-bit octets, you can declare a type like this: type bit is mod 2; type bit_array is array (natural range 0 .. 7) of bit; Then instantiate an instance of Unchecked_Conversion like so: function to_bits is new Ada.Unchecked_Conversion (Source : Character; Target : Bit_Array); Now you can read a character from the port, convert the character to a bit_array, then select the desired bit from the array. ----- Original Message ----- From: "Jamie" Newsgroups: comp.lang.ada To: Sent: April 14, 2002 9:25 AM Subject: ?how to read just single bit for a serial port? > Hello, > > I've got a problem with reading a single bit from serial port. what > type should I declare to store this? dose the 'character' work? > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > >