Show Posts
Pages: [1] 2
1  Using Arduino / LEDs and Multiplexing / Re: 3 buttons for 3 LEDS on: May 04, 2014, 10:22:37 am
Hi,
I actually tried changing the pins several time, but i figured heck, i'll give it another try.
5 didn't work either smiley-sad
but i moved things around and managed find enough that do work.
sometimes you just have to try one more time haha.
Thanks a lot of the help!!! smiley-mr-green
2  Using Arduino / Interfacing w/ Software on the Computer / Re: PLX - DAQ with arduino on: May 04, 2014, 10:20:19 am
Thanks a lot!
I will try this when I get home tonight  smiley-cool
3  Using Arduino / Interfacing w/ Software on the Computer / PLX - DAQ with arduino on: May 03, 2014, 04:12:55 pm
Hi all,
I recently posted looking for a way to plot data from my arduino serial port and was recommend using PLX as I prefer excel or matlab to be used when plotting.

I have looked around quite a bit, the only examples that I can find on how to use the PLX is in Portuguese...
Can anyone help me post simple data so i'll figure it out and continue on my own or direct me to somewhere I can find help in English.
Thanks in advance
 
4  Using Arduino / LEDs and Multiplexing / Re: 3 buttons for 3 LEDS on: April 28, 2014, 05:22:17 pm
Hi Paul,
yes, i do have a pulldown resistor on each one of my inputs
Thanks
5  Using Arduino / Interfacing w/ Software on the Computer / Re: Plotting Data on: April 27, 2014, 04:01:02 pm
awesome i'll go give it a try smiley
I didn't see they have any examples there (i'll google some)
Thanks!
6  Using Arduino / Interfacing w/ Software on the Computer / Plotting Data on: April 27, 2014, 11:39:00 am
Hi all,
I am doing a project where I want to plot several things, I hope that once I get the hang of how to plot something simple i'll be able to plot something more complicated.

