Show Posts
Pages: [1]
1  Products / Arduino Due / Re: Reading analogical input and output it as analogical on: November 08, 2013, 06:12:45 pm
I discovered why, it doesn´t work ; the board is burned...
2  Products / Arduino Due / Re: Analog-to-digital converter in Due on: November 07, 2013, 03:20:56 pm
I've already experimented it.  I supose the ADC is not fast enough to do it because  it´s a hardware problem. In order to solve it you problaby should select a faster microcontroler family. 
3  Products / Arduino Due / Re: Reading analogical input and output it as analogical on: November 07, 2013, 12:13:30 pm
First of all I use a delay because the writers of books use.
Second, If I inject 0.5V at A0 (r1) input, I expect to have at r2=0.5*2.5 = 1.25 so DAC0 would be 2.2*1.25/3.3+0.55 = 1.38V and it doesn´t happen!
 
4  Products / Arduino Due / Re: Reading analogical input and output it as analogical on: November 06, 2013, 07:49:18 pm
I tried to send the sketch but I failed so I wrote the sketch I made:

float r1,r2;
void setup( )
{
analogReadResolution(12);
analogWriteResolution(12).
}
void loop ( )
{
r1 = analogiRead(0);
r2= 2.5*r1;
analogWrite (DAC0,r2);
delay(300);
}
5  Products / Arduino Due / Reading analogical input and output it as analogical on: November 06, 2013, 07:33:44 pm
I am trying to read an analogical input at A0, multiplying it for 2.5 and output it at DAC0, but the program doesn´t work, can someone help me, please?
6  Products / Arduino Due / Re: PID library on: June 29, 2013, 05:39:21 pm
My friend, I saw the PID Library but in my opinion it has poor resources.  If you wanted to make a diferent transference function, you could not.   The steps are as I have already described.
7  Products / Arduino Due / Re: PID library on: June 26, 2013, 10:22:32 am
My friend I am projecting a digital controler with Arduino.   It will be a PI contoler.  I will emulate an analogical controler.   As a matter of fact I didn't know there would be a PID library for the Arduino.  What I am doing is to convert a Laplace Transform transference function to a Z transference function and after that to a difference equation.  So with that I can programme Arduino.  If there is a shorter step, please anwer me. Thank you.
8  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: March 04, 2013, 09:52:13 pm
In fact I made a mistake when I wrote, the output of the DAC will be among 0.55V and 2.75V.
9  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: March 01, 2013, 08:01:17 pm
       I wanted to know exactly the relation among the ADC (input) and the output (DAC) so I modify the sketch and multiply by 1.000.   This way with 0V at the input, it outputs to 0.55V (1/6) of 3.3V; 3.3V in the input, it outputs with 2.75V (5/6) of 3.3V.    So if the input is among 0 to 3.3V the output is among 0 to 2.75V linearly.   I think if someone wants a relation 1 to 1, between the input and the output, he needs to use operational amplifiers.  It follows my sketch.

Code:
/*
Read the value of the potentiometer (1.000V) at A0 and multiply
for 1.652 and output it at DAC1 both with 12 bits resolution
*/
float val = 0; // variable to store the value coming from A0
float val2 = 0;
int analogInPin = 0; // Analog input pin connected to the variable resistor
void setup()
{
analogReadResolution(12);
analogWriteResolution(12);
}
void loop() {
 
 val = analogRead(analogInPin); // read the voltage on the pot
val2=val*1.000;
analogWrite(DAC0,val2);
delay(5);
}
10  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: February 24, 2013, 05:27:04 pm
    The problem is: I have is to emulate an analogical function control with amplifications, derivators, integrators, etc  So I need to perform mathemathicals operations, that is why I use float in my sketch.   I do believe that the DACs are linear between 0 to 3.3VDC i.e. the first grade 0 the next 0.00081VDC and so on.  That´s why I'm using the Due. I think my multimeter is not exact enough to mesure that.   Could someone elucidate that? 
11  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: February 22, 2013, 09:19:38 pm
You don1t have to use map.   As you can see in the code.   Thank´s.
12  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: February 19, 2013, 08:38:14 pm
I'll write again the code. It's just necessary to write this


Quote
/*
Read the value of the potentiometer (1.000V) at A0 and multiply
for 1.652 and output it at DAC1 both with 12 bits resolution
*/
float val = 0; // variable to store the value coming from A0
float val2 = 0;
int analogInPin = 0; // Analog input pin connected to the variable resistor
void setup()
{
analogReadResolution(12);
analogWriteResolution(12);
}
void loop() {
 
 val = analogRead(analogInPin); // read the voltage on the pot
val2=val*1.625;
analogWrite(DAC0,val2);
delay(5);
}
13  Products / Arduino Due / Re: Problems reading an analog input and output with 12 bits resolution on: February 19, 2013, 08:33:14 pm
It´s just necessary to write the followig code
[quote/*
Read the value of the potentiometer (1.000V) at A0 and multiply
for 1.652 and output it at DAC1 both with 12 bits resolution
*/
float val = 0; // variable to store the value coming from A0
float val2 = 0;
int analogInPin = 0; // Analog input pin connected to the variable resistor
void setup()
{
analogReadResolution(12);
analogWriteResolution(12);
}
void loop() {
 
 val = analogRead(analogInPin); // read the voltage on the pot
val2=val*1.625;
analogWrite(DAC0,val2);
delay(5);
}][/quote]
14  Products / Arduino Due / Problems reading an analog input and output with 12 bits resolution on: February 16, 2013, 06:01:51 pm
      I´m trying to read 1.000 V at A0 (analog input) wjth 12 bits resolution, multiply by a factor of 1.625 and output it at DAC1 but it doesn't work. The sketch follows, please help me. Thanks a lot.
Code:
/*
Read the value of the potentiometer (1.000V) at A0 and multiply
for 1.625 and output it at DAC1 both with 12 bits resolution
*/
float val = 0; // variable to store the value coming from A0
float val2 = 0;
float outputValue =0;
int ananalogInPin = 0; // Analog input pin connected to the variable resistor
void setup()
{
// nothing in setup
}
void loop() {
 
 val = analogRead(analogInPin); // read the voltage on the pot
analogReadResolution(12);
val2=val*1.625;
analogWriteResolution(12);
outputValue = map(val2,0,1023,0,4095);
  analogWrite(1,outputValue); //write at DAC1
}
15  Using Arduino / Programming Questions / Read an analog input multiply for 1.625 and output in the DAC1 with the Due on: February 14, 2013, 07:31:02 pm
     Excuse-me it is the first time I post in the Forum. I'm using the Arduino Due and trying to read 1.000 VCC in the analog input (A0) with resolution of 12 bits and multiply with the factor 1.652 and output it in the DAC1 with 12 bits. The sketch follows but I tried many times and haven't achieved to write here in the standart form.   

Code:
[//Read the value of a potentiometer and multiply for 1.625
// and output it in the DAC1

float val = 0; // variable to store the value coming from the sensor
float val2 = 0;
float outputValue =0;
const int analogInPin = 0; // Analog input pin connected to the variable resistor
void setup()
{
// nothing in setup
}
void loop() {
 
 val = analogRead(analogInPin); // read the voltage on the pot at A0
analogReadResolution(12);
val2=val*1.625;
analogWriteResolution(12);
outputValue = map(val2,0,1023,0,4095);
  analogWrite(1,outputValue);// write the analog output ADC1
}code]
Pages: [1]