Hier mijn versie van een irrepeater:
Voorkant:

Achterkant:

Schema:

irrepeat.c:
Ik heb een .zip van de source code, en het quick&dirty Eagle schema beschikbaar voor wie er in geïnteresseerd is.
Voorkant:

Achterkant:

Schema:

irrepeat.c:
C:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| /* ----------------------------------------------------------------------- * Title: IR repeater * Author: Wirf * Date: 02-Jan-2010 - 12-Apr-2012 * Hardware: ATtiny45 * Software: avr-gcc * -----------------------------------------------------------------------*/ #define F_CPU 8000000UL // Define software reference clock for delay duration (8Mhz) //See description of TCCR0A for these two variables: #define PWMON 0b01010010; //Toggle on compare match mode, with CTC mode #define PWMOFF 0b00000010; //OCRA and OCRB disconnected #include <avr/io.h> #define SENSOR PB0 int main (void) { CLKPR = (1 << CLKPCE); // Clock prescaler change enable CLKPR = 0b00000001; // Clock prescaler of 1 DDRB &= ~(1 << SENSOR); //input on SENSOR DDRB |= (1 << PB1); //output on PB1 DDRB |= (1 << PB2); //output on PB2 DDRB |= (1 << PB3); //output on PB3 DDRB |= (1 << PB4); //output on PB4 TCCR0A = PWMOFF; //Start with PWM off TCCR0B = 0b00000001; //CTC mode, prescaler of 1 (no prescaling) OCR0A = 51; //gives about 38 khz with 50% duty cycle PORTB |= PB1 & PB2 & PB3 & PB4; //Enable pullup: PORTB |= (1 << SENSOR); for (;;) { if (bit_is_clear(PINB, SENSOR)) { TCCR0A = PWMON; //Start PWM waveform generation } else { TCCR0A = PWMOFF; //Stop PWM waveform generation } } } |
Ik heb een .zip van de source code, en het quick&dirty Eagle schema beschikbaar voor wie er in geïnteresseerd is.
Heeft sinds kort zijn wachtwoord weer terug gevonden!











