Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod R2R with Arduino Uno

Application notes for Pmod R2R and Arduino Uno. In this app, the output voltage will be adjustable according to logic levels.

BeginnerShowcase (no instructions)1 hour547
Using the Pmod R2R with Arduino Uno

Things used in this project

Story

Read more

Schematics

Pmod R2R and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod R2R to the Arduino Uno.

Pmod R2R and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod R2R and Arduino Uno.

Code

Pmod R2R and Arduino Uno Code

Arduino
Using this code will let the output voltage be adjustable according to the logic levels applied to pins 2 to 9 of the Arduino. The output voltage is the sum of all components.
/************************************************************************
*
* Test of the Pmod 
*
*************************************************************************
* Description: Pmod_R2R
* The output voltage is adjustable according to the logic levels
* applied to pins 2 to 9 of the Arduino.
* The output voltage is the sum of all components.
*
* Material
* 1. Arduino Uno
* 2. Pmod R2R 
*
************************************************************************/

void setup()
{
 for (int i=2; i<=9; i++) // configuration ofpins 2 to 9 as output
 {
  pinMode(i,OUTPUT);
 }
}

void loop()
{
 // Input D7 of the module in the high state imposes a component of VCC/2
 digitalWrite(9,HIGH);
 // Input D6 of the module in the high state imposes a component of VCC/4
 digitalWrite(8,LOW);
 // Input D5 of the module in the high state imposes a component of VCC/8
 digitalWrite(7,LOW);
 // Input D4 of the module in the high state imposes a component of VCC/16
 digitalWrite(6,LOW);
 // Input D3 of the module in the high state imposes a component of VCC/32
 digitalWrite(5,HIGH);
 // Input D2 of the module in the high state imposes a component of VCC/64
 digitalWrite(4,HIGH);
 // Input D1 of the module in the high state imposes a component of VCC/128
 digitalWrite(3,HIGH);
 // Input D0 of the module in the high state imposes a component of VCC/256
 digitalWrite(2,HIGH);
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 12 followers
Alex Wong

Alex Wong

5 projects • 26 followers
I work in Digilent and like creating projects
Thanks to Lextronics.

Comments