精品导航

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.

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