࠰ἤἒἦỼ‫ܖ‬፼‫ׅ‬ែἏἧἚỉ̅ဇ૾ඥኵ㶎䈖䈱⺑᣿ᦠ䈲䍀䊍䉻䊏䉥ቇ⠌࿁〝䍁නຠ䈪૶↪䈜䉎႐ว䉕೨ឭ䈫䈚䈩䈇䉁䈜䇯Ṽѣ˺࿢‫ؾ‬6530-700 ᅠ᠃ϙ᠃᠍䊶㪦㪪䇭㩷㩷䋺㪮㫀㫅㪻㫆㫎㫊㪐㪏㪪㪜㪆㪉㪇㪇㪇㪆㪯㪧㪆㪭㪠㪪㪫㪘㪆㪎䊶㪚㪧㪬㩷㩷䋺਄⸥㪦㪪䈏ᱜᏱ䈮േ૞䈜䉎㪚㪧㪬䊶䊜䊝䊥㩷䋺਄⸥㪦㪪䈏ᱜᏱ䈮േ૞䈜䉎䊜䊝䊥㊂ṲἒỸὅἿὊἛ೙ᓮቇ⠌䉸䊐䊃䇸䌊䌁೙ᓮ䊍䉻䊏䉥䇹䉇⹦⚦䈭⾗ᢱ䈲એਅ䈱䊖䊷䊛䊕䊷䉳䈎䉌䉻䉡䊮䊨䊷䊄䈚䈩䈒䈣䈘䈇䇯㪿㫋㫋㫇㪑㪆㪆㫎㫎㫎㪅㫋㫆㫇㫄㪸㫅㪅㪺㫆㪅㫁㫇㪆㫂㫐㪆㪿㫆㫄㪼㪅㪿㫋㫄㫃䇭䇭䇭㶎䉻䉡䊮䊨䊷䊄ᣇᴺ䈲䊖䊷䊛䊕䊷䉳䉕ෳᾖ䈒䈣䈘䈇䇯ṲỊẳỜỆ⑳䈢䈤䈱↢ᵴ䈱ਛ䈪䉮䊮䊏䊠䊷䉺䉕૶䈉䈖䈫䈲ᒰ䈢䉍೨䈮䈭䈦䈩䈐䈩䈇䉁䈜䇯䉣䉝䉮䊮䉇㔚᳇䊘䉾䊃䈭䈬ኅ㔚䈱䈾䈫䉖䈬䈲䊙䉟䉮䊮㩿䊙䉟䉪䊨䉮䊮䊏䊠䊷䉺㪀䉕૶䈦䈢䉮䊮䊏䊠䊷䉺೙ᓮ䈪േ䈇䈩䈇䉁䈜䇯䊍䉻䊏䉥㩿䉲䉴䊁䊛㪀䈪䈲䊙䉟䉮䊮䉕૶䈦䈢⸘᷹䊶೙ᓮ䈱䈚䈒䉂䉕ቇ䈹䈖䈫䈏䈪䈐䉁䈜䇯䉁䈢䇮ೋ䉄䈩䊒䊨䉫䊤䊚䊮䉫䈮⸅䉏䉎ᣇ䈪䉅ኈᤃ䈮૕㛎䈪䈐䉎䉋䈉䈮䈭䈦䈩䈇䉁䈜䇯㶎䍀䊍䉻䊏䉥ቇ⠌࿁〝䍁䈲ਃ↰Ꮢ┙㐳ဈਛቇᩞ㩷ᛛⴚ䍃ኅᐸ⑼ᢎ⻀㩷ᵻ↰ኼዷవ↢⠨᩺䈱䇸䊍䉻䊏䉥䉲䉴䊁䊛䇹䈮Ḱ᜚䈚䈢㗴᧚䈪䈜䇯Ṳ‫ן‬጑ἧỳỶἽỉᚐϵṲ‫ׅ‬ែᙌ˺Ⴓ̲ᾉᵻ↰㩷ኼዷ䇭ਃ↰Ꮢ┙㐳ဈਛቇᩞᛛⴚ䍃ኅᐸ⑼ᢎ⻀੗ᧄ㩷ᵏᒾ䇭రᄢ㒋ᐭ┙⍾Ꮉ㜞╬ቇᩞ㩷ᩞ㐳䉻䉡䊮䊨䊷䊄䈘䉏䈢䇸㪡㪘೙ᓮ䊍䉻䊏䉥䇹䈲䊐䉜䉟䊦ኈ㊂䉕ዊ䈘䈒䈜䉎䈢䉄䇮࿶❗䊐䉜䉟䊦䈮䈭䈦䈩䈇䉁䈜䇯వ䈝䈲䊐䉜䉟䊦䉕రㅢ䉍䈮㩿⸃ಓ㪀䈚䉁䈜䇯ṲἤἒἦỼ‫ܖ‬፼‫ׅ‬ែỆếẟề䃂㩷ᧄᯏ䈲䊌䉸䉮䊮䈱㪬㪪㪙┵ሶ䉕૶䈦䈩㔚᳇䈱౉಴ജ䉕⸘᷹䊶೙ᓮ䈜䉎ᯏེ䋨㪬㪪㪙㪄㪠㪦䋩䈪䈜䇯䃂㩷ኾ↪䉮䊈䉪䉺䈮᜛ᒛ䊗䊷䊄䉕ធ⛯䈚䈩䇮᭽䇱䈭ᯏེ䉕೙ᓮ䈪䈐䉁䈜䇯䃂㩷නຠ䈪䉅㪣㪜㪛䈱ὐṌ䈮䉋䉍೙ᓮ䈱䈚䈒䉂䉕ቇ⠌䈜䉎䈖䈫䈏䈪䈐䉁䈜䇯䍀㪬㪪㪙㪄㪠㪦䍁䈦䈩䇮䊌䉸䉮䊮䈫೙ᓮኻ⽎䉕䈧䈭䈓ਛ⛮ེ䈱䉋䈉䈭䉅䈱䈣䈰䇯㪠㪦䈲䍀㪠㫅㫇㫌㫋䍁䍀㪦㫌㫋㫇㫌㫋䍁䈱⇛䈣䉋䇯㩷㩷㩷㩷೙ᓮ㩿ቇ⠌㪀䈮䈲ኾ↪䉸䊐䊃䍀㪡㪘䊍䉻䊏䉥䍁䉕૶↪䈚䉁䈜䇯䃂㩷䉴䉟䉾䉼䈱ಾ䉍ᦧ䈋䈮䉋䉍䇮䇸㪬㪪㪙㪄㪠㪦೙ᓮᯏེ䇹䈱ઁ䈮㩷㩷㩷㩷㪠㪚䈻䈱䇸䊒䊨䉫䊤䊛ᦠㄟ䉂ེ㩿㪘㪭㪩䊤䉟䉺㪀䇹䈫䈚䈩䉅૶↪䈪䈐䉁䈜䇯㩷㩷㩷㶎㪘㪭㪩䊤䉟䉺䈫䈚䈩䈱૶↪ᣇᴺ䈲㪮㪼㪹䊕䊷䉳䉕ෳᾖ䈒䈣䈘䈇䇯䇭䇭䇭䇭䇭䇭䇭䇭䇭䇭䇭䇭䇭㪿㫋㫋㫇㪑㪆㪆㫎㫎㫎㪅㫋㫆㫇㫄㪸㫅㪅㪺㫆㪅㫁㫇㪆㫂㫐㪆㪿㫆㫄㪼㪅㪿㫋㫄㫃ᩓเဇἦὅ䍀䊍䉻䊏䉥ቇ⠌࿁〝䍁䈲䈠䈱䉁䉁䈪䉅㪣㪜㪛䈱ὐἮ䈪䊙䉟䉮䊮೙ᓮ䈱䈚䈒䉂䉇䊒䊨䉫䊤䊛䈏ቇ⠌䈪䈐䉎䈱䈰䇯䉻䉡䊮䊨䊷䊄䈚䈢䉝䉟䉮䊮䉕䉻䊑䊦䉪䊥䉾䉪䈚䉁䈜䇯䍀㫁㪸㪶㪿㫀㪻㪸㫇㫀㫆䍁䊐䉤䊦䉻䈏૞ᚑ䈘䉏䉁䈜䇯䇼ዷ㐿䇽䉕䉪䊥䉾䉪䈚䈩䈒䈣䈘䈇䇯ṲẐἤἒἦỼ‫ܖ‬፼‫ׅ‬ែẑỉ੗ዓಾᦧ䈋䉴䉟䉾䉼䉕㩷㩷㩷䍀㪠㪦䍁஥䈮䈚䉁䈜䇯ઃዻ䈱㪬㪪㪙䉬䊷䊑䊦䈪䊌䉸䉮䊮䈱㪬㪪㪙䊘䊷䊃䈮ធ⛯䈚䉁䈜䇯ਘࢌဇἅ἟ἁἑӲᢿӸᆅ䍀䊍䉻䊏䉥ቇ⠌࿁〝䍁䉕න⁛䈪㩿䊌䉸䉮䊮䈮ធ⛯䈞䈝㪀േ૞䈞䉎䈢䉄䈱㔚Ḯ↪䈱䊏䊮䈪䈜䇯ኾ↪䈱᜛ᒛ䊗䊷䊄䉕ធ⛯䈜䉎䈢䉄䈱䉮䊈䉪䉺䈪䈜䇯

᭗᠗ࡇLEDᵆᶣ8ᵇUSB-IOḸAVRἻỶἑЏஆảἋỶἕἓ㪬㪪㪙䊘䊷䊃㪬㪪㪙䈱䊙䊷䉪ធ⛯࿑䉴䉟䉾䉼䉕਄஥䈮䈜䉎䈫䍀㪘㪭㪩䊤䉟䉺䍁䈮䈭䉍䉁䈜䇯ㅢᏱ䈲ਅ஥㩿㪠㪦஥㪀䈪૶↪䈒䈣䈘䈇䇯

CdSज़ࡇᛦૢဇ

ṲẐJAἤἒἦỼẑỉឪѣ㪘㫋㫋㫀㫅㫐㪉㪊㪈㪊䉻䉡䊮䊨䊷䊄䈚䈢䇼㫁㪸㪶㪿㫀㪻㪸㫇㫀㫆䇽㸢䇼㪹㫀㫅䇽䊐䉤䊦䉻ౝ䈱㩹㪿㫀㪻㪸㫇㫀㫆㪅㪼㫏㪼㩹䉝䉟䉮䊮䉕䉻䊑䊦䉪䊥䉾䉪䈚䈩䈒䈣䈘䈇䇯ἰỶἅὅᵆAVRᵇ

CdSᵆήἍὅἇᵇ㸠㩹㪿㫀㪻㪸㫇㫀㫆㪅㪼㫏㪼㩹䉝䉟䉮䊮USBἅ἟ἁἑ

ṲẐJAἤἒἦỼẑỉನ঺䇸㪡㪘䊍䉻䊏䉥䇹䈲㪌䈧䈱䉮䊷䉴䈪᭴ᚑ䈘䉏䈩䈇䉁䈜䇯ṲਘࢌἮὊἛỆếẟềኾ↪䈱᜛ᒛ䊗䊷䊄䈮䈲એਅ䈱䉋䈉䈭䉅䈱䈏䈅䉍䉁䈜䇯̮ӭೞἮὊἛ7ἍἂἳὅἚLEDἮὊἛἙỵἋἩἾỶἮὊἛ㪙㪇㪙㪌㪙㪍㪙㪋ᚘยἮὊἛ㽲㪉ㅴᢙ䈫㪈㪇ㅴᢙ䈱ኻᲧ䈏ቇ⠌䈪䈐䉁䈜䇯㽳➅䉍㄰䈚ಣℂ䉕ቇ⠌䈪䈐䉁䈜䇯㽴㪉ㅴᢙ䈱⸘▚ᣇᴺ䈏ቇ⠌䈪䈐䉁䈜䇯㽵䇸䊍䉻䊏䉥ቇ⠌࿁〝䇹䈻䈱౉ജ䉕⏕⹺䈪䈐䉁䈜䇯㽶೙ᓮ䊒䊨䉫䊤䊛䉕૞ᚑ䈪䈐䉁䈜䇯㪙㪈㪙㪉㪙㪊ᴾ̮ӭೞἮὊἛ7ἍἂἳὅἚLEDἮὊἛἙỵἋἩἾỶἮὊἛ㪣㪜㪛䉕ାภᯏ䈮⷗┙䈩䈢೙ᓮ䉕ቇ⠌䈪䈐䉁䈜䇯㩷䊂䉳䉺䊦ᢙሼ䉕⴫␜䈜䉎೙ᓮ䉕㩷ቇ⠌䈪䈐䉁䈜䇯䇭ᶧ᥏↹㕙䈮ᢥሼ䉕⴫␜䈜䉎䇭೙ᓮ䉕ቇ⠌䈪䈐䉁䈜䇯㶎᜛ᒛ䊗䊷䊄䈱⹦⚦䈮䈧䈇䈩䈲ਅ⸥㪮㪼㪹䊕䊷䉳䉕ෳᾖ䈒䈣䈘䈇䇯䇭䇭㪿㫋㫋㫇㪑㪆㪆㫎㫎㫎㪅㫋㫆㫇㫄㪸㫅㪅㪺㫆㪅㫁㫇㪆㫂㫐㪆㪿㫆㫄㪼㪅㪿㫋㫄㫃ᚘยἮὊἛ᷷ᐲ䉕ቯᦼ⊛䈮᷹ቯ䇮଻ሽ䈚䇮䊂䊷䉺䉕䊌䉸䉮䊮䈮ข䉍ㄟ䉃䈖䈫䈏䈪䈐䉁䈜䇯JA䊍䉻䊏䉥䇭⿠േ↹㕙㶎಴Ꮸ⇟ภ䋨㪋䉬䉺䋩䉕౉ജ䈚䈩䈒䈣䈘䈇䇯Ṟᴾؕᄽ᬴ܱᾀᵆЈщᵇṢᴾቇତἩἿἂἻἱὅἂ䊒䊨䉫䊤䊛䉕૞ᚑ䈜䉎↹㕙䈪䈜䇯㩷䊒䊨䉫䊤䊛䈱ᦠᑼ䈲䊗䉺䊮䉕䉪䊥䉾䉪䈜䉎䈣䈔䈪౉ജ䈪䈐䉁䈜䇯䊝䊷䊄䈲䍀ೋ⚖䍁䍀ਛ⚖䍁䍀਄⚖䍁䈏䈅䉍䇮↹㕙䉕ಾ䉍ᦧ䈋䉎䈖䈫䈏䈪䈐䉁䈜䇯䋨ฦ䊝䊷䊄䈪૶↪䈪䈐䉎๮઎ᢥ䈱ᢙ䈏⇣䈭䉍䉁䈜䇯䋩ᵐᡶૠỆ‫ࣖݣ‬ẲẺᵏᵎᡶૠỉૠ‫܌‬ửᘙᅆẲộẴẇᴾᴾṾᵐᡶૠỊμềỉἩἿἂἻἲỉؕஜỂẴẇ㩷㩷㩷㽲છᗧ䈱䇼಴ജ⁁ᘒ䇽䊗䉺䊮䉕䉪䊥䉾䉪䈚䉁䈜䇯㩿䋲ㅴᢙ䈱౉ജ㪀㩷㽳㪲಴ജᜰቯᢙ㪴ᰣ䈮ኻᔕ䈚䈢㪈㪇ㅴᢙ䈱ᢙሼ䈏⴫␜䈘䉏䉁䈜䇯㩷㽴㪲಴ജᜰቯᢙ㪴ᰣ䈮ᢙሼ㩿㪈㪇ㅴᢙ㪀䉕౉ജ䈚䉴䉺䊷䊃䊗䉺䊮䉕䉪䊥䉾䉪䈜䉎䈫䇮ኻᔕ䈚䈢಴ജ⁁ᘒ䈮䊗䉺䊮䈏ὐἮ㩷㩿㪉ㅴᢙ䉕⴫␜㪀㩷䈚䉁䈜䇯Ṳ ਴λἮἑὅ䇭 䋺๮઎ᢥ䉕છᗧ䈱ⴕ䈮ᝌ౉䈚䉁䈜䇯Ṳ ᚖദἮἑὅ䇭 䋺છᗧ䈱ⴕ䈱๮઎ᢥ䉕ୃᱜ䈚䉁䈜䇯Ṳ ЪᨊἮἑὅ䇭 䋺છᗧ䈱ⴕ(๮઎ᢥ)䉕೥㒰䈚䉁䈜䇯Ṳ μЪᨊἮἑὅ 䋺ో䈩䈱ⴕ(๮઎ᢥ)䉕೥㒰䈚䉁䈜䇯Ẕᙀឱẕ䊗䉺䊮䋨㪣㪜㪛䋩䈱ὐἮ㩿⿒㪀䈲㪉ㅴᢙ䈱䍀㪈䍁䉕⴫䈚䉁䈜䇯㩷㩷㩷䇭㩷㩷㩷䇰㩷䇭䇭㩷䈱ᶖἮ㩿㕍㪀䈲䇭㩷㩷䇰䇭䇭䍀㪇䍁㩷䇭䇭䇰䇭㩷䇭䇯Ṳ ᡙьἮἑὅ䇭 䋺๮઎ᢥ䉕ᦨᓟ䈱ⴕ䈮ㅊട䈚䉁䈜䇯ᲫᲪᲫᲪᲫᲪᲫᲪ 2ᡶૠᲷ170 10ᡶૠ䈬䈉䈚䈩䈖䈉䈭䉎䈎䈭䋿䍀ၮ␆ታ㛎㪊䍁䈪⸘▚ᣇᴺ䈏ಽ䈎䉎䉋䇯Ṳ ҮТἮἑὅ䇭 䋺౉ജ䈚䈢䊒䊨䉫䊤䊛䉕ශ೚䈚䉁䈜䇯Ṳ ܱᘍἮἑὅ䇭 䋺౉ജ䈚䈢䊒䊨䉫䊤䊛䉕ታⴕ䈚䉁䈜䇯ẔἩἿἂἻἲ᪯ࡀẕ㩷㩷㽲㩷ฦ๮઎ᢥ䉕౉ജ䇯㩷㩷㽳㩷ᜰቯᢙ䉕౉ജ䇯㩿䊘䊷䊃⇟ภ䇮಴ജᤨ㑆㪀

