Skip to content

Instantly share code, notes, and snippets.

@avr-programmierung
Created May 14, 2019 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avr-programmierung/b877f71a527966c834e90548712e4a28 to your computer and use it in GitHub Desktop.
Save avr-programmierung/b877f71a527966c834e90548712e4a28 to your computer and use it in GitHub Desktop.
ATmega88 @ 8MHz Servo 01
/* servo_01.c ATmega88 @ 8MHz */
#include <avr/io.h>
#include <util/delay.h>
int main (void)
{
DDRC = (1<<PC0);
while( 1 )
{
PORTC |= (1<<PC0);
_delay_us( 1500 ); // Pulsbreite von 1,5ms für die Servolage
PORTC &= ~(1<<PC0);
_delay_ms( 18 ); // Kein kritischer Wert
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment