Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Share Your Creations
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Share Your Creations Show your developed application to Basic4ppc community. Please include source code if possible.

Control a Basic Stamp using an LG Fathom Windows Mobile Phone.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-10-2010, 02:25 PM
pdablue's Avatar
Senior Member
 
Join Date: Sep 2007
Posts: 114
Arrow Control a Basic Stamp using an LG Fathom Windows Mobile Phone.

Hi,

This Basic4PPC program example allows you to customize up to 20
individual buttons that can send data characters out an open Bluetooth
serial port connection.

This programming example allows you to control 8 output port pins
on a Basic Stamp using a Firefly-BP wireless Bluetooth adapter and
an LG Fathom Windows Mobile phone.

You can set individual output Port pins High or Low.

You can set all output Port pins High.

You can set all output Port pins Low.

You can press a button to Open the Bluetooth serial port connection.

You can press a button to Close the Bluetooth serial port connection.

You can press a button to Clear the text characters in the TX textbox
window.

You can press a button to Clear the text characters in the RX textbox
window.

You can enter individual characters or character strings into the TX
textbox window and press the "Send TX" button to transmit the
character(s) out the open serial port connection.

You can press a button to toggle the Soft Input Panel keyboard On
and Off.

You can press the "Clear All" button to clear the text characters
displayed on the buttons themselves and the data currently assigned
to each of the buttons.

You can check a button's Checkbox and Enter data into the
"Label" and "Value" textboxes and then assign the data to the
selected button by pressing the "Enter" button.

You can check a button's Checkbox and press the red "C" button
to clear the text and data for the selected button while leaving
all of the other buttons alone.

You can check a button's Checkbox and press the red "V" button
to view the data assigned to that particular button in the "Label"
and "Value" textboxes.

You can press the "RF" button to read the currently selected data
file (1 - 8), to load in previously saved data assignments for each
of the 20 buttons.

Once you customize the 20 buttons the way that you want you
can press the "SF" button to save the data that you have
assigned to all 20 buttons to the currently selected data file
(1 - 8).

You can save 8 different "20 key" customizations into 8 different
data files.

You can use the "Button" Menu selection on the bottom Menu Bar
to change the Font Size to 7, 8 or 9 for the text displayed on each
image button.

To see all of the data currently assigned to all 20 buttons at once
you can press the "View" button to see the current state of each
of the 20 buttons.

You can connect the TX and RX data lines together on your
Bluetooth adapter and perform the Range Test by pressing the
"RT" button. If the device is in communication range of the wireless
Bluetooth adapter the word "IN" will be displayed in the green box.
If the device is not in communication range of the wireless Bluetooth
adapter the word "OUT" will be displayed in the green box.

You can press the "ST" button to stop a currently running range test.

You can change the color of the 20 custom buttons by pressing the
"BUTTON" menu selection on the menu bar at the bottom of the screen.
You can then select from a pop up menu and change the color of the
20 buttons to: Red, Blue, Green, Yellow or Mixed.

When you press the "SF" button to save data for the 20 Custom
Buttons to a file you will be prompted by a message box asking if
you really want to write data to the file or not. Press "Yes" if you
want to continue and save data to the currently selected file (1 - 8).
Press "No" if you do not want to save data to the currently selected
file.

This example only uses 18 of the 20 available buttons leaving 2 as
spares. You can use 1 button or all 20 buttons or any number of
buttons in between.

Here is a listing of the code running on the Basic Stamp:

' {$STAMP BS2p}
' {$PBASIC 2.5}

serdata VAR Byte
valdata VAR Byte
Baud CON 240

INPUT 15

OUTPUT 0
OUTPUT 1
OUTPUT 2
OUTPUT 3
OUTPUT 4
OUTPUT 5
OUTPUT 6
OUTPUT 7

LOW 0
LOW 1
LOW 2
LOW 3
LOW 4
LOW 5
LOW 6
LOW 7

Main:

DO
SERIN 15,Baud,[serdata]

LOOKDOWN serdata,[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,89 ,90],valdata
BRANCH valdata,[c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15 ,c16,c17,c18]
GOTO jumpend

c1:
'Character A was received. Set P0 High.
HIGH 0
GOTO jumpend

c2:
'Character B was received. Set P0 Low.
LOW 0
GOTO jumpend

c3:
'Character C was received. Set P1 High.
HIGH 1
GOTO jumpend

c4:
'Character D was received. Set P1 Low.
LOW 1
GOTO jumpend

c5:
'Character E was received. Set P2 High.
HIGH 2
GOTO jumpend

c6:
'Character F was received. Set P2 Low.
LOW 2
GOTO jumpend

c7:
'Character G was received. Set P3 High.
HIGH 3
GOTO jumpend

c8:
'Character H was received. Set P3 Low.
LOW 3
GOTO jumpend

c9:
'Character I was received. Set P4 High.
HIGH 4
GOTO jumpend

c10:
'Character J was received. Set P4 Low.
LOW 4
GOTO jumpend

c11:
'Character K was received. Set P5 High.
HIGH 5
GOTO jumpend

c12:
'Character L was received. Set P5 Low.
LOW 5
GOTO jumpend

c13:
'Character M was received. Set P6 High.
HIGH 6
GOTO jumpend

c14:
'Character N was received. Set P6 Low.
LOW 6
GOTO jumpend

c15:
'Character O was received. Set P7 High.
HIGH 7
GOTO jumpend

c16:
'Character P was received. Set P7 Low.
LOW 7
GOTO jumpend

c17:
'Character Y was received. Set P0,P1,P2,P3,P4,P5,P6,P7 High.
HIGH 0
HIGH 1
HIGH 2
HIGH 3
HIGH 4
HIGH 5
HIGH 6
HIGH 7
GOTO jumpend

c18:
'Character Z was received. Set P0,P1,P2,P3,P4,P5,P6,P7 Low.
LOW 0
LOW 1
LOW 2
LOW 3
LOW 4
LOW 5
LOW 6
LOW 7

jumpend:
LOOP ' repeat forever
END
Attached Images
File Type: jpg bluefly2.jpg (31.7 KB, 16 views)
File Type: jpg stamppic2.jpg (62.3 KB, 21 views)
File Type: jpg resized_cbtn6.jpg (46.3 KB, 16 views)
Attached Files
File Type: sbp custombtn5.sbp (64.7 KB, 18 views)
File Type: zip CustomBtn20Install.zip (130.3 KB, 19 views)

Last edited by pdablue : 10-17-2010 at 02:09 PM.
Reply With Quote
  #2 (permalink)  
Old 10-20-2010, 03:39 PM
pdablue's Avatar
Senior Member
 
Join Date: Sep 2007
Posts: 114
Arrow A version with wider buttons.

Hi,

Here is a version of the "20 Custom Buttons" program with wider
buttons, which allows you to put more text characters on them.
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Control a Basic Stamp with B4PPC and a LG Fathom Windows Mobile Phone. pdablue Share Your Creations 4 05-24-2011 04:38 PM
AlphaCom 256 for an LG Fathom Windows Mobile Phone. pdablue Share Your Creations 0 09-29-2010 03:31 PM
Control a Basic Stamp module using Basic4PPC. pdablue Share Your Creations 3 09-29-2010 05:33 AM
AlphaCom 114 for an LG Fathom Windows Mobile Phone. pdablue Share Your Creations 0 09-21-2010 02:49 PM
AlphaComm 88 for an LG Fathom Windows Mobile Phone. pdablue Share Your Creations 0 09-16-2010 11:26 AM


All times are GMT. The time now is 12:41 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0