목록전체 글 (402)
Creative Code
void setup() { // put your setup code here, to run once: Serial.begin(115200); // 통신속도 조절, serial을 쓰기위해서 반드시 써야한다. Serial.println(78); //serial monitor에 출력 Serial.println(78,DEC); // 10진법 Serial.println(78,HEX); // 16진법 Serial.println(78,BIN); // 2진법 Serial.println(1.23456); //소수점아래 2자리까지 출력 Serial.println(1.23456,1); // 소수점 아래 1자리 까지 출력 Serial.println('N'); // 문자출력 } void loop() { // put your m..
const int LED = 13; // 첫번째 LED 13번 핀에 연결 const int LED2 = 12; // 두번째 LED 12번 핀에 연결 void setup() { // put your setup code here, to run once: pinMode(LED,OUTPUT); //첫번째 LED 출력모드 pinMode(LED2,OUTPUT); // 두번째 LED 출력모드 } void loop() { // put your main code here, to run repeatedly: for (int i = 1; i
#include void printStringArray(char (*pArr)[20], int size) { for (int i = 0; i
#include int main(void) { char *str = "hello, world"; printf("%s\n",str); return 0; }
#include #include #include #define UP 0 #define DOWN 1 #define LEFT 2 #define RIGHT 3 #define SUBMIT 4 //선택(스페이스바) void init(); //콘솔창 크기 설정함수 void gotoxy(int x, int y); //커서이동함수 void titleDraw(); //게임 시작 타이틀화면 출력함수 int keyControl(); //키 입력받는 함수 int menuSelect(); //게임 메뉴 선택함수 void gameInfo(); //게임 정보출력함수 int mapDifficulty(); //게임 난이도 설정함수 void difficultyEasy(); //난이도 EASY 게임실행 함수 void printMap();..
#include #include #include int my_atoi(char *str) { int num = 0; int len = strlen(str); for (int i = len-1; i>=0; i--){ num += (str[len-1-i] - '0')*(pow(10,i)); } return num; } int main(void){ int i = my_atoi("100"); printf("i : %d\n",i); return 0; }