精品导航

Encoders

As you can see, there are many LEDs on your Jay-D.

Let's have some fun with them.

The goal of this code will be to turn the encoders left and right to light up or switch off the LEDs in a row.

To begin, we must create the variable "width" and set it to 6.




Because we are coding the LEDs above the center slider (mid matrix), a value of 6 indicates that the variable is set to the middle.

Now, let's code what happens when we move the encoders to the left and right.

Find this I/O block:




We want the LEDs to turn off one by one when we move the encoder to the left.

We'll need to subtract 1 from the variable "width" to accomplish this.




We must also ensure that the value range is between 0 and 12, as this is the number of available LEDs.



We can duplicate this entire block and change what will happen if we turn the encoder to the right.

Make sure you're adding 1 right now!




We'd like to draw anything on the LED matrix while we're messing around with the encoders.

Because that will be displayed all of the time, we must first locate the "loop forever" block from the "Loops" block part.




The first thing we want to do is turn off all of the LEDs.

This will be accomplished by locating the "fill matrix with" block in the "Matrix" block section.




Make sure to put the Mid matrix since that's the one we are working on right now.

It's time to draw a rectangle.

That block can also be found in the "Matrix" block section.

Make sure you use the correct matrix in the code.

Set the width value to the variable's value and the height value to 2.

Remember to switch on the LEDs by setting the intensity to 100.




To ensure that anything you create on the matrix appears on the screen, you must include the "push frame" block.



Another thing to remember is to always put the "scan inputs" block inside the "loop forever" block if you're coding anything with the inputs (encoders, pushbuttons, sliders, etc.).



Click on the Run button and start playing!

If you want to put the stock firmware back onto your device, you can click the Restore firmware button in the top right corner on CircuitBlocks.

友情链接:久久爱 | 日本高清 | 蘑菇視頻 | 屁屁影院 | mogu视频 | 红桃视频 | 福利精品 | 天天综合 | 色婷婷 | hebeijiaoyuwang.com | 玖玖资源站 | mogu | 蘑菇短视频入口 | 蘑菇网 | 蘑菇影视 | 玖玖爱 | btupic.com | 亚洲精品 | 迷妹网 | 五月丁香 | 樱花视频 | bt搜索 | 小蓝视频 | 秋霞网 | 琳琅导航 | 久久久久久 | 四虎影视 | 汤姆影院 | 蘑菇视频入口 | 青青伊人 | 4008108885.com | 色啪 | 伊人色 | 蓝色导航 | 看片神器 | 在线亚洲 | mogutv | 宅男影院 | 超碰视频 | 酒色世界 | 午夜在线观看 | 秋霞影院 | 蘑菇tv网页版 | 第一福利 | 蜜芽视频 | 欧美午夜 | 色妞 | 在线午夜 | 老司机视频 | 最新av | 综合影院 | 亚洲网 | 蘑菇视频ios | 福利盒子 | 小草社区 | 资源导航 | 永久网站 | lf397.com | 番号网 | tissu-premier.com | 青草青青 | gzdksw.com | 久久香蕉 | woqidz.com | jxty00.com | p站视频 | mogus.cc | 蘑菇在线观看网页版 | 五福影院 | 协和影院 | 精品免费 | zhuoyemall.com | 龙物视频 | tsxhyq.com | 天堂在线 | 久久视频 | rencai98.com | 青娱 | 导航大全 | 草莓视 | zpzb2008.com | dna0126.com | 无名网 | 青草草 | 永久地址 | sanzhucare-zhpg.com | dk99999.com | 扒哥黑料 | 蘑菇传媒 | 摩天轮社区 | 蘑菇传媒在线观看 | 性知音 | 蘑菇网页版入口 | 蘑菇视频网站 | 六月婷婷 | 蘑菇app | fltou.com | 老王影院 | 琵琶妞