BBC BASIC for Windows
« Serial Port and ESC code »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:56pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Serial Port and ESC code  (Read 739 times)
Designer
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: Serial Port and ESC code
« Reply #4 on: Jul 3rd, 2012, 12:12pm »

Viv,

Hi.

Just starting out on BBC BASIC. Can you please share the test program code for sending and receiving a couple of bytes of data.

Regards

Zeb
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Serial Port and ESC code
« Reply #5 on: Jul 3rd, 2012, 9:09pm »

on Jul 3rd, 2012, 12:12pm, Designer wrote:
Can you please share the test program code for sending and receiving a couple of bytes of data.

Sending code something like:

Code:
      port% = OPENOUT("COM1:9600,n,8,1")
      BPUT #port%,dat1%
      BPUT #port%,dat2%
      CLOSE #port% 

Receiving code something like:

Code:
      port% = OPENIN("COM2:9600,n,8,1")
      dat1% = BGET#port%
      dat2% = BGET#port%
      CLOSE #port% 

This code waits for the data to arrive. If you need to be doing something else whilst waiting, you can monitor how many bytes have arrived using EXT#port% and only read them when they're ready.

Richard.
User IP Logged

Designer
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: Serial Port and ESC code
« Reply #6 on: Jul 5th, 2012, 07:09am »

Richard.

Thanks. Will try it out and report.

Zeb
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls