精品导航

Sliders

Sliders are another type of input that we can experiment with.

With this code, we want you to expand or narrow the rectangle you'll create on the matrix.

First, create two variables called "width" and "slider_value."

Set both values to 0.



Now, let's code the changes we'll make with the slider.

For that, we'll need the I/O block, inside which we'll insert the code for the slider changes.



We want to save the slider's current position (which can range between 0 and 235) every time we move it.



Then, in the form of ratio, we wish to store that value in the "width" variable.



Make a new variable called "width_display". Store the above value in the variable "width_display" as a percentage.



Now is the time to create what will be happening in loops on the matrix.

For starters, we need the "loop forever" block in the "Loops" block section.



We want for the display to turn black, and have the slider and width display values written on it.

For that, your code needs to look like this:


Make sure the value for "width" is written as a percentage.

Don't forget to include the "push frame" block at the end to guarantee that the code shows on the screen.

Now, let's make the main part on the big matrix.

The first step is to turn off all of the LEDs on that matrix.

You do this with the "fill matrix with 0" block. When the LED intensity is adjusted to 0, the LEDs turn off.



Check if you put the correct matrix in the block (big one in this case).

The block for drawing the rectangle can be found in the "Matrix" block section.



The rectangle's height is set to 9, and its width is relative to the number width x 8 (8 being the maximum width).

To turn on the LEDs, make sure the intensity is set to 100.

Don't forget to add the "push frame to matrix" to ensure the code really shows on the matrix.



Another thing to keep in mind when using any of the inputs is to include the "scan inputs" block inside the "loop forever" block.



Click on the Run button, and start moving the slider.

Is the rectangle expanding?

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.

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