|
|||||||
![]() |
Forum Index > General > Ask an Evil Mad Scientist! | ||
A to D tutorial ? |
|||
| | | Printable Version |
|
Anonymous: Pork Rhombus | ||||||||
|
Thanks for the D to A tutorial. It's useful for someone who is currently transitioning out of the Arduino world and into the world of 'grown-up' AVR programming. |
![]()
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
Check out our accelerometer tutorials: These are using A to D to gather data: Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
Thanks for the tip. I am going to look at that now. |
|
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
Just what I wanted. Thanks very much indeed. |
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
You might also enjoy some of our other AVR-centric articles: Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
I will check them out, for sure. |
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
Yes, that's an alias for grabbing the full result as an unsigned int (16-bit) in a single operation. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
I got another one for you. (Yes, I'm aware that isn't good English). |
|
||||||||
|
|||||||||
|
Windell | ||||||||
|
Yes, you can change the fuse settings on the AVR to disable the reset pin. After that, the pins is available to use as a regular I/O pin. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
And if reset is disabled, that means that any further programming (by normal means anyway) is off the table? So I would have to be sure that my code was in its final form before I did that. |
|
||||||||
|
|||||||||
|
Windell | ||||||||
And if reset is disabled, that means that any further programming (by normal means anyway) is off the table? So I would have to be sure that my code was in its final form before I did that.
Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
Happy Easter. |
![]()
|
||||||||
|
|||||||||
|
Windell | ||||||||
. Odd thing is that a button push does not show as a zero on the ADC, more like a 6 or 7. Not surprising. It would be surprising if you read an exact zero; it's still an analog measurement, after all. in my code if I change a var from unsigned int to unsigned long, my compiled code goes from 784 bytes to 1054 bytes. Any idea on that? Depends what you're doing with that variable. An unsigned int is a 16-bit number. The AVR has 8-bit data locations in most places, so a fair amount of swapping is needed to deal with it. An unsigned long is 32 bits long-- four bytes -- and obviously much more overhead required. Doing complex software algorithms, like division, takes up a heck of a lot more with longer variables. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
I wouldn't be surprised to see a 1 on the ADC rather than a zero, but 7/255 of 5V is significant (I'm reading ADCH only since 8-bit accuracy is sufficient). |
|
||||||||
|
|||||||||
|
Anonymous: Pork Rhombus | ||||||||
|
Wait. I lied. There is a modulo operator: |
|
||||||||
|
|||||||||
|
|
| All times are PDT. The time is now 01:41 AM. |
|
|
Octolively
Interactive LED kits
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits