Show Posts
Pages: [1] 2 3
1  Using Arduino / Installation & Troubleshooting / Leonardo will not communicate with my computer. on: February 10, 2014, 01:30:35 am
I have a total of 8 hrs on this issue, scouring the web looking for a solution. the first day of using this computer I was successful in communicating with the Leonardo.  Then I let the computer do a few updates and it has not worked again smiley-mad. I have tried to install new drivers and have failed. Windows 7 wants to do everything automatically. the virtual comm port driver seams to be the culprit? does anyone have a detailed solution for this. I see  a lot of people having the same problems with the Leonardo and not a lot of solutions. The computer will not offer a comm port to talk with ?  it says it could not find a driver for it. I just down loaded 1.0.5. I am assuming that this version would have the driver. I used numerous other versions and flashed the reset still no success.

Thanks in advance.
2  Using Arduino / Programming Questions / Re: How do I use a switch with a 30 second delay on: January 22, 2014, 08:11:32 pm
you can still delay the action. do not use delay to do it. use millis(). by using delay it stops the program for 30 seconds. millis() will allow the program to keep running.
3  Using Arduino / Programming Questions / Re: I have some syntax and parameters questions for a particular IR library. on: January 22, 2014, 08:03:50 pm
Paul when I strike the serial print line out my sketch it compiles fine. It shows the I have a lot of room left. ( Binary sketch size: 10,444 bytes (of a 258,048 byte maximum)) I am not understanding. your post. Am I generating a number too large in the serial print statement?
4  Using Arduino / Programming Questions / Re: I have some syntax and parameters questions for a particular IR library. on: January 21, 2014, 08:01:00 pm
One more reminder. When you use the IR library. when using the newer IDE you have to find the IRremoteInt file in the library folder and change the include statement. The  #include <wprogram> needs to be changed to #include <Arduino.h>. Your sketch will not compile if you do not do this.
5  Using Arduino / Programming Questions / Re: I have some syntax and parameters questions for a particular IR library. on: January 21, 2014, 07:39:56 pm
Sorry I did not explain, but the entire code is in the original post above. Here it is again. but remember if you try it, remember I am not using the standard Ir library. I do have a link to that library here. http://github.com/shirriff/Arduino-IRremote/tree/dev .


Code:
#include <IRremote.h>

int RECV_PIN_11 = 11;        //individual receivers
int RECV_PIN_10= 10;         //individual receivers
int RECV_PIN_9 = 9;          //individual receivers
int RECV_PIN_8 = 8;          //individual receivers

int RELAY_PIN_11 = 13;        //red led
int RELAY_PIN_10 = 12;        //yellow led
int RELAY_PIN_9 = 15;         //green led future
int RELAY_PIN_8 = 16;         //blue led future

IRrecv irrecv_11(RECV_PIN_11);      //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_11;

IRrecv irrecv_10(RECV_PIN_10);  //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_10;

IRrecv irrecv_9(RECV_PIN_9);    //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_9;

IRrecv irrecv_8(RECV_PIN_8);    //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_8;


void setup()
{
 
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT); 
   
   
    Serial.begin(9600);
 
  irrecv_11.enableIRIn(); // Start the receiver
  irrecv_10.enableIRIn(); // Start the receiver
  irrecv_9.enableIRIn(); // Start the receiver
  irrecv_8.enableIRIn(); // Start the receiver
}

int on_11 = 0;
int on_10 = 0;
unsigned long last = millis();

void loop() {
  if (irrecv_11.decode(&results_11)) { //if loop controls action of input on pin 11
    // If it's been at least 1/4 second since the last
    // IR received, toggle the relay
    if (millis() - last > 250) {
      on_11 = !on_11;
     
      digitalWrite(13, on_11 ? HIGH : LOW);
      //Serial.print(results_11->value, HEX)
    }
    last = millis();     
    irrecv_11.resume(); // Receive the next value
  }
   if (irrecv_8.decode(&results_8)) { //if loop controls action of input on pin 8
         Serial.print (results_8.value)
    // If it's been at least 1/4 second since the last
    // IR received, toggle the relay
    if (millis() - last > 250) {
      on_10 = !on_10;
     
      digitalWrite(12, on_10 ? HIGH : LOW);
     
    }
    last = millis();     
    irrecv_8.resume(); // Receive the next value
  }
}
6  Using Arduino / Programming Questions / Re: I have some syntax and parameters questions for a particular IR library. on: January 21, 2014, 03:16:41 pm
Thanks Paul,

