본문 바로가기

정리중인 카테고리

(63)
[리눅스] Ubuntu의 apt-get 명령어 정리. apt-get(Advanced Packaging Tool)은 우분투(Ubuntu)를 포함안 데비안(Debian)계열의 리눅스에서 쓰이는 패키지 관리 명령어 도구입니다. 우분투에는 GUI 로 되어 있는 시냅틱 꾸러미 관리자도 있기는 하지만 이런 저런 개발관련 패키지를 설치할 때는 커맨드기반인 apt-get 이 더 편하기도 합니다. sudo 는 superuser 권한으로 실행하기 위함입니다. 패키지 인덱스 인덱스 정보를 업데이트 : apt-get 은 인덱스를 가지고 있는데 이 인덱스는/etc/apt/sources.list 에 있습니다.이곳에 저장된 저장소에서 사용할 패키지의 정보를 얻습니다. sudo apt-get update 설치된 패키지 업그래이드 : 설치되어 있는 패키지를 모두 새버전으로 업그래이드 합..
[PHP] php 로 mysql 데이터 가져오기. $link = mysql_connect("localhost", "root", "1234") or die("MySQL Connection Error.");$select = mysql_select_db ("db");if (!$select) { echo "DB Selection Error."; exit;}$query = "select count(*) from {$table_name} where column1='{$column1}'";$result = mysql_query($query);$count = mysql_result($result, 0, 0);mysql_close($link);?>$conn = mysqli_connect('localhost', $id, $pw, $db) or die(mysql_error..
[PHP] php session 예제. $_SESSION['temp'] 는 session_destroy() 나 unset($_SESSION['temp']) 을 만나기 전까지 페이지를 벗어나도 유지합니다. isset($_SESSION['temp']) 을 이용하여 해당 세션값의 유무를 판단 할 수 있습니다. 아래는 그 예제 입니다. if(isset($_SESSION['temp'])) { echo "temp is not empty.";}
Visual Studio 모든 설정 초기화 하는 방법. 시작 -> Microsoft Visual Studio -> Visual Studio Tools -> 명령 프롬프트(또는 개발자 명령 프롬프트) 아래의 명령어를 입력합니다. devenv /resetuserdata
ATmega128 - USART 패킷 단위 소스코드. #define headerData 0xff unsigned char checkSum = 0; Transmit() { checkSum = (char)(data1 + data2 + data3); printf(headerData); printf(data1); printf(data2); printf(data3); printf(checkSum);} unsigned char rxdDataBuffer = 0;unsigned char rxdDataState = 0;unsigned char rxdDataPacketCount = 0;unsigned char rxdDataPacket[6];unsigned char rxdDataError = 0;unsigned char rxdDataBufferCheckSum = 0;unsig..
ATmega128 - 리모콘 수신 프로그램 (업그레이드). #define F_CPU 16000000UL #include #include #include #include #define CLK 16000000#define PRESCALE 256#define TIME_US 100#define TIMER0_CNT (CLK*TIME_US/(256*1000000)) char _remocon_counter,_save_remocon,_flg_remocon;char bit_input;char bounce_check = 0; unsigned char _remocon_custom,_remocon_custom_2;unsigned char _remocon_data,_remocon_data_2; int _counter_remocon; void port_init() { DDRA = 0xf..
ATmega128 - PWM 제어 예제. #define F_CPU 16000000UL #include #include #include void port_init() { DDRA = 0xff; PORTA = 0x00; DDRB = 0xff; PORTB = 0x00; DDRC = 0xff; PORTC = 0x00; DDRD = 0xff; PORTD = 0x00; DDRE = 0xff; PORTE = 0x00; DDRF = 0xff; PORTF = 0x00; DDRG = 0xff; PORTG = 0x00;} int main(void) { unsigned char i = 0; unsigned char j = 0; _delay_ms(500); port_init(); // FOC0:0, WGM00:1, COM01:1, COM00:0, WGM01:0, CS..
ATmega128 - 적외선 신호(리모콘 신호) 수신 동작 소스. // 일반 송신 함수void usart_tx_byte(u08 tx_data){ while(!(UCSRA&0x20)); UDR=tx_data; UCSRA|=0x20;} // 송신할 데이터를 16진 데이터로 변형후 송신void usart_tx_byte_hex(u08 tx_hex_data){ unsigned char h_data, l_data; l_data=tx_hex_data&0x0f; h_data=tx_hex_data>>4; if(h_data