Ṳᴾؕஜԡˋ૨

ṟᴾؕᄽ᬴ܱᵐᴾίጮụᡉẲϼྸὸӲᆔᴾጮụᡉẲϼྸỉѣ˺ầᄩᛐỂẨộẴẇᾋጮụᡉẲễẲᾍ㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷䋺๮઎䉕㪈࿁䈱䉂ታⴕ䈚䉁䈜䇯ᾋ໯ᨂጮụᡉẲᵆDo-Loopᵇᾍ㩷䋺๮઎䉕ή㒢䈮➅䉍㄰䈚䉁䈜䇯㩷㩷䇭䇭䇭㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㩷㶎⚳ੌ䈘䈞䉎䈮䈲䇼STOP䇽䊗䉺䊮䉕䉪䊥䉾䉪䈚䉁䈜䇯ᾋஊᨂጮụᡉẲᵆFor-Nextᵇᾍᴾ䋺᳿䉄䉌䉏䈢࿁ᢙ䈣䈔๮઎䉕➅䉍㄰䈚䉁䈜䇯

䃂ddrB=䇸䊍䉻䊏䉥䇹䈪䈲䇮䊒䊨䉫䊤䊛䈱ᆎ䉄䈮䇮ᔅ䈝ฦ䊘䊷䊃䋨㪧㪙㪇䌾㪧㪙㪎䋩䈱౉಴ജ䈱⸳ቯ䉕䈚䉁䈜䇯䋨ᦠᑼ଀䋩ddrB=255㶎㪙㪇䌾㪙㪎䊘䊷䊃ో䈩䉕಴ജ↪䈮⸳ቯ䈜䉎䈫䈇䈉๮઎䈪䈜䇯

䃂PortB=䇭಴ജᜰቯᢙ㩷㪃㩿䉦䊮䊙㪀㩷㩷⑽ᢙ㩿䋍⑽㪀
಴ജ೙ᓮ๮઎䈱ᦠᑼ䇯䋨ᦠᑼ଀䋩PortB=128,300

ᾋϼྸϋܾഇᾍᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾᴾ䋺ታⴕ䈚䈩䈇䉎๮઎䉕⴫␜䈚䉁䈜䇯㩿಴ജᜰቯᢙ䉕㪉ㅴᢙ䈱㪏ᩴ䈮ᄌ឵䈜䉎䈫㪀䌂㪎䊘䊷䊃䈮㪊㪇㪇䋍⑽㩿㪇㪅㪊⑽㪀㑆䈣䈔಴ജ䈘䉏䉁䈜䇯

䃂For 䌾㩷Next㩷䋨ਛ⚖䊝䊷䊄䈪⴫␜䈘䉏䉁䈜䇯䋩᦭㒢➅䉍㄰䈚๮઎䈱ᦠᑼ䇯
For䈎䉌Next䈱㑆䈱䊒䊨䉫䊤䊛䉕䇮ᜰቯ䈚䈢࿁ᢙ䈣䈔➅䉍㄰䈚䉁䈜䇯㩿ᦠᑼ଀䋩For 䌩=1 To ➅䉍㄰䈚࿁ᢙ
ṸᴾἩἿἂἻἲ̊
ddrB=255
䇭䇭For 䌩=1 To 3㩷䇭㩷᦭㒢➅䉍㄰䈚㩿㐿ᆎ૏⟎䇮➅䉍㄰䈚࿁ᢙᜰቯ䋺㪊࿁㪀䇭䇭PortB=1,300䇭㩷B0 ಴ജ䋨৻⇟ฝ䈱LED䈱䉂ὐἮ䋩
䇭䇭PortB=2,300䇭㩷B1 ಴ജ䋨ฝ䈎䉌2⇟⋡䈱LED䈱䉂ὐἮ㪀
Next i 䇭䇭䇭㩷㩷᦭㒢➅䉍㄰䈚㩿ᚯ䉍૏⟎㪀End䃂If 䌾 Else 䌾 End If㩷䋨਄⚖䊝䊷䊄䈪⴫␜䈘䉏䉁䈜䇯䋩Ṡᴾؕᄽ᬴ܱᵑᴾίᵐᡶૠὸؕᄽ᬴ܱᵏỉဒ᩿Ệ‫٭‬੭ࡸầᡙьẰủềẟộẴẇ䇼಴ജ⁁ᘒ䇽䊗䉺䊮䉕䉪䊥䉾䉪䈜䉎䈎಴ജᜰቯᢙ䉕౉ജ䈜䉎䈫⸘▚ᑼ䈏⴫␜䈘䉏䉁䈜䇯ㅴᢙψㅴᢙ 㧦ㅴᢙ߆ࠄㅴᢙ߳ߩᄌ឵ߩᑼ߇⴫␜ߐࠇ߹ߔ‫ޕ‬ㅴᢙψㅴᢙ 㧦‫ޓޖޓޓ‬ㅴᢙ‫ޕޓޓޓޓޓޓޓޖޓޓޓޓޓ‬ㅴᢙψㅴᢙ 㧦ㅴᢙ߆ࠄㅴᢙ‫ޕޓޓޓޓޓޓޓޖޓޓޓޓޓ‬㶎㪈㪍ㅴᢙ䈮䈧䈇䈩䇭㩷㪈㪍ㅴᢙ䈲ᢙሼ䈱㪇䌾㪐䇮䉝䊦䊐䉜䊔䉾䊃䈱㪘䌾㪝䉕↪䈇䈩䇭㩷㩽㪟䂾䂾䈫⴫⸥䈚䉁䈜䇯䇭㩷䋨䂾䈮䈲㪇䌾㪐䇮㪘䌾㪝䈱䈇䈝䉏䈎䈏౉䉍䉁䈜䇯䋩⿠േ↹㕙䈪಴Ꮸ⇟ภ䉕㪋䉬䉺䈪౉ജ䈚䈩䈰䇯̊䋺10101010 㩿㪉ㅴᢙ㪀
㪔1㬍㪉㪎㩷㪂㩷0㬍㪉㪍㩷㪂㩷1㬍㪉㪌㩷㪂㩷0㬍㪉㪋㩷㪂㩷1㬍㪉㪊㩷㪂㩷0㬍㪉㪉㩷㪂㩷1㬍㪉㪈㩷㪂㩷0㬍㪉㪇
㪔1㬍㪈㪉㪏㩷㩷㩷㩷㩷㩷㩷䇭㩷㩷㪂㩷1㬍㪊㪉㩷㩷㩷㩷㩷䇭䇭㩷㩷㩷㩷㪂㩷1㬍㪏㩷㩷㩷㩷㩷䇭䇭㩷㩷㩷㩷㩷㩷㪂㩷1㬍㪉
㪔170㩷㩿㪈㪇ㅴᢙ㪀

䃂End䊒䊨䉫䊤䊛⚳ੌ๮઎䈱ᦠᑼ䇯䋨ᦠᑼ଀䋩End䊒䊨䉫䊤䊛䈱ᦨᓟ䈮ᔅ䈝౉ജ䈚䉁䈜䇯ἍὅἇὊỉλщཞ७ửᄩᛐỂẨộẴẇ㶎䊍䉻䊏䉥ቇ⠌࿁〝䈪䈲䉶䊮䉰䊷䈫䈚䈩CdS䉕૶↪䈚䈩䈇䉁䈜䇯㶎䍀䊍䉻䊏䉥ቇ⠌࿁〝䍁䈪䈲㪚㪻㪪䈮శ䈏㩹ᒰ䈢䉎㩹㩷㩹ᒰ䈢䉌䈭䈇㩹䉕⸘᷹䈚䇮᧦ઙ䈫䈚䈩䈇䉁䈜䇯

ṸᴾἩἿἂἻἲ̊Ṹ ἩἿἂἻἲ̊

ddrB=255䇭䇭䇭䇭䇭಴ജ⸳ቯ䋨ో䈩಴ജ䊘䊷䊃䈮⸳ቯ䋩
䇭PortB=1,300䇭䇭B0 ಴ജ䋨৻⇟ฝ䈱LED䈱䉂ὐἮ䋩
䇭PortB=2,300䇭䇭B1 ಴ജ䋨ฝ䈎䉌2⇟⋡䈱LED䈱䉂ὐἮ䋩End 䇭䇭 䇭䇭䇭䇭䇭䇭䊒䊨䉫䊤䊛䈱⚳䉒䉍

