M
maxsteel3000
Guest
Ik heb gewerkt aan een project om te keren interfacing.
do a certain job like lighting up all the LEDs connected to portA.
Ik bedoel dat het gemakkelijk om een uC
te doen een bepaalde baan zoals verlichting tot alle lampjes aangesloten porta.
:
MONSTER PROGRAMMA:Als we willen schrijven programma waarin, toen knop 'een' op het toetsenbord wordt ingedrukt dan al de LED aangesloten op PORTA dient te worden, toen knop 's' is ingedrukt moeten alle LED uit is.
# include <mega32.h>
# include <stdio.h> / / Standard Input / Output-functies
Void main ()
(
DDRA = 0xFF;
PORTA = 0 × 00;
/ / Initialisatie USART
/ / Communicatie Parameters: 8 Data, 1 Stop, geen pariteit
/ / USART Receiver: On
/ / USART zender: On
/ / USART Mode: Asynchronous
/ / USART Baud Rate: 9600
UCSRA = 0 × 00;
UCSRB = 0 × 18;
UCSRC = 0 × 86;
UBRRH = 0 × 00;
UBRRL = 0 × 33;
while (1)
(
if (getchar () == 'a')
(
PORTA = 0 × 11111111;
)
if (getchar () == 'b')
(
PORTA = 0 × 00;
)
);
)of PORT A
is high (suppose) the pc opens a text editor and displays A1Maar als PIN 1
van PORT A
is hoog (stel) de pc opent een tekst editor en geeft A1kan dit worden gedaan????Zo ja, dan leg ik de vereiste stappen.<img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" />
do a certain job like lighting up all the LEDs connected to portA.
Ik bedoel dat het gemakkelijk om een uC
te doen een bepaalde baan zoals verlichting tot alle lampjes aangesloten porta.
:
MONSTER PROGRAMMA:Als we willen schrijven programma waarin, toen knop 'een' op het toetsenbord wordt ingedrukt dan al de LED aangesloten op PORTA dient te worden, toen knop 's' is ingedrukt moeten alle LED uit is.
# include <mega32.h>
# include <stdio.h> / / Standard Input / Output-functies
Void main ()
(
DDRA = 0xFF;
PORTA = 0 × 00;
/ / Initialisatie USART
/ / Communicatie Parameters: 8 Data, 1 Stop, geen pariteit
/ / USART Receiver: On
/ / USART zender: On
/ / USART Mode: Asynchronous
/ / USART Baud Rate: 9600
UCSRA = 0 × 00;
UCSRB = 0 × 18;
UCSRC = 0 × 86;
UBRRH = 0 × 00;
UBRRL = 0 × 33;
while (1)
(
if (getchar () == 'a')
(
PORTA = 0 × 11111111;
)
if (getchar () == 'b')
(
PORTA = 0 × 00;
)
);
)of PORT A
is high (suppose) the pc opens a text editor and displays A1Maar als PIN 1
van PORT A
is hoog (stel) de pc opent een tekst editor en geeft A1kan dit worden gedaan????Zo ja, dan leg ik de vereiste stappen.<img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" /><img src="http://www.edaboard.com/images/smiles/icon_question.gif" alt="Vraag" border="0" />