Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Serial OnCom


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-16-2008, 02:58 PM
Cor Cor is offline
Junior Member
 
Join Date: May 2007
Posts: 22
Default Serial OnCom

I want to detect some incoming Characters and act on it. (send other data)

No use of flowcontrol

Iám using the serialterminal program.

Now it seems a problem when I want to send data from the oncom routine.

e.g. when receiving a single character like % I must send directly other data

Also needed string to int and int to string.

cannot find this in help

What is the best to setup such routine for basic4ppc

thanks in advance

grCor
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 03:05 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Basic4ppc automatically converts numbers and strings.
Using a timer is more foolproof than using the OnCom event.
You need something like:
Code:
Sub Timer1_Tick
 If Serial.InBufferCount > 0 Then
  data = Serial.InputString
  if StrIndexOf(data,"%",0) > -1 then '% was sent
   Serial.Output("somestring")
  end if
 end if
End Sub
The GPS tutorial may also help you: GPS application - Part I
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Terminal? willisgt Questions & Help Needed 2 04-01-2008 07:34 PM
serial compiling Cor Questions & Help Needed 4 01-18-2008 02:10 PM
serial Cor Questions & Help Needed 1 01-18-2008 01:49 PM
serial i/o Softselect Questions & Help Needed 1 07-24-2007 02:48 PM
Serial Number Cableguy Questions & Help Needed 4 05-05-2007 08:06 AM


All times are GMT. The time now is 06:04 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0