Koda: |
#include <avr/io.h>
void Delay(void); void setup() { // put your setup code here, to run once: DDRB = 0x3F; } void loop() { // put your main code here, to run repeatedly: PORTB = 0x3F; Delay(); PORTB = 0x00; Delay(); } void Delay(void) { volatile unsigned long count = 50000; while (count--); } |
Koda: |
PORTB |= (1 << št. bita); //št. bita ima vrednost 0 - 7 |
Koda: |
PORTB |= (0b00010100); // bite z vrednostjo 0 pusti pri miru, 1ke postavi na 1 |
Koda: |
PORTB &= ~(1 << št. bita); //št. bita ima vrednost 0 - 7 |
Koda: |
PORTB &= ~(0b00010100); // bite z vrednostjo 0 pusti pri miru, 1ke postavi na 0 |
Koda: |
PORTB ^= (1 << št. bita); |