ddrB=255ẅDoẅẅIf pinD,0=1 Then ẅ㩷㩷㪧㪛0䈮౉ജ䈏䈭䈇䋨CdS䈮శ䈏ᒰ䈢䉌䈭䈇䋩႐ว䈲䇮
䇭䇭䇭PortB=0,300 䇭䇭㩷䇭㩷಴ജή䈚䋨LED䈲䈬䉏䉅ὐἮ䈚䈭䈇䋩
䇭䇭䇭PortB=255,300 䇭䇭㩷B0䌾B7಴ജ䋨ో䈩䈱LED䈏ὐἮ䋩䇭䇭Else 䇭䇭䇭䇭䇭䇭䇭䇭䇭㩷㪧㪛0䈮౉ജ䈏䈅䉎䋨CdS䈮శ䈏ᒰ䈢䉎䋩႐ว䈲䇮
䇭䇭䇭PortB=85,300 䇭䇭䇭B0,B2,B4,B6಴ജ
䇭䇭䇭PortB=170,300 䇭䇭㩷B1,B3,B5,B7಴ജ䇭䋨੤੕䈮ὐṌ䋩䇭䇭End If 䇭䇭䇭䇭䇭䇭䇭䇭㩷If๮઎䈱⚳ੌ
䇭LoopEndṲᴾጮụᡉẲԡˋ૨
䃂Do 䌾㩷Loopṡᴾؕᄽ᬴ܱᵒᴾίλЈщὸ᧦ઙಽጘ๮઎䈱ᦠᑼ䇯᧦ઙ䉕ḩ䈢䈚䈢ᤨ䈮If䈎䉌Else䈱㑆䈱䊒䊨䉫䊤䊛䉕ታⴕ䈚䇮䈠䉏એᄖ䈲Else䈎䉌End If䈱㑆䈱䊒䊨䉫䊤䊛䉕ታⴕ䈜䉎䇯ή㒢➅䉍㄰䈚๮઎䈱ᦠᑼ䇯
Do䈎䉌Loop䈱㑆䈱䊒䊨䉫䊤䊛䉕䇮૗ᐲ䉅➅䉍㄰䈚䉁䈜䇯ṸᴾἩἿἂἻἲ̊CdS䈮ᚻ䉕䈎䈙䈜䈫↹㕙ฝ┵䈱䇸0䇹䈏䇸1䇹䈮ᄌ䉒䉍䉁䈜䇯䇸0䇹䈲䉶䊮䉰䊷䈏෻ᔕ䈚䈩䈇䈭䈇⁁ᘒ䇮䇸1䇹䈲䉶䊮䉰䊷䈏෻ᔕ䈚䈩䈇䉎⁁ᘒ䉕␜䈚䉁䈜䇯㶎෻ᔕ䈚䈭䈇႐ว䈲CdSᗵᐲ⺞ᢛ↪䈱䊗䊥䉡䊛䉕࿁䈚䈩⺞▵䈚䈩䈒䈣䈘䈇䇯

ddrB=255
Do 䇭䇭䇭䇭䇭䇭䇭䇭䇭ή㒢➅䉍㄰䈚䋨㐿ᆎ૏⟎䋩䇭䇭PortB=1,300䇭 B0 ಴ജ䋨৻⇟ฝ䈱LED䈱䉂ὐἮ䋩
䇭䇭PortB=2,300䇭㩷 B1 ಴ജ㩷䋨ฝ䈎䉌2⇟⋡䈱LED䈱䉂ὐἮ㪀
Loop 䇭䇭䇭䇭䇭䇭䇭㩷㒢➅䉍㄰䈚䋨ᚯ䉍૏⟎䋩
End㶎䈖䈱⺑᣿ᦠ䈪䈲ၮᧄ⊛䈭઀᭽䈱䉂䉕⸥タ䈚䈩䈍䉍䉁䈜䇯᜛ᒛ䊗䊷䊄䈫䈱ㅪ៤╬䇮⹦⚦䈮㑐䈚䈩䈲ਅ⸥㪮㪼㪹䊕䊷䉳䉕ෳᾖ䈒䈣䈘䈇䇯㪿㫋㫋㫇㪑㪆㪆㫎㫎㫎㪅㫋㫆㫇㫄㪸㫅㪅㪺㫆㪅㫁㫇㪆㫂㫐㪆㪿㫆㫄㪼㪅㪿㫋㫄㫃㪡㪠㪘㪙㪡㪛