Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. protected void onCreate(Bundle savedInstanceState) {
  2. super.onCreate(savedInstanceState);
  3. setContentView(R.layout.activity_main);
  4. c=(Button) findViewById(R.id.c);
  5. f=(Button) findViewById(R.id.f);
  6. display =(TextView) findViewById(R.id.textView1);
  7. c.setOnClickListener(new View.OnClickListener(){
  8. public void onClick(View v)
  9. {
  10.  
  11. adcPin = "P9_36";//pin number
  12. int adcValue,t_c,t_f;
  13.  
  14.  
  15. adcValue = analogRead(adcPin);**which android function to use?**
  16.  
  17.  
  18.  
  19. t_c = adcValue * 100+10;
  20. display.setText("Temperature is "+ t_c);
  21.  
  22. }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement