Found the source code for a qbasic editor source code I have been looking for. Immediately compiled it for linux via qb64. Need to make some changes though.
Planes are flying so low overhead, the afterburners almost gave me a hair cut.
Updated an old old laptop.
Used bc as a calculator:
$ echo “2592 * 3” | bc
Setting a network printer is easy as setting up most any other printer. You need to know about the printer location make and model. You will also need some administrative rights to install the printer. In this case, we will be using the Cups web based utility to accomplish adding the printer. First, if you do not already have access, you need access.
$ sudo adduser $USER lpadmin
Adding user `eddie’ to group `lpadmin’ …
Adding user eddie to group lpadmin
Note: for more command line goodies, see http://www.cups.org/documentation.php/options.html
Whew, that is all the command line you need to do. Now you need to open your web browser to “localhost:631”. Localhost is just a generic name so you do not have to use your real ipaddress. When you first go to cups, you will be asked some rudimentary questions about your setup.
Then you need to choose a printer.
On this network you have one print server that has two parallel ports and one usb port. Notice that cups recognized the equipment (make sure it is turned on!). You could have just as well chose a local printer if that was the one you wanted to use. You can always add more printers later. For now we are choosing pportusb3 or the third port on the printer server that has a usb interface.
The we can choose the printer manufacturer. Press continue. In our case, we have an HP printer. Pretty common nowadays. For the computer to be able to communicate and control the printer, you need what is known as a printer driver. Tradidionally you would have to go find the printer install CD/ DVD. Fortunately Cups already has quite a few printer drivers to choose from. So the printer driver install media will be pretty much a drink coaster.
Our printer is an OfficeJet 6110. Awesome, that is one of the available drivers! So press add printer and let the driver be installed. Then you will need to install the default options. Go with the existing default options till you have seen a print out. You can easily change these options later. Press set default option.
Your printer shoudl be pretty much setup now. You can go the admin pull down menu and print a test page to see if any default options need to change..
Once you have chosen to print a test page, you will get a message at the bottom of the screen about the page being printed.
You are now done with the printer setup. You can visit the other menus or just close the browser. Now the next time you need to print, the print option should show you your printer.
7. Run the installation script by entering /arch/setup. The menu based process is designed for ease of use, and will give useful feedback.
8. Use the arrow keys to highlight “Select Source” and press enter. If you chose the core installation media select “CD-ROM or OTHER SOURCE”. Select OK at the prompt. You will then be returned to the main menu.
9. Select “Set Clock”. Choose the appropriate timezone and then select set time and date and choose the appropriate time format. Confirm that the time is correct and select return.
10. Select “Prepare Hard Drive” and select the appropriate options. If you are installing Arch on a clean system or do not intend to dual boot with another preexisting operating system, simply select “Auto Prepare.” If you would like to partition the drive manually select the appropriate option. Make sure to check documentation on partitioning and formatting Linux drives.
11. Enter “Select Packages” and look through the packages available, pressing space to select the highlighted package and enter to finish selection. The base system will always be installed; for a minimal system, select no packages. For a system with additional basic tools, select the base-devel package category, or go through the packages and select those you want individually.
12. Enter “Install Packages” and wait while the script installs your operating system. This may take a while.
0dh. Enter “Configure System” and go through the options. If you do not know which to select, choose the default option. When you reach the screen labelled “Configuration” with files listed, go through each if you wish to check or change the default contents of your config files. Make sure you set a root password that you will remember, you will need it to administer your system. Beginner users can leave the rest of the configuration files alone.
14. Select “Install Bootloader” and choose your bootloader. If you are unsure which to select, choose GRUB. At this point, you will be prompted to examine your bootloader configuration file. If you are not dual booting, you will not need to make changes. If you have a Windows operating system installed, ensure the Windows entry in the file is not commented out by removing the “#” signs in front of each line. If you want Windows to be the default, make sure you change the default line. When prompted to select the boot device to install the bootloader, select the entry without a number at the end, such as /dev/sda.
15. Exit the installer and type “reboot” to restart your system. Wait for your computer to boot into your new Arch Linux operating system. Login as root with the password you entered and enjoy your new system.
Simple dark detector circuit. A quick and easy night light circuit.
The enhancements could be added.
Robot os. The infinite loop.
‘ set or reset values
‘ input sensor values
‘ Other jobs
‘ Do what is needed based on input values.
Part I. Set or reset values.
Part II Get sensor values.
Using basic, the command to read from ports in qbasic is INP. The address you need to read from is the address of the parallel port (usually 378h) + 1; so the usual address is 379h. As i mentioned before, the pins used for input are 10-13 and 15. Reading the different pins is little harder than writing to the ports, as you have to mask out the pins your not interested in. When you read the port, the first 3 bits returned are not used. For example, the qbasic code below would read pin 12 (out of paper). When this port is high, “Out of paper / pin 12 toggled” will be displayed:
data = inp(&h379) IF (data and 32) = 32 then print "Out of paper / pin 12 high"
The table below list the pin input pin number, its normal purpose, and the number required to read it (eg 32 was used in the above example):
|Pin Number||Normal Purpose||Number to read|
|11||High when not Busy||128|
|12||High when out of paper||32|
|13||High when printer online||16|
|15||High when no error||8|
If you understand binary, you should immediately see where these numbers are coming from, and why they are used to mask out all of the other pins we aren’t trying to read. The simplest thing you can use to test this is to just connect a switch between an input pin and a ground pin (18-25). For example, if you connect a switch between pins 15 and 20, you could use the following code to monitor when the switch is pushed:
start: res = INP(&H379) CLS IF (res AND 8) = 8 THEN PRINT "Button pushed" ELSE PRINT "Button NOT pushed" FOR delay = 1 TO 500: NEXT delay GOTO start
I know this code is a little messy, and will flicker, but it’s written for clarity. The same code can be used to monitor the other four input lines by changing to the ‘8’ to another number from the table.
Part III Other jobs.
Deliver reports to the outside world. etc etc etc
Part IV Do what is needed based on input values.
We can use Qbasic or freebasic to set values at the parallel port for such jobs as controlling the power train (aka turning or moving forward/backward). Moving other attachements. See also:
Pie chart: Just something to play with.
DIM MyData(0 TO 4)
DIM C(1 TO 4)
Pi = 4 * ATN(1) ‘ Can use 3.141593
Radius = 200 ‘ Change these to suit your taste
Xc = 319 ‘ x coordinate of center of circle
Yc = 239 ‘ y coordinate of center of circle
FOR i = 1 TO 4 ‘ puts data in array,
READ MyData(i) ‘ with the sum in MyData(0)
MyData(0) = MyData(0) + MyData(i) ‘
READ C(i) ‘ sets colors
‘ Put your data here: (use Value, Color)
SCREEN 12 ‘ graphics mode with ok resolution
Angle(0) = 0 ‘ Set initial angle
FOR i = 1 TO 4
IF i = 4 THEN ‘ Set final angle of wedge
Angle(1) = 2 * Pi
Angle(1) = Angle(0) + 2 * Pi * MyData(i) / MyData(0)
FOR j = 0 TO 1 ”’ Draw sides of wedges. Neg sign on Radius because CIRCLE flips y coordinates
LINE (Xc, Yc)-STEP(Radius * COS(Angle(j)), -Radius * SIN(Angle(j))), C(i)
CIRCLE (Xc, Yc), Radius, C(i), Angle(0), Angle(1) ‘ Draw arc
AvgAngle = (Angle(1) + Angle(0)) / 2 ‘ find middle of wedge and paint
PAINT (Xc + Radius * COS(AvgAngle) / 2, Yc – Radius * SIN(AvgAngle) / 2), C(i)
Angle(0) = Angle(1) ‘ update initial angle
Started, going, and gone.