User Tools

Site Tools


testing_toc_and_headers

Table of Contents

testing TOC and headers

header5

this is some code you can download by clicking the file name in the tab….

header4

this is some code you can download by clicking the file name in the tab.

header3

this is some code you can download by clicking the file name in the tab.

picture

Fishing for ducks 2012-06-30_07.42.21.jpg

this is some code you can download by clicking the file name in the tab.

foo.c
/*
 * flashLED.c
 *
 *  Created on: 21-Feb-2011
 *      Author: user
 */
 
#include <avr/io.h>
#include <util/delay.h>
 
// This program will turn the LEDs on for 100ms,
// then off for 200ms, endlessly.
 
int main(void)
{
  // Set Port B pins for 3 and 4 as outputs
  // PORTB bit 3 = physical pin #2 on the ATTINY45
  // PORTB bit 4 = physical pin #3 on the ATTINY45
 
  DDRB = 0x18;  // In binary this is 0001 1000 (note that is bit 3 and 4)
  // AVR-GCC also would accept 0b00011000, by the way.
 
  // Set up a forever loop using your favorite C-style 'for' loop
  for ( ; 1==1 ; )  // loop while 1 equals 1
  {
    // Set Port B pins for 3 and 4 as HIGH (i.e. turn the LEDs on)
    PORTB = 0x18;   // If we wanted only PB4 on, it'd be PORTB=0x10
 
    // Use a function (defined in delay.h) to pause 100 milliseconds
    _delay_ms(100);
 
    // Set PORTB to be all LOWs (i.e. turn the LEDs off)
    PORTB = 0x00;
 
    // Delay for a 200ms
    _delay_ms(200);
  }
 
return 1;
}
 

Another picture

lh3.googleusercontent.com_-rzpgyux5yks_uc_wec2mhvi_aaaaaaaad2q_csnd5bfmsq_w744-h558-no_img_0271.jpg

testing_toc_and_headers.txt · Last modified: 2021/11/09 13:24 by admin