Tuesday, July 29, 2014

Software development.


Personal computer karma.


Im bugged.


New MS developer board.


Sharks Cove board with Intel Atom CPU targeted at Windows developers.



One really thinks this is aimed at the Raspberry Pi/Arduino market. But at $300 dollars, who is really going to choose it. Microsoft  has a tradition of not supporting speciality products for any period of time. Zune and etc etc etc. Even if it was worth it I would shy away from it. Ironically you can take a pico motherboard and dc-dc power supply and in effect have the same thing for a fraction of the cost.

Now if you really want to get inane on this, I will take my old 486 laptop and add all kinds of breakout cables to do quite a bit. Parallel, serial,  vga, and etc. The 486 laptop was free. Cables did have some cost to them, but no where near $300. If you know anything about electronics, a "1" is plus five volts and a "0" is near zero volts. That is true for the Raspberry Pi, Arduino, personal computers, and a zillion developer boards. Not all interfaces will be using digital, but you get the idea.



Run my robot on an old Pentium 1 with linux as the os. With a laptop or most any standard legacy machine you can add a variety of interfaces:

Parallel
http://www.instructables.com/id/No-solder-parallel-port-break-out/

Serial
http://www.instructables.com/id/DB9-serial-break-out-cable/

Vga
http://www.instructables.com/id/Vga-breakout-cable/

Plus others such as usb. Also consider:
http://www.instructables.com/id/Electronic-Guides/


It's your choice!

When it rains it pours.

Guess who is under antitrust issues again.


Fake beer.

For those of us who do not drink.7up with just enough Rootbeer to tint the drink the right color.


Instructables stat grab.

Many people have created tutorials on www.instructables.com. To see how each instructable is doing can be a chore. Devised a bash script to help conquer that chore. Though data may not be the latest, it certainly shows viable trends. You can also import the data into a spreadsheet rather easily.

First you will want to create a text file with the instructables you want to follow.
One url to a line.

http://www.instructables.com/id/Line-editor-template/

You may need to install a program or two such as elinks and zenity so things will work. Then you will want to create an executable of the file to collect the data.

#================================
#
#  Instructables numbers catcher
#
#=================================
# Assignments
# --------------------------------
szAnswer=$(zenity --file-selection --title="Select a iurl file to read")
datafile=$szAnswer
outfile="inumdata"
total=0
# the date
tmon=$(date +"%b")
tday=$(date +"%d")
echo  "The views for $dj on $tmon $tday:" > $outfile
#=================================
#
# Data input
#---------------------------------
while read line
do theurl=$line
echo  "$theurl"
# echo -n "$theurl'" >> $outfile
# get total views
# count=$(elinks  "$theurl" | grep -m 1 "hits-count" | sed 's/[^0-9]*//g')
count=$(elinks  "$theurl" | grep -m 1 "views" | sed 's/[^0-9]*//g')
# let total=$total+$count
echo "$count" >> $outfile
done < $datafile
# echo "total: $total" >> $outfile
zenity --text-info --filename=$outfile

Then it is a matter of running the script.




Just copy and paste the data into the spreadsheet.


You can also get instructable totals also.

#===================================
# Today's numbers
#-------------------------------------------
# output data
# character width required for information box
# create data file (datadir and file name can be changed to your needs.
filename="tdaynumbers"
echo -n "Today's date: " >> $filename
date +%D >> $filename
echo "Today's numbers:" >> $filename
# echo -n "Total views  of www.instructables.com/member/$1/: "
echo computothought: >> $filename
# elinks  http://www.instructables.com/member/computothought | grep  '"Total Views" />'  | sed 's/[^0-9]*//g' >> $filename
elinks  http://www.instructables.com/member/computothought | grep  "Total Views"   >> $filename
echo davijordan: >> $filename
# elinks  http://www.instructables.com/member/davijordan | grep '"Total Views" />' | sed 's/[^0-9]*//g' >> $filename
elinks  http://www.instructables.com/member/davijordan | grep "Total Views"  >> $filename
# output
zenity --text-info --filename=$filename
# remove  unneeded file
 cp $filename $filename.old
 rm $filename
exit


MS ending windows...


Saturday, July 26, 2014

Parallel data port control.



Parcon is a neat little program that when used with sudo or the  like can control the data lines on the parallel port to turn on and off an led or other equipment using proper circuitry. (5 volts only otherwise)



Youtube video

