10.07.2015 Views

cubloc_manual2.pdf

cubloc_manual2.pdf

cubloc_manual2.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

이름과 일치시키기 위해서 테이블 변환을 거친 후, CSG 모듈에 표시하는 프로그램입니다.Const Device = CB280Set I2c 9,8Dim I As IntegerDim K As IntegerConst Byte KEYTABLE = (1,4,7,10,2,5,8,0,3,6,9,11,12,13,14,15)DoI=Keypad(0)If I < 16 ThenI = KEYTABLE(I)Csgdec 0,IEnd IfLoop자, 이제 숫자 입력 프로그램을 작성해 보겠습니다. 키의 숫자키를 누르면 4 자리의 숫자를 구성하여 표시합니다. 진행과정에서 K 에 저장되는 값은 BCD 코드형태이므로, 최종값인 M 에 BCD2BIN함수를 이용해서 바이너리값으로 바꾸어서 저장합니다.396Const Device = CB280Set I2c 9,8Dim I As IntegerDim K As IntegerDim M As IntegerK = 0Const Byte KEYTABLE = (1,4,7,10,2,5,8,0,3,6,9,11,12,13,14,15)DoI=Keypad(0)If I < 16 ThenI = KEYTABLE(I)If I < 10 ThenK = K

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!