Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * BitmanipulationVT018.c
- *
- * Created: 04.12.17 11:24:32
- * Author : Hiestermann
- */
- #ifndef F_CPU // Hier wird abgefragt ob F_CPU schon definiert ist
- #define F_CPU 18432000 // wenn F_CPU noch nicht definiert war, wird es hier mit 18,432MHz nachgeholt
- #warning "F_CPU war nicht definiert, wurde jetzt nachgeholt" // und zusätzlich eine Warnung ausgegeben
- #endif
- #include <avr/io.h>
- #include <util/delay.h>
- int main(void)
- { MCUCR |=0x10; //Disable pull up
- DDRD=0xFF; //Setzte Port D auf Ausgang
- PORTD=0b11111111; //Setze alle bits auf High
- while (1)
- {
- PORTD&=0b10101010; // 11111111 Wird mit 10101010 UND Verknüpft
- _delay_ms(1000); // 1s Warten
- PORTD|=0b01010101; // ERGEBNIS 101010101 wird mit 0101010101 ODER Verknüpft ERGEBNIS ?
- _delay_ms(1000); // 1s Warten
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement