Show Posts
Pages: 1 2 [3] 4 5 ... 17
31  Forum 2005-2010 (read only) / Syntax & Programs / Re: Binary Conversion on: November 24, 2010, 11:58:12 am
Quote
there are plenty of cheat and liers out there right
That's as good an excuse to add to the pile as any I suppose.
...
If that is the *real* Dr. Dennett, I'm somewhat tempted to post a solution just to make it that much more difficult for you to take the credit.
32  Forum 2005-2010 (read only) / Syntax & Programs / Re: comparing readings from a sensor over time... on: November 24, 2010, 12:01:23 pm
I foresee another problem.  You're using an accelerometer to detect movement, which isn't necessarily a sufficient sensor.  Consider if the object is moving but not accelerating, how will you know (without doing some integration)?
Are there more bounds to this problem?
33  Forum 2005-2010 (read only) / Syntax & Programs / Re: What causes a crash/reboot? on: November 19, 2010, 02:16:29 pm
Generally writing to an address you shouldn't or reading from the wrong location causes halt problems... but you know that.
Break your code into the smallest manageable portion that still demonstrates the problem and post that.
But in the process of doing that you might just find the problem yourself.
34  Forum 2005-2010 (read only) / Syntax & Programs / Re: What causes a crash/reboot? on: November 19, 2010, 12:59:12 pm
Lucky guy... I wish that *I* could see the code smiley-wink


Quote
what else might cause a crash?
I'd start with looking into the code.
35  Forum 2005-2010 (read only) / Syntax & Programs / Re:  error: expected ';', ',' or ')' before '&' token on: February 22, 2010, 11:39:48 pm
Where you have this...
Code:
void initChannel(Channel &chan);

I think you might mean this...
Code:
void initChannel(struct Channel*);

You'll run into custom_types.h:49 not allowing a variable in the struct definition.  That's where I stopped pressing ctrl-R.
36  Forum 2005-2010 (read only) / Syntax & Programs / Re: Questions on attachInterrupt on: September 09, 2010, 10:51:26 am
"can we call attachinterupt inside of function from another attachinterupt?"

I believe this would work.  I can't say I can imagine a situation that this is necessary and also best-practice.
37  Forum 2005-2010 (read only) / Syntax & Programs / Re: Questions on attachInterrupt on: September 09, 2010, 09:45:19 am
"this  fuction will have a minimum delay of 4000microseconds"
If you mean this interrupt handler will take a minimum of 4000 microseconds  to execute you need to rework this so that it doesn't.

Another thing to note, I believe delay() will not work inside an interrupt handler.  Reason being, delay() relies on interrupts to work properly, but inside an interrupt handler interrupts are disabled.

There will be ways to achieve your objective, but they will be different from what you think you want to do smiley-wink
Post your problem details for more help.
38  Forum 2005-2010 (read only) / Syntax & Programs / Re: Questions on attachInterrupt on: September 09, 2010, 08:30:03 am
lefty is correct that the second interrupt will be "remembered".  There is a register that stores interrupt flags.  When a pin event occurs the hardware sets the interrupt flag to TRUE.  This buffer is only 1 event deep (if 20 events occur that set the flag to TRUE, it only queues one event).

lefty is incorrect stating that the pin3 event will be ignored.  In the same way the interrupt flag for the pin3 event will be set while the other interrupt is executing.

When the conditions exist that allow the interrupt flag to be acted on (global interrupts are enabled and also the pin-specific interrupt is enabled) the interrupt function gets executed.  If multiple interrupts are queued the hardware executes them in a pre-determined priority sequence (see the datasheet).  Note that the interrupt flag is still set even if interrupts (global and local) are disabled.

The Atmega will clear the interrupt flag when the interrupt function *starts*.  Pt. of interest: an event that triggers interruptA while the handler for interruptA is running causes the handler to run again immediately once interrupts are re-enabled.
39  Forum 2005-2010 (read only) / Syntax & Programs / Re: reading the output of a pin on: August 06, 2010, 12:30:30 pm
I believe so yes.  From the atmega datasheet section 2.4...

"Independent of the setting of Data Direction bit DDxn, the port pin can be read through the
PINxn Register bit."

The Arduino digitalRead() function most certainly has to read the PINxn register to decide whether the pin is HIGH or LOW.
40  Forum 2005-2010 (read only) / Syntax & Programs / Re: Press VS. Hold (Button Help) on: July 30, 2010, 01:27:52 pm
Another hint... you're not as interested in the buttonpress event as you are the buttonrelease event.
41  Forum 2005-2010 (read only) / Syntax & Programs / Re: Register manipulation ? ? ? on: July 26, 2010, 12:06:34 pm
There seems an awful lot of discussion for something that I thought was pretty straight forward.

Code:
a lexicon of "1<<" followed by a bit address

...is correct.  "OCIE2A" is indeed a bit address intended for use with the TIMSK2 register.  Use the other bitwise | & and ~ operators to control it the way you want; to set/clear the bit location, or the entire register.
42  Forum 2005-2010 (read only) / Syntax & Programs / Re: getting time difference for speedometer on: July 22, 2010, 10:12:45 am
You will get help, but not likely from a post like this.
If you describe in detail your objective, what you've tried (post the code), what you expect it to do, and what it actually, does you'll get some troubleshooting assistance and good steering from resident experts.

With so little to go on there's a good chance this thread will be ignored.
43  Forum 2005-2010 (read only) / Syntax & Programs / Re: Pin 13 blinks, and void loop doesnt loop on: July 08, 2010, 02:27:01 pm
I would encourage you to think about this a little more systematically.  It's being suggested that you use the serial.print and comment tokens as tools to start tracking this down precisely on your own since there's nothing glaringly wrong.

Think about your last post too... You have proven that the first if statement causes the problem.  You *haven't* proven that the 2nd and 3rd if statements *don't* cause the problem.

Regardless, you've narrowed down the problem to within an if block.  So keep pressing.  Find out which statement within the if block is the issue.  Until you have more/different information I suspect you'll mostly get a "keep digging" response here.

Hope I don't sound too lecturing.  Debugging is it's own skill but it isn't difficult.  Follow the logic and you'll find the problem.
44  Forum 2005-2010 (read only) / Syntax & Programs / Re: Pin 13 blinks, and void loop doesnt loop on: July 08, 2010, 12:46:13 pm
Try some more thorough troubleshooting to track this down...

Write a Serial.print statement in the setup function.  Think about the results.
Is your Serial client configured to listen properly to Arduino serial output?
45  Forum 2005-2010 (read only) / Syntax & Programs / Re: Pin 13 blinks, and void loop doesnt loop on: July 08, 2010, 08:31:12 am
2nd thought: nothing ever arrives on the serial port... so Serial.available() is always false (i.e. !> 0), and your while loop never executes.
Pages: 1 2 [3] 4 5 ... 17