Show Posts
Pages: 1 [2] 3 4 ... 361
16  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.

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.
17  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?
18  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
      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;
    start = 0;
  case demoTwo   :
//                             do something
  if ( !finished )
//  do something every time demoFn() runs until finished, 1 no-delay step per pass
    demoStart = millis();
    demoWait = some value
    demoState = demoThree;
  case demoThree   :
//                             do something
  demoState = demoOne;  // function is finished running until started again

19  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.

20  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.
21  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?
22  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.
23  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.
24  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.
25  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.
26  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.
27  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.

28  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.
29  Community / Bar Sport / Re: How do they weigh.... on: August 12, 2014, 07:07:46 am
The moon should have more helium-2 than helium-3. The sun doesn't spit out pure heavy isotopes.
Normal Helium is Helium-4.  Helium-3 is an unusually LIGHT version of the atom...

As for "how do you weigh?": compress it until it's heavier than air, and then apply Boyle's law.
The difference in mass between compressed gasses and uncompressed gases is quite noticeable.  In my day, full SCUBA tanks (at ~2750psi) would sink, while empty ones will float.  (I'm not sure if that's held up through the revolution in tank composition (Al, carbon fiber, etc.)

Oh that's right 2 protons and 2 neutrons.

2750 psi? That's good for 30 minutes?

We weighed electrons in physics class.
30  Using Arduino / General Electronics / Re: Wiring Arduino Micro with Xbee Radio on: August 12, 2014, 04:32:59 am
Looking through the software serial code, I think I avoid it as much as possible from now on.
It works. But not all ways and it's blocking both I and O.

Turning the pullup off has multiple buried consequences. I hope they were necessary.

AVR HW serial idle; RX is INPUT and TX is HIGH
AVR SW serial idle; RX is PULLUP and TX is HIGH

Yes, definitely use a leveler.

I wonder if a PNP transistor with the XBEE and a resistor to the grid switching the PULLUP to ground or not.....?  
Would be cheaper and a bit more static resistant.

7407s are old school, I'd bet it's hard to even find one. Use 74HC4050, 74HC125, etc.

How much current can I safely level with those? It looks like 10mA or less.
For signal, fine I guess but I won't be powering an SD on that. Maybe the choice there is a divider.
Pages: 1 [2] 3 4 ... 361