I have a program that is supposed to get an input from a user (click a button) . When the user clicks again I track how long it took between those 2 events. the numbers can range between 1 second to several hours (if less than a minute or so I would like to ignore it, I don't need to have seconds precision, minutes is fine)
I present that number onto the serial monitor.
I want to pass this to processing or excel or matlab to graph (prefer excel and then matlab and then processing).

I saw that there is gobetwino but I couldn't get that to work.
I couldn't find a simple example that would use processing to do this, and while I saw that matlab has several options i couldn't get the examples I found to work.

Anyone have advice? simple code/tutorial to graph from Serial?

Thanks in advance
7  Using Arduino / LEDs and Multiplexing / 3 buttons for 3 LEDS - SOLVED on: April 27, 2014, 11:28:44 am
Hi All,
I am writing a simple program that is supposed to have 3 buttons control 3 LEDS when the button is double clicked.

The code itself works fine for a single button + LED and for 2 buttons + 2 LEDS. When I put the 3rd one in it won't work.
I believe it has something to do with the UNO HW restricting me but I could not find anything online to suggest so.

If I switch the button pins (use 2,3,4 or 4,5,6 etc) I can only get 2 LEDS to work. I can swap the cable from the pin to the button (swap between 2 and 4 for example assuming 2 works and 4 doesn't)  - now the circuit that was connected to 4 (and didn't work)  is connected to 2 and works (and vise versa) suggesting it is not my wiring or circuit.

I am using pins (2,3,4) for button and (7,8,9) for LED but used all sorts of comps.
When I use this setup Pin 4 doesn't work.
Code below
Thanks!

Code:

//button declerations  
const int buttonGRN = 2;
const int buttonRED = 3;
const int buttonGRN1 =4;

// led decleratons
int lightOutputGRN = 7;
int lightOutputRED = 8;
int lightOutputGRN1 = 9;

int bounceTime = 50;
int doubleTime = 500;

int lastReadingGRN = LOW;
int lastReadingRED = LOW;
int lastReadingGRN1 = LOW;

long onTimeGRN = 0;
long onTimeRED= 0;
long onTimeGRN1= 0;

long lastSwitchTime = 0;
long lastSwitchTimeRED = 0;
long lastSwitchTimeGRN1 = 0;


void setup()
{
  pinMode(buttonGRN, INPUT);
  pinMode(lightOutputGRN, OUTPUT);
  
  pinMode(buttonRED, INPUT);
  pinMode(lightOutputRED, OUTPUT);
  
  pinMode(buttonGRN1, INPUT);
  pinMode(lightOutputGRN1, OUTPUT);
  
  Serial.begin(9600); // to communicate with serial
}

void loop()
{
          int readingGRN1 = digitalRead(buttonGRN1);

  //first pressed
  if (readingGRN1 == HIGH && lastReadingGRN1 == LOW)
  {
    onTimeGRN1 = millis();
 }
 
//released
  if (readingGRN1 == LOW && lastReadingGRN1 == HIGH)
  {
    if (((millis() - onTimeGRN1) > bounceTime))
    {
     onReleaseGRN1();
    }
 
  }
  lastReadingGRN1 = readingGRN1;
  
  int readingGRN = digitalRead(buttonGRN);

//first pressed
  if (readingGRN == HIGH && lastReadingGRN == LOW)
  {
    onTimeGRN = millis();
  }

//released
  if (readingGRN == LOW && lastReadingGRN == HIGH)
  {
    if (((millis() - onTimeGRN) > bounceTime))
    {
      onReleaseGRN();
    }
  }
  lastReadingGRN = readingGRN;

  int readingRED = digitalRead(buttonRED);

//first pressed
  if (readingRED == HIGH && lastReadingRED == LOW)
  {
    onTimeRED = millis();
  }

//released
  if (readingRED == LOW && lastReadingRED == HIGH)
  {
    if (((millis() - onTimeRED) > bounceTime))
    {
     onReleaseRED();
    }
 
  }
  lastReadingRED = readingRED;
} //end loop

void onReleaseGRN()
{

  if ((millis() - lastSwitchTime) >= doubleTime)
  {
    lastSwitchTime = millis();
    return;
  }  

  if ((millis() - lastSwitchTime) < doubleTime)
  {
    lastSwitchTime = millis();
  
          //light up led for 3 sec then turn off
         digitalWrite(lightOutputGRN, HIGH);
         delay(3000);
         digitalWrite(lightOutputGRN, LOW);
  }  

}

void onReleaseRED()
{

  if ((millis() - lastSwitchTimeRED) >= doubleTime)
  {
    lastSwitchTimeRED = millis();
    return;
  }  

  if ((millis() - lastSwitchTimeRED) < doubleTime)
  {
    lastSwitchTimeRED = millis();
 
         //light up led for 3 sec then turn off
         digitalWrite(lightOutputRED, HIGH);
         delay(3000);
         digitalWrite(lightOutputRED, LOW);
  }  

}


void onReleaseGRN1()
{

  if ((millis() - lastSwitchTimeGRN1) >= doubleTime)
  {
    lastSwitchTimeGRN1 = millis();
    return;
  }  

  if ((millis() - lastSwitchTimeGRN1) < doubleTime)
  {
         //light up led for 3 sec then turn off
         digitalWrite(lightOutputGRN1, HIGH);
         delay(3000);
         digitalWrite(lightOutputGRN1, LOW);
    
  }  
}




[EDIT]
I forgot to mention I also did the following test:

I added one line of code (see below for exact location in code)
        Serial.println(lastReadingGRN);
and did he same for GRN1 (the problematic LED)

When I do that for GRN - the serial monitor shows a lot of 0-s, then I click (once) and it changes to 1-s and then 0-s again after I release.
when I do this for GRN1 - serial shows 0-s, then I click once and is shows 1-s, but does not show 0-s again when I release.
Any ideas as to why it doesn't set the value back to LOW?

Code:
//released
  if (readingGRN == LOW && lastReadingGRN == HIGH)
  {
    if (((millis() - onTimeGRN) > bounceTime))
    {
      onReleaseGRN();
    }
  }
  lastReadingGRN = readingGRN;
        Serial.println(lastReadingGRN);


Thanks!
[/EDIT]
8  Using Arduino / Interfacing w/ Software on the Computer / Re: wrong mac address received from arduino on: May 18, 2013, 10:18:10 am
all it was, was a missing 0.
Thanks a lot!!!
9  Using Arduino / Interfacing w/ Software on the Computer / wrong mac address received from arduino on: May 18, 2013, 09:27:02 am
Hi all,
I am trying to get my Arduino's mac address so that i could give it a static IP.
I used a very simple code taken from the arduino website (can be found at the end of the post)
I seem to be getting a mac address like this:

X1:Y2:Z:Z4:U5:O3

these arn't the real letters, but the point is that the 3rd byte keeps giving my just a one letter and nothing else, and this is not a valid mac address.
i tried to play around and only display that byte and other such games, but they all were not successful.
Anyone have any idea on how I can manage to get the full mac address?
Thanks!

Code used (of course i change the ssid[] and added pass etc):

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "yourNetwork";     // the name of your network
int status = WL_IDLE_STATUS;     // the Wifi radio's status

byte mac[6];                     // the MAC address of your Wifi shield


void setup()
{
 Serial.begin(9600);

 status = WiFi.begin(ssid);

 if ( status != WL_CONNECTED) {
    Serial.println("Couldn't get a wifi connection");
    while(true);
  }
  // if you are connected, print your MAC address:
  else {
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  Serial.print(mac[5],HEX);
  Serial.print(":");
  Serial.print(mac[4],HEX);
  Serial.print(":");
  Serial.print(mac[3],HEX);
  Serial.print(":");
  Serial.print(mac[2],HEX);
  Serial.print(":");
  Serial.print(mac[1],HEX);
  Serial.print(":");
  Serial.println(mac[0],HEX);
  }
}

void loop () {}
10  General Category / General Discussion / Re: Relay curcuit not switching on on: December 26, 2012, 11:36:39 am
WOW! Finally (1/2 of it works)

Solid state circuit - you were right, I had the green and red wires going to the + and - wrong. switched it and now the led finally turns on, and the lamp works on my command!!

the n2222 circuit still doesn't work. I haven't changed anything. I hear it clicking when the relay turns on and off. I checked resistance on all the top 3 pin pairs of the relay (when the circuit is not connected to anything) and they were all infinite.

also measured the diode, the side that does not have the line and the other measuring pin at 0 volt.
Measured voltage.
At the moment the relay should be off, you should measure close to 5 volts there. - I measured close to zero.
At the moment the relay should be on, you should measure 0.6 volts. - I measured close to 5V

I verified again, the actual circuit up to the blue relay are the same in both circuits

Thanks again for your help, hopefully we can figure this one out as well...
11  General Category / General Discussion / Re: Relay curcuit not switching on on: December 25, 2012, 12:22:30 am
last one...
12  General Category / General Discussion / Re: Relay curcuit not switching on on: December 25, 2012, 12:14:03 am
and the other 2 images....  smiley-roll
13  General Category / General Discussion / Re: Relay curcuit not switching on on: December 24, 2012, 04:31:27 pm
@ MAS 3
I have 2 setups, with 2 different relays.
As of now I took the cord which runs on the relay off, but of course when i was testing it was connected.

3 images are attached:
     1 (blue relay) is simpler and connected to a breadboard (soldered)
     1 (relay not seen) is the same and connects to the relay in image 3. This does not use a breadboard as i thought i might have had an issue with the soldering (I don't)
     1 image of the 2nd relay - gray relay

@Grumpy_Mike

What I mean the circuit is working is that until the relay (if you look at the gray relay picture i am referring to the point where the wires connect to it in the image), I can control the 5V or 0V making its way there on command.
Thanks
14  General Category / General Discussion / Re: Relay curcuit not switching on on: December 23, 2012, 11:02:22 am
I apologize as I think I have not explained it clearly.

The lamp is off constantly.
the whole circuit, up to the part where the relay connects (the 2 relay pins that are parallel to the diode in the site i posted in my first post) get 5V or 0 on my command (using the arduino lol)

so what i was trying to explain is that my circuit works fine, but for some reason the relay does not turn on and off, it is off constantly...

thanks again for the help
15  General Category / General Discussion / Re: Relay curcuit not switching on on: December 22, 2012, 04:41:20 pm
The relay does NOT turn on (opposite to what you wrote that it stays on constantly)

I cannot hear the relay go on and off.
Pages: [1] 2