'전체 글'에 해당되는 글 781건
http://www.tufts.edu/programs/mma/emid/RotaryEncoder.pdf
자료해석이 있지만 지극히 개인적으로 볼 용도라서 어순이 이상할 수도 있습니다.
(영어자료랑 같이 보기 편해서요 ^^)
코드는 Assembly어로 씌여있으니 혹시 새로 의뢰를 원하시는 분은
여기 오른쪽 링크에있는 이메일로 문의주세요. ☞링크
참고로 여기 코드는 TechTool의 Assembly어로 씌였습니다.
▲▲▲PDF_자료
Introduction.
This application note covers the use of incremental rotary encoders with PIC microcontrollers.
이 응용 노트는 다룬다. the 사용을 of 증가 로터리 인코더들의 with PIC 마이크로컨트롤러로.
It presents an example program in TechTools assembly language for reading a typical encoder and displaying the results as an up/down count on a seven-segment LED display.
이건 제시한다. an 예제 프로그램을 in TechTools 어셈블리 언어의 for 읽기위해 a 전형적 인코더를
and 디스플레이하기위해 the 결과들을 as an Up/Down 카운터로써 on a 7세그먼트 상에서.
Background.
Incremental rotary encoders provide a pair of digital signals
that allow a microcontroller to determine
the speed and direction of a shaft’s rotation.
증가 로터리 인코더들은 제공한다. 한쌍의 디지털 시그널들을
that 허락하는 a 마이크로컨트롤러를 to 결장하게끔
the 스피드 and 방향을 of a shaft의 회전을.
They can be used to monitor motors and mechanisms,
or to provide a control-knob user interface.
그것들은 can be 사용될수있다. to 모니터하는데 모터들을 and mechanisms를, (☆PID용도)
혹은 to 제공하는데 a 컨트롤-놉 유저 인터페이스를
The best-known application for rotary encoders
is the mouse, which contains two encoders
that track the x- and y-axis movements of a ball
in the device’s underside.
Rotary encoders generally contain a simple electro-optical mechanism
consisting of a slotted wheel, two LEDs, and two light sensors.
Each LED/sensor pair is arranged so that the devices face each other
through the slots in the wheel.
가장잘-알려진 응용 for 로터리 인코더들을위한
은 the 마우스이다, which 포함하는 두개의 인코더들을
that 트랙하는 the XY 축 이동을 of a 공의
in the 디바이스들 밑부분에서.
로터리 인코드들은 일반적으로 포함한다. a 심플 전자-광학 머캐니즘을
구성하며 of a slotted된 휠을, 2개 LEDs를,
and 두개 라이트 센서들을.
각 LED/센서 쌍은 배치된다. so that the 디바이스들은 마주한다. 서로
through the 슬랏들을통해 in the 휠안의.
As the wheel turns, it alternately blocks and passes light, resulting in square wave outputs from the sensors.
The LED/sensor pairs are mounted offset relative to one another,
so that the output square waves are offset 90 degrees in phase.
This is known as quadrature, because 90 degrees amount to one-quarter of a full 360- degree cycle.
As the 휠이 돌아가면서, 그건 번살아 blocks하고 and passes한다. to 다른한쪽에,
so that the 출력 시퀀스 웨이브들은 are offset된다. 90도로 in phase에서.
이건 알려져있다. as quadrature라고, because 90도 량이다. to 1/4 of a 완전 360도 사이클의.
▼▼▼코드
; This program accepts input from a rotary encoder through bits RA.0 and RA.1,
; determines the direction of rotation, and increments or decrements a counter
; appropriately. It displays the hexadecimal contents of the four-bit counter on a
; seven-segment LED display connected to port RB.
; Remember to change device info when programming a different PIC.
device pic16c54,rc_osc,wdt_off,protect_off
reset start
encoder = ra
display = rb
; Variable storage above special-purpose registers.
org 8
temp ds 1
counter ds 1
old ds 1
new ds 1
; Set starting point in program ROM to zero.
org 0
start mov !rb, #0 ; Set rb to output.
mov !ra, #255 ; Set ra to input.
clr counter
mov old, encoder
and old, #00000011b
:loop call chk_encoder
mov w, counter
call sevenseg
mov display, w
goto :loop
chk_encoder mov new, encoder ; Get latest state of input bits.
and new, #00000011b ; Strip off all but the encoder bits.
mov temp, new
xor temp, old ; Is new = old?
jz :return ; If so, return without changing
; counter.
clc ; Clear carry in preparation for
; rotate-left instruction.
rl old ; Move old to the left to align old.0 ; with new.1.
xor old, new
jb old.1, :up ; If the XOR resut is 1, increment
; counter, otherwise decrement.
:down dec counter
skip
:up inc counter
and counter, #00001111b
mov old,new
:return ret
sevenseg jmp pc+w ; display lookup table
retw 126, 48, 109, 121, 51, 91, 95, 112
retw 127, 115, 119, 31, 78, 61, 79, 71
Justin Bieber의 팬이 아니더라도 좋아할만한 곡을 정리하려고 합니다.
다소 두서 없을 수 있지만, 그럴경우 그냥 지나치지 말고 댓글을 남겨주세요^^
우선 최근에 꽂힌 곡중에 Overboard를 소개하려합니다.
제목의 뜻은 가사를 차차 살펴봐야 알듯하군요
Justin 과 Miley Cyrus와 듀엣으로 부른곡이 느낌이 더 좋아서 YouTube를 첨부해봅니다.
아래 가사정리 이후에 Lyrics(=가사)가 같이 뜨는 YouTube가 있으니 따라 불러보시면 좋을듯합니다.
블로그방문 감사드리며 댓글 부탁합니다.~
It feels like we've been out at sea, oh,
느껴져 like 우리가 바다에 있었던듯이
So back and forth that's how it seems,
And when I wanna talk you say to me
That if it's meant to be it will be.
So 들락날락했지 그게 얼마나 보이듯이 (=파도를 표현함)and when 내가 이야기하고플때마다그게 만약 진심이었다면 그게 되길 바라는.Whoa-oh-oh
So crazy is this thing we call love,
And now that we've got it, we just can't give up
I'm reaching out for you,
Get me out here in the water and I...
I'm overboard
And I need your love to pull me up
I can't swim on my own
It's too much
Feels like I'm drowning without your love,
So throw yourself out to me, my lifesaver.
Life saver, oh life saver
My life saver
Life saver, oh life saver
Whoa.
Never understood you when you'd say,
You wanted me to meet you halfway,
Oh, I felt like I was doing my part,
You kept thinking you were coming up short
It's funny how things change cause now I see, oh,
So crazy is this thing we call love,
And now that we've got it we just can't give up
I'm reaching out for you,
Got me out here in the water and I...
I'm overboard (overboard)
And I need your love to pull me up
I can't swim on my own
It's too much (it's too much)
Feels like I'm drowning without your love,
So throw yourself out to me, my lifesaver.
Oh, it's supposed to be some give and take, I know,
But you're only taking and not giving anymore.
So what do I do? (so what do I do)
Cause I still love you (still love you baby),
And you're the only one who can save me.
I'm overboard
And I need your love to pull me up (pull me up)
I can't swim on my own
It's too much (it's too much)
Feels like I'm drowning without your love,
So throw yourself out to me, my lifesaver.
Life saver, oh life saver
My life saver
Life saver, oh life saver
Whoa.
Life saver, oh life saver
My life saver
Life saver, oh life saver
Yeah.
이건 그냥 검색하다가 찾은노래
Stay 가사
I do the same thing I told you that I never would
I told you I'd change, even when I knew I never could
Know that I can't find nobody else as good as you
I need you to stay, need you to stay, hey (oh)
I get drunk, wake up, I'm wasted still
I realize the time that I wasted here
I feel like you can't feel the way I feel
Oh, I'll be fucked up if you can't be right here
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
Oh, I'll be fucked up if you can't be right here
I do the same thing I told you that I never would
I told you I'd change, even when I knew I never could
Know that I can't find nobody else as good as you
I need you to stay, need you to stay, hey
I do the same thing I told you that I never would
I told you I'd change even when I knew I never could
Know that I can't find nobody else as good as you
I need you to stay, need you to stay, hey
When I'm away from you, I miss your touch (ooh-ooh)
You're the reason I believe in love
It's been difficult for me to trust (ooh-ooh)
And I'm afraid that I'ma fuck it up
Ain't no way that I can leave you stranded
'Cause you ain't ever left me empty-handed
And you know that I know that I can't live without you
So, baby, stay
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
Oh-oh-oh-whoa (oh-oh-whoa, oh-oh-whoa)
I'll be fucked up if you can't be right here
I do the same thing I told you that I never would
I told you I'd change, even when I knew I never could
Know that I can't find nobody else as good as you
I need you to stay, need you to stay, hey
I do the same thing I told you that I never would
I told you I'd change even when I knew I never could
Know that I can't find nobody else as good as you
I need you to stay, need you to stay, hey
Oh-oh-oh
I need you to stay, need you to stay, hey