can you help me for creating the completly program of this...
this my proggram
#include <LiquidCrystal.h> // 0
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // 1
int val; // 2
int dB; // 3
const int sensorPin = A0; // 4
char in; // 5
int sensorVal = 0; // 6
int smoothedVal = 200; // 7
int samples = 4; // 8
void setup() { // 9
pinMode(6, OUTPUT); // 10
pinMode(7, OUTPUT); // 11
pinMode(8, OUTPUT); // 12
pinMode(9, OUTPUT); // 13
lcd.begin(16, 2); // 14
lcd.setCursor(1,0); // 15
lcd.print("DESIBEL METER"); // 16
lcd.setCursor(5,1); // 17
lcd.print("W-Tech"); // 18
delay(300); // 29
lcd.clear(); // 20
// Print a message to the LCD.
Serial.begin(9600); // 21
}
void loop() { // 22
//int val;
lcd.clear(); // 23
val = analogRead(sensorPin); // 24
smoothedVal = smoothedVal + ((val - smoothedVal)/samples); //25
val = smoothedVal0.6779+32.755; // 26
dB = val0.5228 + 35.271; // 27
Serial.println(dB); // 28
if(analogRead(sensorPin)<=0){ // 29
lcd.setCursor(0,0); // 30
lcd.print(" DESIBEL METER"); // 31
lcd.setCursor(0,1); // 32
lcd.print("press red button");} // 33
else{ // 34
lcd.setCursor(1,0); // 35
lcd.print("DESIBEL METER"); // 36
lcd.setCursor(0,1); // 37
lcd.print(dB+2); // 38
lcd.setCursor(5,1); // 39
lcd.print("dB"); // 40
lcd.setCursor(8,1); // 41
lcd.print("W-Tech");} // 42
delay(250); // 43
if (val>=45){ digitalWrite(6,1);} // 44
else {digitalWrite(6,0);} // 45
if (val>=55) {digitalWrite(7,1);} // 46
else {digitalWrite(7,0);} // 47
if (val>=60) {digitalWrite(8,1);} // 48
else {digitalWrite(8,0);} // 49
if (val>=70) {digitalWrite(9,1);} // 50
else {digitalWrite(9,0);} // 51
}
i use linearity to convert my ADC......
help me for changes to 20log10....26 and 27 is my conversion of my ADC
meh_dadi3.ino (2.39 KB)