Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- // put your setup code here, to run once:
- pinMode(12, OUTPUT);
- __asm__("LDI r16,0x10\n\t"); // set data to send to port B B00010000 = 16 = Ox10
- __asm__("LDI r17,0x0\n\t"); // set data to send port B = 0
- }
- void loop() {
- __asm__ ("startLoop:");
- __asm__
- (
- " out 0x05,r16\n"
- " nop\n"
- " out 0x05,r17\n"
- " nop\n"
- );
- digitalWrite(12, HIGH);
- __asm__
- (
- " out 0x05,r17\n"
- " nop\n"
- " out 0x05,r16\n"
- " nop\n"
- );
- digitalWrite(12, LOW);
- __asm__
- (
- " out 0x05,r16\n"
- " nop\n"
- " out 0x05,r17\n"
- " nop\n"
- );
- __asm__ (" rjmp startLoop\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement