Pages: [1]   Go Down
Author Topic: extra abstraction  (Read 349 times)
0 Members and 1 Guest are viewing this topic.
v
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Imagine a world where pinMode() would not exist...
Would it be that hard to include the DDRx register assignment instruction every time the user invokes digitalWrite() or digitalRead()?
Speed considerations put aside, am I missing something?

/me
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It would only really be useful for certain applications.
Usually pins are defined in setup and never changed.
Logged

v
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was more thinking in terms of learning to program for ucontrollers.

Those of us used to it know we have to initialize a ton of stuff for things to work, but it'd be nice if newbies didn't have to worry about these things. Just as they don't have to worry about setting the ADMUX register when starting an analog to digital conversion or setting the many registers when doing PWM.

It simply seems strange to me to offer an abstraction layer for these functionalities, but not for digital I/O.

Vincent
Logged

Pages: [1]   Go Up
Jump to: