You are reading a single comment by @user54499 and its replies.
Click here to read the full conversation.
-
Okay, it does work thanks for your help Gordon, it was indeed because i was initialising each time. The code that eventually worked properly was
I2C1.setup({scl:B6,sda:B7}); var g = require("SSD1306").connect(I2C1); var bmp = require("BMP085").connect(I2C1); //... more code here setInterval(function(){ bmp.getPressure(function(d) { //console.log("Pressure: " + d.pressure + " Pa"); console.log("Temperature: " + d.temperature + " C"); g.clear(); g.setFontVector(20); g.drawString("Temp: ",0,0); g.drawString(" "+ d.temperature + " C",0,25); // write to the screen g.flip(); }); },1000);
I think your problem is partially that you're re-initialising the display each time.
setFontVector
definitely works - I was using it just today, and just tested again.Try:
There is however some regression issue when re-initialising the graphics multiple times, that I did notice recently and try to fix this morning (I fixed one problem, but haven't quite solved it yet).