Show Posts
Pages: [1] 2 3 ... 20
1  Products / Arduino Yún / Re: interupt causes hang on: March 03, 2014, 01:53:47 pm
it doesnt work at 1000 either.  I changed it to 10 to see if the interrupt was to long...

2  Products / Arduino Yún / Re: interupt causes hang on: March 03, 2014, 03:36:38 am
Just tested the old version and it works on the Yun.

Code:
// reading liquid flow rate using Seeeduino and Water Flow Sensor from Seeedstudio.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn @thebestcasescenario.com
// http:/themakersworkbench.com http://thebestcasescenario.com http://seeedstudio.com

volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                               
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}
// The setup() method runs once, when the sketch starts
void setup() //
{
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  Serial.begin(9600); //This is the setup function where the serial port is initialised,
  attachInterrupt(0, rpm, RISING); //and the interrupt is attached
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop ()   
{
  NbTopsFan = 0; //Set NbTops to 0 ready for calculations
  sei(); //Enables interrupts
  delay (1000); //Wait 1 second
  cli(); //Disable interrupts
  Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour
  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
}
3  Products / Arduino Yún / Re: interupt causes hang on: March 03, 2014, 03:29:55 am
@mike lol I was going to say that but you out grumpied me smiley-wink

@Riva maybe; but this sketch works without the yun specific stuff on a Duo.  Ill test the old non IoT version of the sketch on the Yun and see if it hangs as well.
4  Products / Arduino Yún / Re: interupt causes hang on: March 03, 2014, 03:12:50 am
was testing if the interrupt being shorter would help.  I did adjust my math in the Calc variable. smiley-wink

in any case a bad comment isn't causing the hang.  I did edit the comment though. 

5  Products / Arduino Yún / interupt causes hang on: March 03, 2014, 02:38:15 am
Im using a Yun.  
If I run the following code it doesnt post to my php file.  The serial console doesnt open "error opening serial port"
I can upload a new/changed sketch though so It doesnt seem to be hanging the device completely.

If I remove the sei() and cli() the sketch runs and i can view serial console.  Obviously my data isnt correct as Im not ever polling the hall effect sensor.

Any idea why this causes a hang?

Code:
#include <Bridge.h>
#include <HttpClient.h>
volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                              
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}
void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Bridge.begin();
  Serial.begin(9600);
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  attachInterrupt(0, rpm, RISING); //and the interrupt is attached
}

void loop() {
  NbTopsFan = 0; //Set NbTops to 0 ready for calculations
  sei(); //Enables interrupts
  delay (10); //Wait (a really small amount of time)
  cli(); //Disable interrupts
  Calc = (NbTopsFan * 6000 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour
  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
  HttpClient client;
  String url = "http://10.10.0.50/catchyun.php?waterflow=value";
  url += String(Calc);
  client.get(url);

  Serial.flush();

  delay(5000);
}
6  Using Arduino / Programming Questions / Re: Yun client.get with variable on: March 02, 2014, 07:58:06 pm
hmmm nevermind.  Seems to work.

Yun seems to sometimes be really slow to start the sketch after an upload.  Took 3 or 4 minutes before it started posting.

so me not being patient I never saw it post before changing the sketch and reuploading trying to get it to work. 

Been screwing with me since last night.  Just got my Yun.  Finally wifi and lan with my arduino!!
7  Using Arduino / Programming Questions / Yun client.get with variable on: March 02, 2014, 07:40:36 pm
should be an easy one but Im not getting it. How do I use a variable in the client.get?

Doesn't work:
Code:
String url = "http://10.10.0.50/catchyun.php?waterflow=55454";
  client.get(url);

Works:
Code:
client.get("http://10.10.0.50/catchyun.php?waterflow=55454");


full code
Code:
#include <Bridge.h>
#include <HttpClient.h>
volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                               
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the hall effect sensors signal
}
void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Bridge.begin();
  Serial.begin(9600);
  while(!Serial);
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
 attachInterrupt(0, rpm, RISING); //and the interrupt is attached
}

void loop() {
   NbTopsFan = 0; //Set NbTops to 0 ready for calculations
//  sei(); //Enables interrupts
//  delay (1000); //Wait 1 second
//  cli(); //Disable interrupts
  Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour
  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
  HttpClient client;
  String url = "http://10.10.0.50/catchyun.php?waterflow=55454";
  //url += String(Calc);
  client.get(url);

  while (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  Serial.flush();

  delay(5000);
}
8  Using Arduino / LEDs and Multiplexing / Re: What is this LED driver/stepup/stepdown on: December 12, 2013, 03:42:09 pm
Quote
electroluminescent ribbon.

Exactly!!!   i thought those were just little LEDs but this sounds more likely.

update:  just talked to him.  it is the ribbon.  would have been nice if he said that to begin with.

Now to figure out which driver will work for about 12 feet of ribbon.
9  Using Arduino / LEDs and Multiplexing / Re: What is this LED driver/stepup/stepdown on: December 12, 2013, 03:39:49 pm
hi guys. sorry for the late response.  For some reason I got notified on the first reply but not again...

crappy soldering - thats me trying to desolder the burnt up part.  I did a crap job and didnt finish because I decided to just buy a new unit.  Unfortunately I still cant figure out wth it does and what to replace.

2 whites definitely plugged into the LEDs.
Black and red went to 12V in the car.

there is no inverter in the car. 

Just for giggles I'll have him voltage test the red and black but Im pretty sure I had him do that already and it was 12v (or close)

It looks like that part is only a couple bucks so I may just try to desolder and replace it and see what happens.

Update:  The car did have an inverter at some point.  but not since he has had it and the lights have worked since.
He did hook a test light to black and red in the car.  The light lit up.  But I'm making him go put a volt meter on it to verify theres not some invertor hidden somewhere else.
10  Using Arduino / LEDs and Multiplexing / Re: What is this LED driver/stepup/stepdown on: November 27, 2013, 09:50:30 pm
looks like its this guy
http://www.fairchildsemi.com/ds/MJ/MJE181.pdf
  wait what...  low power audio amplifier?
11  Using Arduino / LEDs and Multiplexing / Re: What is this LED driver/stepup/stepdown on: November 27, 2013, 09:48:32 pm


looks like
0027
MJE
182
ST MRC
12  Using Arduino / LEDs and Multiplexing / Re: What is this LED driver/stepup/stepdown on: November 27, 2013, 09:42:53 pm
my bad attempt at desoldering it...
 smiley-roll

The heat thing is pretty stuck on there.  Ill try again to pull it of.
13  Using Arduino / LEDs and Multiplexing / What is this LED driver/stepup/stepdown on: November 27, 2013, 09:04:24 pm
A friend of mine has a strip of LEDs, a ribbon in a limo.  The lights quit working.  He pulled this box out.  It looks like it is toast. 

Any ideas what it is/does?  I was under the impression a lot of LEDs use 24volt so this may be a step up device from 12v?

The red and black go to power and ground.  Both whites go to the LED ribbon. 



14  Topics / Education and Teaching / Re: Android Bluetooth to Arduino on: May 22, 2013, 03:32:27 am
ok this may sound dumb...  I have the android SDK.  where do I put this code?
15  Community / Bar Sport / Re: A rare customer indeed, bargaining on a quote ! on: March 11, 2013, 05:23:44 pm
must work for the government.
Pages: [1] 2 3 ... 20