Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 233
61  Using Arduino / Programming Questions / Re: Liquid Crystal Clashing with Interrupts on: April 08, 2014, 03:08:24 pm
More confusion on the serial front.
You are not using SoftwareSerial in the program you posted you are using the Wire library, but I know what you mean.

I don't understand why Hardware Serial is not interfering with interrupts 2 and 3 on pins 0 and 1 respectively.
62  Using Arduino / Programming Questions / Re: Liquid Crystal Clashing with Interrupts on: April 08, 2014, 02:13:17 pm
There are 2 types of serial communication mixed together in this discussion.

1.  Hardware Serial.  Used by Serial.print(), Serial.read() and other methods of the serial library,  Communication is via pins 0 and 1 on the Arduino.  These pins are also used when uploading a program to the Arduino.

2.  Serial communication using the Wire library.  This uses pins 2 and 3 on the Leonardo and is not used for Serial.print() etc

As you are using a Leonardo that implies to me that if you want to use the Wire library and Hardware Serial you cannot use interrupts 0 to 3 because all 4 interrupt pins are being used for other purposes.  If you can do without Hardware Serial for debugging output or user input then you should be able to use interrupts 2 and 3 as well as interrupt 4 on pin 7.
63  Using Arduino / Project Guidance / Re: code for controlling Encoder Dc Servo on: April 08, 2014, 11:15:56 am
You can use the hardware Tx and Rx pins if you like but they will need to be unplugged in order to upload your program and you will not be able to use Serial.print() to help debugging.

You should consider using SoftwareSerial as then you can define your own Tx and Rx pins within reason.

That said, I still don't understand why you need to use Serial to control the servo.  Can you please give a link to the servo that you are using ?
64  Using Arduino / Programming Questions / Re: Read analog pin on: April 08, 2014, 02:21:21 am
It looks like you have 2 shields stacked on the Arduino.  What happens if you reduce the circuit to just the Arduino board itself ?

Incidentally, if the shields pass the signals straight up through the pins and sockets then the point at which you have indicated you attach to the Arduino is not an analogue pin it is the 5V line and will not vary.
65  Using Arduino / Programming Questions / Re: Liquid Crystal Clashing with Interrupts on: April 08, 2014, 01:38:43 am
Look what else uses pins 0 and 1 though.

Try using pins 2 and 3 to avoid Serial comms interfering with your interrupts.
66  Using Arduino / Programming Questions / Re: Read analog pin on: April 08, 2014, 01:32:49 am
Please post a program and a schematic of your circuit that illustrates the problem.
67  Using Arduino / Programming Questions / Re: Liquid Crystal Clashing with Interrupts on: April 08, 2014, 01:21:34 am
Code:
  attachInterrupt(2, handleEncoderA, CHANGE);
  attachInterrupt(0, handleEncoderB, CHANGE);
What Arduino board are you using ?
68  Using Arduino / Programming Questions / Re: basic c question on: April 08, 2014, 01:15:09 am
Quote
works now
I bet it doesn't
69  Using Arduino / Programming Questions / Re: basic c question on: April 07, 2014, 04:30:03 pm
If you leave the semi-colon there then it becomes the empty body of the if statement effectively disabling the test.
70  Using Arduino / Programming Questions / Re: basic c question on: April 07, 2014, 04:19:00 pm
Code:
     if (strcmp(name, "bruce") != 0 && age != 40);   ///error on strcmp ??
Should that semi-colon be there I wonder ........
71  Using Arduino / Programming Questions / Re: problem with loops and voids and saving outputs in a SD card on: April 07, 2014, 04:12:16 pm
Quote
I am trying to save the values PWM (which active the servo)
What value in your program is that and how often do you want to save it ?
Code:
int inservo = 4 ; // entrada digital desde el servo a arduino/ input from servo to arduino
Unless you have a very special servo there is no output from a servo for the Arduino to read

Quote
an the same way i am trying to save the analog outputs from the potentiometer
I assume that this is the value that you want to save
Code:
    int outservo_val = analogRead(outservo);
But how often do you want to save it ?

It would be a good idea if you could explain exactly what you are trying to do and why.
72  Using Arduino / Programming Questions / Re: Ethernet Shield using Alarms for Garduino on: April 07, 2014, 04:01:49 pm
Code:
Alarm.alarmRepeat(21,26,30, Night);
This calls the Night() function at 21:26:30 each day.  Why then does the Night() function check to see whether the time is something different ?
Code:
     if (nowHour==21&&nowMinutes==59&&nowSeconds==40){
        Water();
        }
73  Using Arduino / Programming Questions / Re: problem with loops and voids and saving outputs in a SD card on: April 07, 2014, 01:29:52 pm
What is the my_loop() function for ?  It is never called.  Why is it there anyway ?
74  Using Arduino / Programming Questions / Re: Ethernet Shield using Alarms for Garduino on: April 07, 2014, 01:24:34 pm
What values do you get for nowHour, nowMinutes and nowSeconds if you print them ?

What calls the Night() function ?

Please post your whole program.
75  Using Arduino / Programming Questions / Re: Changed processor from PIC to Arduino,completely new need help with programming on: April 07, 2014, 12:18:08 pm
What hardware are you using to detect the heartbeats ?
Pages: 1 ... 3 4 [5] 6 7 ... 233