tststdio.c

来自「Source code for driving RFM01 fm radio r」· C语言 代码 · 共 43 行

C
43
字号
/* ------------------------------------------------------------------------- */
/*	Test biblioteki stdio						     */
/* ------------------------------------------------------------------------- */

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdio.h>
#include "uart.h"
#include "lcd.h"

/* ------------------------------------------------------------------------- */
/*			   Definicje funkcji				     */
/* ------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------- */

/* ------------------------------------------------------------------------- */
/* ----------------		 Program glowny 	    ---------------- */
/* ------------------------------------------------------------------------- */

int main(void)
{
  u16 liczba=0;
//  LCD_init();			// inicjalizacja wyswietlacza
  UART_init();			// inicjalizacja portu szeregowego

//  fdevopen(LCD_putchar, NULL, 0);
    fdevopen(UART_putchar, NULL, 0);

  while(1)			// p阾la niesko馽zona
  {
    LCD_clear();
    liczba++;    
    printf_P(PSTR("Liczba %d"),liczba);
    delayms(100);
  }
}

/* ------------------------------------------------------------------------- */
/*                                Koniec programu                            */
/* ------------------------------------------------------------------------- */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?