Hello Every one.
It is very simple to control the parallel port in linux in c. Just run this c program. Make sure you are logged in as a root.
This program is for blinking a LED on any data bit of parallel port.
U can change the delay by changing the for loop conditions.
If some one is new to linux then here is some help, how to add root user...
type ' sudo passwd root ' on terminal then hit enter. it will ask password for root user two times, give the password and then login as a root.
enjoy...
It is very simple to control the parallel port in linux in c. Just run this c program. Make sure you are logged in as a root.
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/io.h> #define pport 0x378 main(int argc,char **argv) { unsigned long int i; if (ioperm(pport,1,1)) printf("Error: Couldn't get the port at %x\n", pport); while(1){ for(i=0;i<99999999;i++); outb(0xFF,pport); printf("\nON"); for(i=0;i<99999999;i++); outb(0x00,pport); printf("OFF"); } }
This program is for blinking a LED on any data bit of parallel port.
U can change the delay by changing the for loop conditions.
If some one is new to linux then here is some help, how to add root user...
type ' sudo passwd root ' on terminal then hit enter. it will ask password for root user two times, give the password and then login as a root.
enjoy...
You also like to know about:
- Do you know what happens when you hit url www.goolge.com?
- Know about Debouncing & Throttling
- AngularJS advanced trick and techniques
- Restrict input to allow only required value (jQuery plugin for input type validation)
- Spread operator or Rest parameter or Ellipsis in JavaScript
- Why call and apply two methods available in JavaScript
- Automatic Form Input Validation for complete site
- Number of ways you can create function in JavaScript +what are they called
- JavaScript Native objects
- How to Create private function in JavaScript
- functions as first class object in JavaScript
- Object Oriented concept in JavaScript
- Advanced JavaScript questions
- One good way to declare Global Variables in JavaScript
- how to align elements in a row with equal space around
- Closures in JavaScript
- AJAX call in AngularJS for cross domain service using JSONP
- Cross Site Scripting in WCF Web Service. How to use AJAX in JavaScript to Get/Consume JSON from WCF in C#
- How to add AngularJS in rails application
- Git configuration all about
- Pass XML file in stored procedure as a input parameter from C#
- XML Parser in SQL Server (T-SQL), How to parse XML in SQL
- Wish your friend with your own words and love
- Create Message in Hindi by typing in Hinglish
- Convert Multiline Text Into Single Line for HTML page
No comments:
Post a Comment