Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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

You have to use ADC and Serial library.
 

Re: arduino uno_ two adc

can u give me some example about how to multiplex ADC in 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);
}



101987d1391965304-adcuart.png


101988d1391965870-adcuart1.png
 

Attachments

  • UNO.rar
    203.2 KB · Views: 85
  • adcUart.png
    adcUart.png
    38.6 KB · Views: 115
  • adcUart1.png
    adcUart1.png
    40.1 KB · Views: 115
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?
 

Re: arduino uno_ two adc

Hi

I can't help you with Matlab.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top