// Built with BFTC Rev. 1.0.0, mer 13 agosto 2014 14:03:12 /* Copyright 2014 Digital Technology Art SRL This file is part of Blackfin Toolchain (BFTC) project. BFTC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. BFTC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Nome-Programma. If not, see <http://www.gnu.org/licenses/>. */ #include "main.h" int main(void) { char str[80], ch; int i; double d; Set_PLL(16, 4); // CORE: 25MHz * 16 = 400MHz, SCLK: 400MHz / 4 = 100MHz Set_Uart0(115200); while(1) { printf("Accepted input are: String, Integer, Char, Double\n"); // allowed specifier: s S printf("Type a string: "); _scanf("%s", str); printf("\nString: %s\n", str); // allowed specifier: d D i I // hex number are coded as 0x1FF or 1FFH or 3E0h printf("Type an integer: "); _scanf("%d", &i); printf("\nInteger: %d\n", i); // allowed specifier: c C printf("Type a char: "); _scanf("%c", &ch); printf("\nChar: %c\n", ch); // allowed specifier: e f g printf("Type a double: "); _scanf("%f", &d); printf("\nDouble: %.6f\n", d); } return 0; }
1.3.1