Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- c=(Button) findViewById(R.id.c);
- f=(Button) findViewById(R.id.f);
- display =(TextView) findViewById(R.id.textView1);
- c.setOnClickListener(new View.OnClickListener(){
- public void onClick(View v)
- {
- adcPin = "P9_36";//pin number
- int adcValue,t_c,t_f;
- adcValue = analogRead(adcPin);**which android function to use?**
- t_c = adcValue * 100+10;
- display.setText("Temperature is "+ t_c);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement