Computer/C#

[C#] serialPort, Delay

serialPort ๋ฆฌํ„ด๊ฐ’ ํ…Œ์ŠคํŠธ ์ค‘ ๊ฐ’์„ ๋ณด๋‚ด๊ณ  ์•„๋ž˜ ํ…์ŠคํŠธ๋ฐ•์Šค์— ํ‘œ์‹œํ•˜๋Š” ์ค‘ ๋ฐ”๋กœ ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๋Š” ๋ฌธ์ œ์ ์ด ์žˆ์–ด์„œ ๋”œ๋ ˆ์ด๊ฐ€ ํ•„์š”ํ–ˆ๋‹ค. ๋Œ€๋žต 10ms ์กฐ๊ธˆ ๋ถ€์กฑํ•˜๊ณ  20ms ์ •๋„ ๋”œ๋ ˆ์ด๋ฅผ ์ฃผ๋ฉด ์ž˜ ๋˜๋Š”๊ฒƒ ๊ฐ™์•„ ๋ณด์˜€๋‹ค. serialPort.Write ๋กœ ๋ณด๋‚ด์ฃผ๊ณ  ๋”œ๋ ˆ์ด! private static DateTime Delay(int MS) { DateTime ThisMoment = DateTime.Now; TimeSpan duration = new TimeSpan(0, 0, 0, 0, MS); DateTime AfterWards = ThisMoment.Add(duration); while(AfterWards >= ThisMoment) { System.Windows.Forms.Application.DoEven..

[C#] serialPort, Delay

EIGHTBOX
EIGHTBOX
hwaya.

programmer

๐Ÿ‹์ผ์ƒ์˜ ์†Œ์†Œํ•œ ์ˆœ๊ฐ„๋“ค๋ถ€ํ„ฐ ํฐ ๊ฟˆ๊นŒ์ง€, ํ˜ธ๊ธฐ์‹ฌ์„ ๋งŒ์กฑ์‹œํ‚ฌ ๋‹ค์–‘ํ•œ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ๋‹ด์€ ๋ธ”๋กœ๊ทธ ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ , ์†Œ์†Œํ•œ ํ–‰๋™์— ๊ฐ๋™ํ•˜๋ฉฐ ๊ธฐ๋ปํ•˜๊ณ  ํ•˜๋ฃจํ•˜๋ฃจ์— ๊ฐ์‚ฌํ•˜๋Š” ์‚ฌ๋žŒ๐ŸŒต

Today Yesterday Total
์ตœ์‹ ๊ธ€