https://www.youtube.com/watch?v=BlCHGiG_CQM

Parallel port.



pin 2 - data line 1  D0   --led--resistor--- pin 18
pin 3 - data line 2  D1    "
pin 4 - data line 3  D2    "
pin 5 - data line 4  D3    "
pin 6 - data line 5  D4    "
pin 7 - data line 6  D5    "
pin 8 - data line 7  D6    "
pin 9 - data line 8  D7    "
pin 18 - ground

To compile:
$ gcc parcon.c -o parcon

To run (l is off and h is on.)
$ sudo parcon 1l 2l 3h 5h 8l

 Turns off pins 1,2, and 8. Tuns on pins 3 and 5.

parcon.c

[code]
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/io.h>

char *binprint( unsigned char x, char *buf )
{
  int i;
  for( i=0; i<8; i++ )
    buf[7-i]=(x&(1<<i))?'1':'0';
  buf[8]=0;
  return buf;
}

int main( int argc, char *argv[] )
{
  char c;
  unsigned char val;
  char buf[9];
  int x;
  if( argc<2 )
  {
    printf("  example usage: parcon 1l 2l 3h 5h 8l\n");
    return 2;
  }
  if( ioperm(888,1,1) )
  {
    printf("Couldn't get port 888\n");
    return 1;
  }
  val = inb(888);
  printf("old = %s\n",binprint(val,buf));
  for( x=1; x<argc; x++ )
    if( argv[x][1]!='h' )
      val &= ~(1<<(argv[x][0]-'1'));
    else
      val |= 1<<(argv[x][0]-'1');
 
  printf("new = %s\n",binprint(val,buf));
  outb(val,888);
  return 0;
}
[/code]

How simple it would be to control an rc unit.





Substitute nte123ap for bc547.


Something to look at:
http://www.instructables.com/id/No-solder-parallel-port-break-out/
http://www.instructables.com/id/Mini-parallel-port-break-out-cable/

Warning the above circuits will not work with a usb parallel interface. The usb requires some kind of latch. Use the circuit below at your own risk as I have not tested it.


Parallel data port control.



Parcon is a neat little program that when used with sudo or the  like can control the data lines on the parallel port to turn on and off an led or other equipment using proper circuitry. (5 volts only otherwise)



Youtube video

https://www.youtube.com/watch?v=BlCHGiG_CQM

Parallel port.



pin 2 - data line 1  D0   --led--resistor--- pin 18
pin 3 - data line 2  D1    "
pin 4 - data line 3  D2    "
pin 5 - data line 4  D3    "
pin 6 - data line 5  D4    "
pin 7 - data line 6  D5    "
pin 8 - data line 7  D6    "
pin 9 - data line 8  D7    "
pin 18 - ground

To compile:
$ gcc parcon.c -o parcon

To run (l is off and h is on.)
$ sudo parcon 1l 2l 3h 5h 8l

 Turns off pins 1,2, and 8. Tuns on pins 3 and 5.

parcon.c

[code]
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/io.h>

char *binprint( unsigned char x, char *buf )
{
  int i;
  for( i=0; i<8; i++ )
    buf[7-i]=(x&(1<<i))?'1':'0';
  buf[8]=0;
  return buf;
}

int main( int argc, char *argv[] )
{
  char c;
  unsigned char val;
  char buf[9];
  int x;
  if( argc<2 )
  {
    printf("  example usage: parcon 1l 2l 3h 5h 8l\n");
    return 2;
  }
  if( ioperm(888,1,1) )
  {
    printf("Couldn't get port 888\n");
    return 1;
  }
  val = inb(888);
  printf("old = %s\n",binprint(val,buf));
  for( x=1; x<argc; x++ )
    if( argv[x][1]!='h' )
      val &= ~(1<<(argv[x][0]-'1'));
    else
      val |= 1<<(argv[x][0]-'1');
 
  printf("new = %s\n",binprint(val,buf));
  outb(val,888);
  return 0;
}
[/code]

How simple it would be to control an rc unit.





Substitute nte123ap for bc547.


Something to look at:
http://www.instructables.com/id/No-solder-parallel-port-break-out/
http://www.instructables.com/id/Mini-parallel-port-break-out-cable/

Warning the above circuits will not work with a usb parallel interface. The usb requires some kind of latch. Use the circuit below at your own risk as I have not tested it.


Some of my favorite meals.

Can you guess what they are?