Bit Set/Clear Serial Transmit program.

pdablue

Active Member
Licensed User
Longtime User
Hi,

This program will allow you to Set or Clear individual bits in an 8-bit byte
and then transmit that binary pattern out the serial port across a wireless
Bluetooth serial port connection.

This program was written on an HP IPAQ H2210 PDA with a 320 x 240 screen.
This program was compiled to run on a 320 x 240 screen.

There are 8-bits numbered:

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

Each Bit has a Num Up/Down control, a Checkbox control and a Textbox
control associated with it. The Num Up/Down control is used to set the
Bit to a 0 or 1. The Checkbox control is used to select the Bit's Textbox
control so that it can be cleared when the "CS" button is pressed. The
"CS" stands for "Clear Selected". This way you can clear selected
Textboxes while leaving others alone. The Textbox controls allow you to
enter a short Text description of the Bit's functional purpose.

The program lets you define 4 sets of 8-Bit descriptions and save the
information to a file. When you startup the program again at a later
time you can Read the data file and recover the last saved set of Bit
descriptions.

After entering text into the 8 textboxes you must press the "Enter"
button to save the text into the internal working variables for the
selected data set. There are 4 data sets, which can be viewed by
pressing the "V1", V2", "V3" and "V4" buttons.

Here are the button descriptions:

"Open" Pressing this button opens the bluetooth com port.
"Close" Pressing this button closes the bluetooth com port.
"Read" Pressing this button reads in the data file.
"Save" Pressing this button saves the current data to the data file.
"CS" Pressing this button clears text in the selected textboxes.
"CA" Pressing this button will clear text in all 8 of the textboxes.
"Enter" Pressing this button will enter the text in the textboxes.
"V1" Pressing this button will view the 1st set of textbox data.
"V2" Pressing this button will view the 2nd set of textbox data.
"V3" Pressing this button will view the 3rd set of textbox data.
"V4" Pressing this button will view the 4th set of textbox data.
"TX" Pressing this button will transmit the current 8-bit byte value.

"SIP ON" Pressing this MenuBar selection will turn the SIP keyboard ON.
"SIP OFF" Pressing this MenuBar selection will turn the SIP keyboard OFF.

"Bit.sbp" is the Basic4ppc source code file for this program

"Bitpic10.jpg" is a screenshot of the main program screen.

"Bitpic11.jpg" is a screenshot of selected textbox entries that
have been cleared by pressing the "CS" button.

"Bitpic12.jpg" is a screenshot with the SIP keyboard turned ON.

"Bitpic13.jpg" is a screenshot when the "Save" button is pressed.

"Bitpic14.jpg" is a screenshot when the "CA" button is pressed.

"BitSetClearZip.zip" is the zipped up (.CAB) installation file.
 

Attachments

  • Bitpic10.jpg
    Bitpic10.jpg
    22.3 KB · Views: 292
  • Bitpic13.jpg
    Bitpic13.jpg
    18.9 KB · Views: 284
  • Bitpic14.jpg
    Bitpic14.jpg
    17.5 KB · Views: 264
Last edited:

taximania

Well-Known Member
Licensed User
Longtime User
I'm sure you don't need 255 If statements in this Sub.

Won't the example below work ?

B4X:
Sub ImageButtonSendTx_Click
num=label17.Text
label20.Text="TX = " & num
b1()=Array(num)
serial.Output2(b1())
End Sub
 
Top