Medium-sized I/O updates #3997

Merged
merged 13 commits into from Oct 20, 2015

Conversation

Projects
None yet
2 participants
@gohai
Contributor

gohai commented Oct 14, 2015

No description provided.

gohai added some commits Oct 14, 2015

I/O: Make delay(), delayMicroseconds() public
Those mirror Arduino's API, and should come in handy when waiting for very short intervals between I/O operations.
@@ -165,7 +165,7 @@ protected static void checkValidPin(int pin) {
* the sketch is going to achieve.
* @param ms milliseconds to pause
*/
- protected static void delay(int ms) {
+ public static void delay(int ms) {

This comment has been minimized.

@benfry

benfry Oct 14, 2015

Member

Why is there another delay() method that duplicates the one in PApplet?

@benfry

benfry Oct 14, 2015

Member

Why is there another delay() method that duplicates the one in PApplet?

This comment has been minimized.

@gohai

gohai Oct 14, 2015

Contributor

Thanks for pointing out - must have totally forgotten about the other one. Will remove. And since microseconds-type granularity is a little bit far fetched anyway, I guess the other one can go as well. Or perhaps a variant of delay() in PApplet that takes a float?

@gohai

gohai Oct 14, 2015

Contributor

Thanks for pointing out - must have totally forgotten about the other one. Will remove. And since microseconds-type granularity is a little bit far fetched anyway, I guess the other one can go as well. Or perhaps a variant of delay() in PApplet that takes a float?

This comment has been minimized.

@benfry

benfry Oct 14, 2015

Member

Yeah, I'd skip the microseconds version. We're unlikely to get that kind of timing from the device anyway. Easy enough to add later (and part of the philosophy is to add as necessary—never in anticipation).

@benfry

benfry Oct 14, 2015

Member

Yeah, I'd skip the microseconds version. We're unlikely to get that kind of timing from the device anyway. Easy enough to add later (and part of the philosophy is to add as necessary—never in anticipation).

This comment has been minimized.

@gohai

gohai Oct 14, 2015

Contributor

Makes sense! Those two functions are gone in later commits to this PR (below) - setBrightness is now brightness as well.

@gohai

gohai Oct 14, 2015

Contributor

Makes sense! Those two functions are gone in later commits to this PR (below) - setBrightness is now brightness as well.

@@ -141,7 +141,7 @@ public void close() {
* Sets the brightness
* @param bright 0.0 (off) to 1.0 (maximum)
*/
- public void set(float bright) {
+ public void setBrightness(float bright) {

This comment has been minimized.

@benfry

benfry Oct 14, 2015

Member

brightness() would be the correct name here (assuming there aren't other brightness-related methods planned).

@benfry

benfry Oct 14, 2015

Member

brightness() would be the correct name here (assuming there aren't other brightness-related methods planned).

This comment has been minimized.

@gohai

gohai Oct 14, 2015

Contributor

I initially picked set() because there's also a clear() that undos the user's actions and restores the initial value. But brightness() sounds good to me. Perhaps together with reset()?

@gohai

gohai Oct 14, 2015

Contributor

I initially picked set() because there's also a clear() that undos the user's actions and restores the initial value. But brightness() sounds good to me. Perhaps together with reset()?

gohai added some commits Oct 14, 2015

I/O: Add missing @param
This fixes the last Javadoc warning.
I/O: Remove GPIO.delay(), GPIO.delayMicroseconds()
Ben pointed out that there already is a delay in PApplet. Note: functions still need to be deleted from processing-docs.
I/O: Rename LED.setBrightness() to LED.brightness()
Suggested by Ben. Note: still needs to be updated in processing-docs.

@gohai gohai changed the title from Small I/O updates to Medium-sized I/O updates Oct 15, 2015

benfry added a commit that referenced this pull request Oct 20, 2015

@benfry benfry merged commit f33df17 into processing:master Oct 20, 2015

@gohai gohai deleted the gohai:for-ben-14 branch Nov 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment