博文

目前显示的是 一月, 2023的博文

Interactive LED Circuit

图片
  The principle of this assignment is actually not difficult, but the main difficulty is that it is difficult to understand these points in class, and some details in it may take me half a day to understand in my native language. <textarea> void setup () { Serial . begin ( 9600 ) ; pinMode ( 11 , OUTPUT ) ; pinMode ( 12 , OUTPUT ) ; pinMode ( 13 ,OUTPUT ) ; } void loop () { if ( analogRead ( A0 ) < 400 ){ digitalWrite ( 11 ,HIGH ) ; digitalWrite ( 12 ,LOW ) ; digitalWrite ( 13 ,LOW ) ; } if ( analogRead ( A0 ) > 400 && analogRead ( A0 ) < 800 ){ digitalWrite ( 11 ,LOW ) ; digitalWrite ( 12 ,HIGH ) ; digitalWrite ( 13 ,LOW ) ; } if ( analogRead ( A0 ) > 800 && analogRead ( A0 ) < 1600 ){ digitalWrite ( 11 ,LOW ) ; digitalWrite ( 12 ,LOW ) ; digitalWrite ( 13 ,HIGH ) ; } if ( analogRead ( A0 ) > 1600 && analogRead ( A0 ) < 2400 ){ digitalWrite ( 11 ,HIGH ) ; digitalWrite ( 12 ,LOW ) ; digitalWrite ( 13 ,LOW ) ; } if ( analogRead ( A0

blink