I have tried that and have shared below how I wrote it. I believe that I am  doing something wrong with the struct. In the original code there was only one struct and I added three more. Does it make a difference if they are global? I have also included that code below. Here is the error. 'print(long long unsigned int&)' is ambiguous
 
Code:
  if (irrecv_8.decode(&results_8)) { //if loop controls action of input on pin 8
         Serial.print (results_8.value)

Code:
IRrecv irrecv_8(RECV_PIN_8);    //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_8;
7  Using Arduino / Programming Questions / I have some syntax and parameters questions for a particular IR library. on: January 20, 2014, 08:53:58 pm
I have been playing with the IR library and it was simple until I started to use it out side what it was designed for, go figure.  I am attempting to use more than one receive pin and collect different code from each receive pin. I started with the library on this site and found that Ken Shirriff has already made changes to his library to use multiple receivers. I have deleted the old library and installed the new ir library from github. and then worked through the compiling errors with the help of nice people on this forum. Now I am still stuck and would like help with the actual ir functions and there syntax so I can understand it enough to modify. I have included the link for everyone to find the library I am working with. I have also included the example sketch that ken wrote and included in his library. The reference here in this Forum is great but when you get to the libraries new functions it can get overwhelming for a fairly new programmer. At the bottom I have inserted the code that does receive from two different receivers and lights up the LEDs. now I need to return the results from each receive pin. and do something with each value.
Thanks in advance and sorry for such along post, but I believe this will help many other rookies that will try this in the future.

Questions:

1) (irrecv.decode(&results))   results should have a value that i can return and do something with can someone break this down for me.
2) decode_results results;      is this the same type of function without the parentheses around the results?
3) //Serial.print(results_8, HEX) is in the bottom code what am I doing wrong.

http://github.com/shirriff/Arduino-IRremote/tree/dev

Quote
/*
 * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
 * An IR detector/demodulator must be connected to the input RECV_PIN.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * http://arcfn.com
 */

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}


current code that I have been working on.[/size][/size]



Code:
#include <IRremote.h>

int RECV_PIN_11 = 11;        //individual receivers
int RECV_PIN_10= 10;         //individual receivers
int RECV_PIN_9 = 9;          //individual receivers
int RECV_PIN_8 = 8;          //individual receivers

int RELAY_PIN_11 = 13;        //red led
int RELAY_PIN_10 = 12;        //yellow led
int RELAY_PIN_9 = 15;         //green led future
int RELAY_PIN_8 = 16;         //blue led future

IRrecv irrecv_11(RECV_PIN_11);      //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_11;

IRrecv irrecv_10(RECV_PIN_10);  //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_10;

IRrecv irrecv_9(RECV_PIN_9);    //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_9;

IRrecv irrecv_8(RECV_PIN_8);    //TSOP4838 Connected one at a time so there is no crosstalk
decode_results results_8;


void setup()
{
 
  pinMode(13, OUTPUT);
 
  pinMode(12, OUTPUT); 
   
   
    Serial.begin(9600);
 
  irrecv_11.enableIRIn(); // Start the receiver
  irrecv_10.enableIRIn(); // Start the receiver
  irrecv_9.enableIRIn(); // Start the receiver
  irrecv_8.enableIRIn(); // Start the receiver
}

int on_11 = 0;
int on_10 = 0;
unsigned long last = millis();

void loop() {
  if (irrecv_11.decode(&results_11)) { //if loop controls action of input on pin 11
    // If it's been at least 1/4 second since the last
    // IR received, toggle the relay
    if (millis() - last > 250) {
      on_11 = !on_11;
     
      digitalWrite(13, on_11 ? HIGH : LOW);
      //Serial.print(results_11->value, HEX)
    }
    last = millis();     
    irrecv_11.resume(); // Receive the next value
  }
   if (irrecv_8.decode(&results_8)) { //if loop controls action of input on pin 11
    // If it's been at least 1/4 second since the last
    // IR received, toggle the relay
    if (millis() - last > 250) {
      on_10 = !on_10;
     
      digitalWrite(12, on_10 ? HIGH : LOW);
      //Serial.print(results_8, HEX)
    }
    last = millis();     
    irrecv_8.resume(); // Receive the next value
  }
}
8  Using Arduino / Project Guidance / Re: My robot mapping project, How to get the rotated angle of my drone on: January 18, 2014, 03:14:13 am
Next best thing is a compass sensor (The GY-26 Compass sensor module). I have not used one, but check it out, search the forum there is plenty on the sensor.
9  Using Arduino / Project Guidance / Re: Relay for mini fridge temperature control? on: January 18, 2014, 03:06:33 am
it sounds like you are on the right track. the relay has a 5volt relay and the amp rating sounds good, with maybe one exception which may or may not matter. some fridges have a considerable inrush at start up. you may investigate that. Ebay has relay shields cheep that have 4 relays on them that can be used. 10 Amps per put together there is 40 amps!  I have a link below.
http://www.ebay.com/itm/4-Channel-5V-Relay-Shield-Module-for-Arduino-Uno-2560-1280-ARM-PIC-AVR-STM32-/291040105366?pt=LH_DefaultDomain_0&hash=item43c3579396
10  Using Arduino / Project Guidance / Re: Can I use multiple receivers in the IR library. on: January 18, 2014, 02:53:36 am
I am using a TSOP4838.

Yes it is like a shooting game, but with a twist. there maybe up to 4 shooters and there is where the code comes in. I also will be sending low battery code from the shooting device. So identification and counting hits for each device is crucial. Thanks
11  Using Arduino / Project Guidance / Re: My robot mapping project, How to get the rotated angle of my drone on: January 18, 2014, 12:18:05 am
Have you looked into the gps units. A bit pricey but should give you what you need to map an area.
12  Using Arduino / Project Guidance / Re: Can I use multiple receivers in the IR library. on: January 18, 2014, 12:01:25 am
wow Thank you for that. I have been on his blog several times and I missed that. I will  have to decipher all of what was said and give it a whirl. I have written some code with different receive parameters and moved them around. I was successful in moving the pin but not getting two to work. Thanks again I feel more confident in knowing that it is possible and I  may not come out with a bloody forehead.
13  Using Arduino / Project Guidance / Re: Can I use multiple receivers in the IR library. on: January 17, 2014, 10:47:57 pm
Thanks  Guys for responding. The library I was referring to is the standard IR library from Ken Sheriff. I have already built a prototype with a nano as a firing device and a mega as the receiving Arduino. I am just stumbling on the second receive pin. As jroorda said they use the timer 2, but each timer controls multiple pins and there are 12 PWM available. Why wouldn't it be possible? I did think of using multiple nanos and coupling them together to create a score. but I think it would be tidier if I cold keep it to one mega.
14  Using Arduino / Project Guidance / Can I use multiple receivers in the IR library. on: January 17, 2014, 09:31:59 pm
I have been playing with the IR library and I have a project that is a little out of the ordinary. I can not find a post or article on using multiple receivers on a single Arduino. Why you ask? Well I am trying to use a ir sensor to acknowledge a hit on a target. This is simple for one target, but I would like to have 10 targets. The mega has 12 pwm pins I originally thought this would be easy, but now realize I need some help. I have looked in the library and found what timers control what pins and that I can modify the library to change the timers.... Am I on the right track or is it possible for a rookie programmer as myself. 1) Can anyone let me know if it is possible. 2) does anyone know of an article that would help me out. Thanks in advance!
15  Using Arduino / Installation & Troubleshooting / Having trouble communicating with a mega 328P on: December 30, 2012, 02:25:28 am
I am having trouble using FT232RL Tiny Breakout board.I have used the break out board with some success. Now it will not communicate at all. I see the break out board giving three short burst but no response from the board. I have wrote a few programs and it executed it fine.Now I have changed computers and had issues talking to the R board. I thought it was the usb driver and installed a new driver. after about after two DAYS 100 tries I was able to upload to the Rboard. Now all of sudden it will not work again. PERHAPS AFTER A MICROSOFT UPDATE. I might have a bad programmer, how would I check? When I had success I had installed a driver from the arduino drivers folder. and it asked me to shut my computer down to activate. smiley but now when I install a driver it will not ask me to shut down the computer smiley-sad  . any suggestions.
Pages: [1] 2 3