Use Retation Sensor to control the brightness of LED lights
来源:互联网 发布:eml文件 mac 编辑:程序博客网 时间:2024/06/05 03:41
This is a very easy and small project.
The most important point is the map function.
int switchValue;int valueToOut;int ledPin = 4;int switchPin = A0;void setup(){ pinMode(ledPin,OUTPUT); Serial.begin(9600);}void loop(){ switchValue = analogRead(switchPin); //the range of switch is 1-1023 //use the function to map valueToOut = map(switchValue,0,1023,1,254); analogWrite(ledPin,valueToOut);}
We can use the function to show the status of some sensors.
阅读全文
0 0
- Use Retation Sensor to control the brightness of LED lights
- How to use the Segmented Control
- Python use Selenium to control the webdriver
- LED Lights Use For Automotive Headlights
- The robot API &&How to add and use sensor.
- How to use softvol to control the master volume
- How to use softvol to control the master volume
- Use the ItemDataBound event to customize the DataGrid control.
- offer different kinds of LED lights
- How to use the function of assembly.
- Use the DataList Control to Present and Edit Data...
- How to use .NET Windows Control into the WPF Application
- Interpretation of jewelry in the use of color to l
- Changing the contrast and brightness of an image!
- Use string::npos to indicate ``the rest of the string;''
- Use javascript to detect the type of the file
- The log use to debug the function of ChangeTemplate
- how to use javascript to control the usercotrol in the asp.net
- cp复制提示问题
- SDUT 数论基础 F
- Ubuntu 设置自定义分辨率
- Unity 渲染教程(二):着色器基础
- ArcGIS沿面状图层要素外边缘构建TIN和进行网络分析求最短路径
- Use Retation Sensor to control the brightness of LED lights
- BitMap算法
- Python新式类与经典类(旧式类)的区别
- Toast
- 冷门的js和css技巧
- Android 图片的压缩(不失真)及保存代码分析
- vb gridview 与jquery 冻结行列
- WIN8 隐私声明
- C#学习笔记_3.C#数据类型