[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Kommentar til begynderprogram?



On Sun, 28 Sep 2003, Kresten Skovsted Buch wrote:

> Jeg har koblet en række lysdioder til databenene på min parallelport
> således at en diode lyser når der åbnes for et af benene på porten.

Fint nok.

> Når jeg kører programmet lyser en af dioderne. Hvis jeg ændrer linie
> 9 til outb(0, BASEPORT); så slukker den istedet.

Øhhh, kan man virkelig det? Jeg troede ikke man kunne skrive direkte 
til I/O under Linux, som man kan under DOS. Måske er det noget 
specielt når det er lpt-porten.

> Hvordan kan jeg ændre mit program så jeg kan tænde/slukke en af de andre dioder?

> 9:    outb(1, BASEPORT);

9:    outb(2, BASEPORT);

Der er 8 LED'er, skriv fx
 1
 2
 4
 8 
16
32
64
128
og en af de andre tænder.
Skriv 255 for at tænde dem alle.

/hans
-- 
Hamletsgade 4 - 201, DK-2200 København N, Phone: +45 3582 9079
Schou Industries ApS      http://schou.dk/    CVR: 26 13 44 39
--------------------------------------------------------------
Fundamentally, I would not have pursued SCO's path.
		    -- Ransome Love, former CEO of Caldera/SCO


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *