精品导航

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.

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