Gast
#3281696
Hallo Leute
ich habe ein Problem mit einer Variable die ich in einem Interrupt
hochzählen will bekomme aber immer dieser Fehler
"error: 'muh' was not declared in this scope"
vielleicht findet ihr ihn ja
Gruß Uwe
#include <avr/io.h>
#include <stdint.h>
#include <avr/interrupt.h>
ISR (TIMER0_COMPA_vect)
{
PORTD = 0b00000000;
muh ++;
}
int main()
{
DDRB = 0b00000000;
DDRD = 0b00000111;
PORTD = 0b00000111;
ADCSRA = (1<<ADEN) | (1<<ADATE) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0);
ADMUX = (0<<MUX3) | (0<<MUX2) | (0<<MUX1) | (0<<MUX0) | (1<<REFS0) |
(0<<REFS1);
ADC = (0<<ADLAR);
TCCR0A = (0<<WGM02) | (1<<WGM01) | (0<<WGM00); // CTC Modus
TCCR0B = (1<<CS02) | (0<<CS01) | (1<<CS00); // Prescaler 1024
OCR0A = 124; //Oberes Ende für Interupt
TIMSK0 = (1<<OCIE0A);
uint16_t result;
uint8_t Eingang_B0;
uint8_t Zahl;
volatile uint8_t muh;
bool Blockieren = 0;
sei(); // Global Interrupts aktivieren
while(1)
{
Zahl = muh;
Eingang_B0 = PINB;
Eingang_B0 = Eingang_B0 & 0x01;