Posts
5751
Joined
12/7/2009
Location
Long Beach, CA
US
Edited Date/Time
9/12/2018 6:22pm
I am interested in possibly using a program written by Linux called EMC2. It is a CNC controller. It runs under Ubuntu. I have an older windows7 spare PC. Can I install Linux on that machine or do I have to uninstall Windows first?
Help!
THX
Help!
THX
How big will your router be?
The Shop
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Parallel_Port_Tester
Hey! It's an adventure. I originally wanted a dual boot setup but the download choice I was told to use pretty much ended that idea. Oh well. It's a linux machine now.
[code]
#include
#include
#include
#include
#define base 0x378 /* printer port base address */
int main(int argc, char **argv) {
int value;
if (argc!=2) {
fprintf(stderr, "Error: Wrong number of arguments. This program needs one ar
gument which is number between 0 and 255.\n");
return 1;
}
if (sscanf(argv[1],"%i",&value)!=1) {
fprintf(stderr, "Error: Parameter is not a number.\n");
return 1;
}
if ((value255)) {
fprintf(stderr, "Error: Invalid numeric value. The parameter number must be
between 0 and 255\n");
return 1;
}
if (ioperm(base,1,1)) {
fprintf(stderr, "Error: Couldn't get the port at %x\n", base);
return 1;
}
outb((unsigned char)value, base);
return 0;
}
[/code]
[code]
#include
#include
#include
#include
#define base 0x378 /* printer port base address */
int lptout(char **lptval)
{
int value;
if (sscanf(lptval[1],"%i",&value)!=1) {
fprintf(stderr, "Error: Parameter to lptout() is not a number.\n");
return(1);
}
if ((value255)) {
fprintf(stderr, "Error: Invalid numeric value. The parameter to lptout() mus
t be a number between 0 and 255\n");
return(1);
}
if (ioperm(base,1,1)) {
fprintf(stderr, "Error: Couldn't get the port at %x\n", base);
return(1);
}
outb((unsigned char)value, base);
return(0);
}
int nsleep (char **msecs)
{
long long int i;
if (i=atoll(msecs[1])) {
i*=1000;
usleep(i);
} else {
fprintf(stderr, "Error: Invalid time %s\n", msecs[1]);
return(1);
}
return(0);
}
int main(int argc, char **argv)
{
FILE *infile;
char *lights;
while(1) {
if ( argc == 1 ) {
system("clear");
printf("Example: 255/1000 = all lights on for one second\n");
printf("Enter light/time sequence (q to quit):\n");
scanf("%s",lights);
if ( lights[1] == "q" ) {
exit(0);
}
} else {
if (infile=fopen(argv[1],"r")) {
lights=`egrep -v "^#|^$" $1 | tr '\n' ' '`
else
echo "Input file not found!"
exit
fi
fi
for i in $lights
do
l=`echo $i | cut -d'/' -f1`
t=`echo $i | cut -d'/' -f2`
printf "lights=%03d, milliseconds=%04d\n" $l $t
./lptout $l
./nsleep $t
done
./lptout 0
if [ $# -eq 0 ]; then
echo "Press ENTER to run again or \"q\" to quit..."
read pause
if [ "$pause" == "q" ]; then
exit
fi
}
}
}
[/code]
http://voidmain.is-a-geek.net/files/lights/
I even wrote a little Perl script that will control the LEDs and play some tunes out of the PC speaker. Christmasy.
Pit Row
Subsystem: Device 1c00:3050
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-
That's weird.
Interrupt: pin A routed to IRQ 19
Region 0: I/O ports at e800 [size=256]
Region 1: Memory at f9ff8000 (32-bit, prefetchable) [size=32K]
Region 2: I/O ports at ec00 [size=4]
Expansion ROM at febf0000 [disabled] [size=32K]
Capabilities:
Post a reply to: Paging Void. Linux questions