※ 引述《s4A111039 (定板小瓜)》之銘言:
: 開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
: 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
: c++
: 問題(Question):
: 大家好,我有一段程式需"連續"執行下列連結的動作來量測"最大值",請問要如何改?
: http://hank032831.pixnet.net/album/photo/536584618
: (arduino板子)
: void setup() {
: Serial.begin(9600);
: }
: void loop() {
int MaxSensorValue = 0;
: int sensorValue = analogRead(A0);
if(sensorValue > MaxSsensorValue) {
sensorValue = MaxSsensorValue;
}
: Serial.println((sensorValue)* 31.25 / 1023);
: delay(0.016); //1min
: }
: 非常謝謝!