


| รหัสสินค้า | SKU-00337 |
| หมวดหมู่ | IR / Light / Hall / Magnetic |
| ราคา | 170.00 บาท |
| ลงสินค้า | 21 ต.ค. 2560 |
| อัพเดทล่าสุด | 20 เม.ย. 2568 |
| คงเหลือ | 0 ชิ้น |
| GY-8511 | Arduino |
| 3.3V | 3.3V |
| OUT | A0 |
| GND | GND |
| EN | 3.3V |
| Arduino 3.3V | Arduino A1 |
int UVOUT = A0; //Output from the sensorint REF_3V3 = A1; //3.3V power on the Arduino boardvoid setup(){Serial.begin(9600);pinMode(UVOUT, INPUT);pinMode(REF_3V3, INPUT);Serial.println("ML8511 example");}void loop(){int uvLevel = averageAnalogRead(UVOUT);int refLevel = averageAnalogRead(REF_3V3);//Use the 3.3V power pin as a reference to get a very accurate output value from sensorfloat outputVoltage = 3.3 / refLevel * uvLevel;float uvIntensity = mapfloat(outputVoltage, 0.99, 2.8, 0.0, 15.0); //Convert the voltage to a UV intensity levelSerial.print("output: ");Serial.print(refLevel);Serial.print("ML8511 output: ");Serial.print(uvLevel);Serial.print(" / ML8511 voltage: ");Serial.print(outputVoltage);Serial.print(" / UV Intensity (mW/cm^2): ");Serial.print(uvIntensity);Serial.println();delay(100);}//Takes an average of readings on a given pin//Returns the averageint averageAnalogRead(int pinToRead){byte numberOfReadings = 8;unsigned int runningValue = 0;for(int x = 0 ; x < numberOfReadings ; x++)runningValue += analogRead(pinToRead);runningValue /= numberOfReadings;return(runningValue);}//The Arduino Map function but for floats//From: http://forum.arduino.cc/index.php?topic=3922.0float mapfloat(float x, float in_min, float in_max, float out_min, float out_max){return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;}



ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีด้านล่าง โดยลูกค้าสามารถโอนเงินหลังทำรายการสั่งซื้อได้ทันทีไม่ต้องรอยืนยัน
หลังจากโอนเงินแล้วสามารถแจ้งชำระเงินได้ที่ เมนูแจ้งชำระเงิน
หรือชำระเงินผ่าน PayPal โดยคลิกที่ ชำระเงินออนไลน์
| หน้าที่เข้าชม | 1,837,691 ครั้ง |
| ผู้ชมทั้งหมด | 806,691 ครั้ง |
| เปิดร้าน | 12 ธ.ค. 2558 |
| ร้านค้าอัพเดท | 24 ต.ค. 2568 |