How to send two ADC value via ARDUINO?

Status
Not open for further replies.

nishat anjum khan

Member level 2
Joined
Aug 4, 2012
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,562
for my project i have to send two adc value and then have to plot it individually in MATLAB...can anyone give me suggestion that how can i send two ADC value via ARDUINO?
 

Re: arduino uno_ two adc

what is your connection? usb serial parallel?

Code C - [expand]
1
ADMUX = x;


where x is adc channel
 

Re: arduino uno_ two adc

Here is the code. See attached files.


Code C++ - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int analogPin1 = 0;     // potentiometer wiper (middle terminal) connected to analog pin 0
                       // outside leads to ground and +5V
int analogPin2 = 1;     // potentiometer wiper (middle terminal) connected to analog pin 1
                       // outside leads to ground and +5V
int val = 0;           // variable to store the value read
 
void setup()
{
  Serial.begin(9600);          //  setup serial 9600 bps baudrate
}
 
 
void loop()
{
  val = analogRead(analogPin1);    // read the input pin
  Serial.println(val);             // debug value
  delay(500);
  val = analogRead(analogPin2);    // read the input pin
  Serial.println(val);             // debug value
  delay(500);
}





 

Attachments

  • UNO.rar
    203.2 KB · Views: 107
  • adcUart.png
    38.6 KB · Views: 142
  • adcUart1.png
    40.1 KB · Views: 141
Last edited:
Re: arduino uno_ two adc


Hi

Would be good if you could let me know of a safe link to download the Arduino Uno Library for Proteus.

Seems there are a few links when you google but don't know which ones are safe and actually work .

thanks
 

Re: arduino uno_ two adc

Hi Milan

Have loaded it in without any problems, well get some .hex loaded up tomorrow and give it a good test; will save me having to drag the dev board out all the time.

Many thanks
 

Re: arduino uno_ two adc

thank u...it helps me a lot...can u just tell me how i create two y axis in MATLAB without using plotyy function?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…