Hi guys,
by using the MultiWiiCopter and reading Code i found a "1" with unkonw meaning!
I added a pic who see the codesection and notified postition.
Can anybody tell me why "1" is added to the DTerm?
Kind regards
goldenEyes
Question about Code
-
- Posts: 2
- Joined: Wed Nov 02, 2011 9:29 am
Re: Question about Code
Nobody knows????
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Question about Code
Integer math approx for division
(x+(y/2))/y is more accurate than x/y
(x+(y/2))/y is more accurate than x/y
Re: Question about Code
Let's turn this thread into catch-all for asking stupid questions about the code.
I've got doubts about this:
According to doc8025, all of PINB is read-only.
14.4.4 PINB – The Port B Input Pins Address
... Is there ANY reason this code exists, and if so, what exactly does it do?
Is this some clever trick that makes AVR do something?
Answering to myself after some irc discussions... Apparently that's equivalent of PORTB ^= 1 << 5; .....
the mind boggles.
I've got doubts about this:
Code: Select all
#define LEDPIN_SWITCH PINB |= 1<<5;
According to doc8025, all of PINB is read-only.
14.4.4 PINB – The Port B Input Pins Address
... Is there ANY reason this code exists, and if so, what exactly does it do?
Is this some clever trick that makes AVR do something?
Answering to myself after some irc discussions... Apparently that's equivalent of PORTB ^= 1 << 5; .....
the mind boggles.
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Question about Code
AVR secrets
http://billgrundmann.wordpress.com/2009 ... tedigital/
http://billgrundmann.wordpress.com/2009 ... tedigital/
dongs wrote:Let's turn this thread into catch-all for asking stupid questions about the code.
I've got doubts about this:Code: Select all
#define LEDPIN_SWITCH PINB |= 1<<5;
According to doc8025, all of PINB is read-only.
14.4.4 PINB – The Port B Input Pins Address
... Is there ANY reason this code exists, and if so, what exactly does it do?
Is this some clever trick that makes AVR do something?
Answering to myself after some irc discussions... Apparently that's equivalent of PORTB ^= 1 << 5; .....
the mind boggles.
Re: Question about Code
The 'switch' part combined with read-onlyness of PINB is what threw me off.
Normally this is called "toggle".
Normally this is called "toggle".
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Question about Code
dongs wrote:The 'switch' part combined with read-onlyness of PINB is what threw me off.
Normally this is called "toggle".
You're right, toggle is more appropriate.
French usually don't speak very well foreign languages