精品导航

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.

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