Show Posts
Pages: [1] 2 3 ... 361
1  Using Arduino / Programming Questions / Re: Logger Serial1 data to SD card - Need help with stable logging on: August 27, 2014, 10:10:19 am
That's what I get for guessing!

Thanks, PaulS!
2  Using Arduino / Programming Questions / Re: Logger Serial1 data to SD card - Need help with stable logging on: August 27, 2014, 07:10:24 am
I must have something wrong.

Code:
  while(!GPS.newNMEAreceived()) { //Loop until you have a good NMEA sentence
    c=GPS.read();
  }

This looks like it says

As long as there is no character received, read the device and ignore what you get.

Whereas this

Code:
  while(!GPS.newNMEAreceived());  // Loop until there is data to read

would dispense with reading what isn't there.

But I can't have that right.

3  Using Arduino / Project Guidance / Re: LED Status indicator on: August 26, 2014, 12:28:09 pm
Are the pulses analog or digital? I thought they are digital so far.

Quote
It would be between 300ms on(high) 300ms off(low) and 1200ms on(high) and 1200ms off(low)

If they are digital which is 1V or less for LOW and 3V or more for HIGH....

And you check the pin once every 50ms, a very long time to Arduino, then;

5 or 6 reads the same before change is a short HIGH or LOW pulse which maybe needs to be paired HIGH and LOW.
23 or 24 reads for a long HIGH or LOW pulse.

say 30+ reads the same is steady HIGH or LOW?

You don't have to catch the edges when the flats are so wide and so different.

Mitsubishi Labs has a white paper out about led-to-led communication that does that, only much much faster. They read pulses 100's of usecs wide at 20usec intervals. 3 or 4 is a short, 7 or more is a long. At those speeds they are able to get solid bi-directional comms between 2 leds held 2 or 3 cm apart. It's still wireless.
4  Using Arduino / Project Guidance / Re: LED Status indicator on: August 25, 2014, 05:37:45 pm
You do know that pulseIn() blocks and that with the pulse widths given there's no need to go to such lengths?
5  Using Arduino / Programming Questions / Re: Wire communication during interrupt handling on: August 22, 2014, 02:13:04 pm
I've got a new way to un-delay (yes, un-delay makes andale!) a function, tried and tested.

It takes 1 state and 2 time variables and yes, I should make a base class but I'm so rusty I'm not ready to do it proper yet.

pseudocode but yes I have this working for someone somewhere already

This is what a fictional function that had 2 delays turned into a non-blocking state machine looks like.

byte demoState;

__attribute__ ((__packed__)) enum  demoStates // makes bytes
{
  demoOne, demoTwo, demoThree // yeah, yeah, NO imagination!
};

unsigned long demoStart, demoWait;

void demoFn( void )
{
  // this takes care of waits for ALL cases
  if ( demoWait ) // if == 0 then skip to switch-case
  {
    if ( millis() - demoStart < demoWait )
    {
      return; // if it's not time to run a case, return
    }
    else
    {
      demoWait = 0; // always when the timer runs out it is set to zero
    }
  }

  switch ( demoState )
  {

  case demoOne   :
  if ( start )
  {
//                             do something -- initialize values for case demoTwo right up to wait, if any....
    demoStart = millis();
    demoWait = some value
    demoState = demoTwo;
  }
  else
  {
    start = 0;
  }
  break;
  case demoTwo   :
//                             do something
  if ( !finished )
  {
//  do something every time demoFn() runs until finished, 1 no-delay step per pass
  }
  else
  {
    demoStart = millis();
    demoWait = some value
    demoState = demoThree;
  }
  break;
  case demoThree   :
//                             do something
  demoState = demoOne;  // function is finished running until started again
  break;
}

6  Using Arduino / Programming Questions / Re: Wire communication during interrupt handling on: August 21, 2014, 09:46:21 pm
Even more promising, you were able to figure it all out in about 1 month.
I can only wonder at what you may accomplish in coming years.  smiley-grin

PS - may I suggest that you reduce the clock speed to run on lower voltage?

At 3.4V you could connect directly to SD and many other devices.
A stand-alone 328P would not need an external clock at 8 MHz or less.

7  Community / Bar Sport / Re: What Faggot means in the UK on: August 16, 2014, 11:22:59 am
Is Lancaster in Lancashire? Isn't York in Yorkshire?

Bill called it "the Lancastrian Martial Art of Ecky Thump". I just watched again to make sure.

I don't know about these places. I watch BBC comedies and see hosts make fun of all kind of places and think that'd be something to see, a town that doesn't know about electricity or running water where even the wheel is new.
8  Community / Bar Sport / Re: What Faggot means in the UK on: August 15, 2014, 07:35:54 pm
Do they still teach Icky Thump in Lancaster?
9  Using Arduino / Programming Questions / Re: Why is Serial.parseInt() so slow? on: August 15, 2014, 04:40:52 pm
Do you have Serial Monitor set to add a newline at the end of each entry?
Newline is non-numeric.
You can enter several numbers by putting spaces or commas between.
But really, rolling your own will teach you a thing or two.
10  Community / Bar Sport / Re: What Faggot means in the UK on: August 15, 2014, 06:20:32 am
Allsorts are good but I can't remember when I last saw any.
11  Community / Bar Sport / Re: How do they weigh.... on: August 14, 2014, 08:40:52 pm
There's good snorkeling over many reefs on Oahu, most all without dangerous fish and not deep at all. Or at least that's how it used to be. Water deep enough for tanks is deep enough for sharks is how I look at it.

But hey find a decently clean lake anywhere and there's plenty near shore to look at, just not as colorful.
12  Community / Bar Sport / Re: How do they weigh.... on: August 13, 2014, 04:55:46 pm
IIRC in a Jacques Cousteau I watched they spent time in a bell purging blood nitrogen for some deep dive.

I have a sinus blockage. Past 20 ft down it gets like a spike driven into my head pain.
I never used a tank except in a 12 ft pool during lifeguard training and yes even just that was neat!

Our instructor talked about some twit turning a 20 ft garden hose into a snorkel.
He said the guy didn't try to breathe through it until he got to depth.
13  Community / Bar Sport / Re: How do they weigh.... on: August 13, 2014, 02:27:32 pm
You would have to spend the hours breathing helium+oxygen+CO2 just to get the nitrogen out of your blood before helium in your tank would do you any good.
14  Community / Bar Sport / Re: What Faggot means in the UK on: August 13, 2014, 11:50:50 am
Scrapple does have apple in it and there was, maybe still is a scrapple maker down in Milton, Delaware.

I'm pretty sure they have scrapple in Baltimore too. Probably made in Philly but they have it!

I've heard that Pat's Steaks has really slid downhill at least downtown. Dunno about the Catherine St. store.
Some of the best Philly steaks I got were from the little trucks down in Univ City but that was ~40 years ago.

15  Using Arduino / Programming Questions / Re: temperature flickering. on: August 13, 2014, 01:51:46 am
What you are seeing is to be expected, small scale changes include the very circuit you measure with.

The answer is hysteresis.

It's the way digital pins and thermostats and many other devices work and have for a long time now.

The set point for ON should be different from the set point for OFF, not a knife edge balance but a stable flat.

Digital pin goes from LOW to HIGH at a higher voltage than the switch from HIGH to LOW.

Hysteresis has inherent stability.
Pages: [1] 2 3 ... 361