Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / "New network interface detected..." on: February 05, 2011, 10:49:12 am
I have been messing with everything under the sun trying to get my GPS to work.  In the process I did something that makes this pop up every single time I plug in my Arduino.  



I also have to select the port every time I want to do serial monitor or load to the board.  Any ideas?  



Thanks guys
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: Multiple Analog Sensors on: May 29, 2010, 09:18:51 am
Sorry, I don't have any other place to host the picture.  My problem is this area of the code.
Code:
else if((analogRead(s01) > 250) && (analogRead(s02) > 250))
    {
       changeValue(3);
    }
    else if((analogRead(s01) > 250) && (analogRead(s03) > 250))
    {
       changeValue(5);
    }
    else if((analogRead(s02) > 250) && (analogRead(s03) > 250))
    {
       changeValue(6);
    }
For some reason this section is not working.  I know from looking at the serial monitor that both of the sensors are reading above 250, but only the if statements above these section are being used.  
3  Forum 2005-2010 (read only) / Syntax & Programs / Multiple Analog Sensors on: May 28, 2010, 09:52:39 pm
Hi guys, this is going to be my first post and hopefully I can explain this where everyone can understand my noobiness smiley.

So, I am building a pretty big circuit that has 40 leds and 20 IR sensors.  I have been prototyping using just 3 sensors with 6 leds.  Right now, I can get the circuit to act how it is supposed to when an object passes in front of one of the sensors.  When an object is detected, the Arduino talks to a shift register and sets the pin high this is associated the sensor.  Each sensor is associated with 2 leds, one controlled by a standard inverter connected to a BJT that switches one of the leds.  When nothing is in front of the sensor, the inverter causes the white led to illuminate, and when something is present, the shift register causes the inverter to go high (causing the BJT to switch) and the register switches another BJT to illuminate the other led.  Before I confuse you much more, here is a drawing of what I am doing.


My problem is I can get this circuit to work if I trip only one sensor at a time.  But, it should be able to handle multiple sensors at the same time.  

Here is my code.  Please don't laugh.......
Code:
int sV01 = 0;  //Sensor 1 Analog Value
int sV02 = 0;  //Sensor 2 Analog Value
int sV03 = 0;  //Sensor 3 Analog Value
int bitToSet;
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 12;
//Pin connected to Data in (DS) of 74HC595
const int dataPin = 11;
//Pin for Sensor01
const int s01 = 1;
//Pin for Sensor02
const int s02 = 2;
//Pin for Sensor03
const int s03 = 3;
//Pin for Master Resest (Active Low)
const int mRPin = 10;

int sValue;

void setup()
{
    Serial.begin(9600);  //Begin serial communcation );
    //Set pins to output because they are addressed in the main loop
    pinMode(latchPin, OUTPUT);
    pinMode(dataPin, OUTPUT);  
    pinMode(clockPin, OUTPUT);
    pinMode(mRPin, OUTPUT);
    Serial.begin(9600);
    Serial.println("reset");
}
 
void loop()
{
    digitalWrite(mRPin, HIGH);
    for(int i = 0; i < 3; i++)
    {
      Serial.print("__");
      Serial.print(analogRead(i)); //Write the value of the photoresistor to the serial monitor.
      Serial.print("__");
    }
    Serial.println("\r");
    
    if(analogRead(s01) > 250)
    {
       changeValue(1);
    }
    else if(analogRead(s02) > 250)
    {
       changeValue(2);
    }
    else if(analogRead(s03) > 250)
    {
       changeValue(4);
    }
    else if((analogRead(s01) > 250) && (analogRead(s02) > 250))
    {
       changeValue(3);
    }
    else if((analogRead(s01) > 250) && (analogRead(s03) > 250))
    {
       changeValue(5);
    }
    else if((analogRead(s02) > 250) && (analogRead(s03) > 250))
    {
       changeValue(6);
    }
    else
    {
        changeValue(0);
    }
    //digitalWrite(mRPin, LOW);
}

// This method sends bits to the shift register:
void changeValue(int nTd) {

  // turn off the output so the pins don't light up
  // while you're shifting bits:
  digitalWrite(latchPin, LOW);

  // shift the bits out:
  shiftOut(dataPin, clockPin, MSBFIRST, nTd);

    // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
}

Any help is much appreciated, and if anyone has suggestions for not only the code, but the circuit itself, I would love to hear them.
4  Forum 2005-2010 (read only) / Workshops / Re: Arduino workshops in Houston! on: May 28, 2010, 08:14:04 pm
Seems like there hasn't been much action here.  I am in the Houston area and would love the chance to meet up and learn from one another.  I am not looking for a organized group that requires monetary compensation for their time.  So, if you want to possibly meet up and bounce ideas off one another let me know.
5  Forum 2005-2010 (read only) / Frequently-Asked Questions / Design Software... on: May 28, 2010, 08:17:02 pm
I am sure this question has been beat to death, but I really need some input as to where to look for decent (FREE) design software for Mac.  I already downloaded Eagle, but I was hoping something was out there that was more like MultiSim.  Any ideas????
Thank you.
Pages: [1]