Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By AusUser
#62298 I want to try my first oled project with my esp8266 and DHT sensor (Arduino IDE). Firstly I’ve read some conflicting information on the need for pull-up resistors. For example these two post below. In what case do you need/not need pull resistors when working with I2C

http://learn.acrobotic.com/tutorials/po ... -using-i2c

http://arduino-er.blogspot.com.au/2016/ ... 28x64.html

(BTW I'm using the following oled -
I'm using this oled http://www.dx.com/p/1-3-128-64-blue-lig ... Jw9njt95pg)

I plan to use the I2c scanner sketch to identify the device.

For text placement and or graphics, what tutorial or reference can I read to determine how to control output & placement of text on oled screen? I library with pre-set layout options would be nice : )

Ultimately I’d like to get to the point where I can display different sets or data in loop. Similar to this sketch here https://github.com/basvdijk/arduino-weather which is using something called gimp

Thanks for in advance for any replies

Reg
User avatar
By rudy
#62305 The value of the pull up resistance determines how fast the voltage level can change from a low to a high. If the connected wiring does not have much capacitance then you can get away with less resistance and still meet the timing requirements. While the port pins do have a weak pull up current source it really is not a good replacement for a lower value resistance. If it does work it may cause marginal operation.

If you do not have a oscilloscope to verify rise time of the voltage then it is safest to just put in proper value resistors. Some built modules with I2C devices do include pull-up resistors. If that is the case than you probably do not need to add any more. A check from the SDA and SCL lines to the chip's Vcc with an Ohm meter (with the power to the circuit off) should tell you the value.
User avatar
By Boxey
#62327 A good starting point might be to have a look at: viewtopic.php?f=41&t=7319

Although you might not be using an ESP-01 (more likely an ESP-12).. it shows the connections (to GPIO0 and GPIO2), pull up resistors and the code used to make it happen.

https://www.esp8266basic.com/ (in the documentation section) has a Language Reference link you can download all the info from; which shows how to use all the oled commands (to get a small oled display working with Basic has been made really easy ;) ).

Depending on which ESP you use might dictate if you need pull up resistors or not (but don't worry about giving it a go without them.. it won't harm it, it'll just either work or not).

I use the NodeMCU boards and bare ESP12 (and ESP07) modules ..some work without pull-up, some work better with (although there's no harm in adding the pull-ups just for consistency)

A search on this forum for "oled" will bring up a few ideas and examples ;)
User avatar
By heckler
#62332 Aususer,

Note that the code and example in the first link that Boxey provided was implemented in the older espBASIC 2.0 xx branch.

So you will likely need to make some minor language syntax corrections to make it compatible with the 3.0xx branch.

Check the language reference docs if you encounter some errors.

dwight