Pages: [1]   Go Down
Author Topic: Arduino Uno -> Arduino Mega  (Read 1660 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am currently working on a project and noticed I may need to upgrade from Arduino Uno to Mega. If I am sending signals from my computer using uno with xbee controller, will the mega with the xbee receive all the information transmitted? Or will I need to get two mega's so one sends the signal while the other one receives it.

Thanks!  smiley

Also I am still a bit confused with the pins on the arduino uno. What is the difference between digital and analog pins?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34579
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Anything you can do on a Uno, you can do on a Mega.

Quote
What is the difference between digital and analog pins?
Well analogue pins allow you to read analogue values, that is continuously varying voltages. Digital pins allow you to read only logic levels or output logic levels.
Analogue pins can also be used as digital pins with the correct software.
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

With respect, Mike, in case anyone out there reads the wrong things into....

Quote
Analogue pins can also be used as digital pins with the correct software.

You don't need any "new" or "extra" software to use the analog pins as digital pins. You use the "ordinary" Arduino development environment. You just have to write your software, your program ("sketch") the right way.

The "analog pins", to a beginner, are pins that you can connect things to, things which will have a voltage between 0 and 3.3v is you have a 3.3v Arduino, 0 and 5v for the rest of us. And then, in your program, you do something like....

iTmp=analogRead(0);

... and that puts a number from 0-1023 (inclusive) into iTmp, depending on the voltage in the wire connected to the first analog input.

HOWEVER... you can also (but not at the same time as you are using A0- A5!) "pretend" that you have 6 extra digital input/ output pins called D14-D19. They work just like D0-D13.

So, if you attached an LED (and resistor) to the pin for analog 0, and connected them to ground, and did....

void setup() {               
  pinMode(14, OUTPUT);     
}

void loop() {
  digitalWrite(14, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(14, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

... then the LED would wink.

(It's not "all or nothing". You can mix and match. You could do the above and STILL use, say, analog 1 as an analog input.)
Logged

Pages: [1]   Go Up
Jump to: