avr-something

Something something AVR side…
git clone git://henryandlizzy.uk/avr-something
Log | Files | Refs | README

commit c7c2b54a9720e33b0bf250ed95ca89b727ac1561
parent 9a85f431e72420a3bce50d333d1fb8bc15671bfd
Author: Henry Wilson <m3henry@googlemail.com>
Date:   Sat,  3 Feb 2018 14:26:44 +0000

PWM test

Diffstat:
Mled-test.cpp | 30++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/led-test.cpp b/led-test.cpp @@ -4,10 +4,32 @@ int main(void) { - io::direction::B() |= 0x80; - for(;;) + io::direction::B() = 0xFF; + + // OCR0A + auto& val = memory(0x47); + + // TCCR0B + memory(0x45) = 0x05; + // TCCR0A + memory(0x44) = 0xC3; + + + uint8_t i = 0x00; + for (;;) { - blink(); - _delay_ms(333); + do + { + i <<= 1; + i |= 1; + val = i; + _delay_ms(500); + } while (0xFF != i); + do + { + i >>= 1; + val = i; + _delay_ms(500); + } while (i); } }