Skip to content

Conversation

@jamwaffles
Copy link
Collaborator

Section 8.1.5) a) in the datasheet states that the display address can be 0x3C or 0x3D, chosen with the D/C pin.

It can now be configured using the .with_i2c_addr() method on the Builder. Example:

let mut disp = Builder::new()
        .with_size(DisplaySize::Display128x32)
        .with_i2c_addr(0x3d)
        .connect_i2c(i2c);

Closes #12.

@scowcron This is where the builder pattern starts making sense to me; it feels more Rustic to chain a bunch of calls together to configure the object. Feels a bit like chaining iterator methods.

@scowcron
Copy link
Collaborator

Yep, I see where you're going with it. Seems a little bit odd that you can set an i2c address which will then go unused if you run the SPI route, but it's not really a big deal, and I suspect it will be optimized out with the --release flag anyway if someone decides to do that.

Section 8.1.5) a) states that the display address can be 0x3C or 0x3D,
chosen with the D/C pin.

It can now be configured using the `.with_i2c_addr()` method on the
`Builder`.

Closes #12.
@jamwaffles jamwaffles force-pushed the configurable-address branch from e3e7c36 to 830f2fd Compare March 20, 2018 21:50
@jamwaffles
Copy link
Collaborator Author

Seems a little bit odd that you can set an i2c address which will then go unused if you run the SPI route

True, but it's explicitly named *_i2c_* so should hopefully make sense to people using it.

I suspect it will be optimized out with the --release flag anyway

I suspect also, but it would be good to confirm this at some point.

@jamwaffles jamwaffles merged commit ce2cb76 into master Mar 20, 2018
@jamwaffles jamwaffles deleted the configurable-address branch March 20, 2018 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants