Advertisement
Guest User

test

a guest
Apr 27th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. vars:
  2.  
  3. float Rl=10.0;
  4. float approx=2373.315;
  5. int GasSensorPin=2;
  6. float Rs,Vout,count,ratio,GasConc; int ppm;
  7.  
  8. Code:
  9.  
  10. count=analogRead(GasSensorPin);
  11. Vout=(count*4.88)/1000.0;
  12. Rs=((5.0*Rl)-(Rl*V out))/Vout;
  13. ratio=Rs/approx;
  14. GasConc=146.15*(2.868-ratio)+10;
  15. ppm=GasConc;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement