Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 9 months ago.
I2C Display 20x4 Character write frequency
If I use the following code below with wait set at 0.01, then rows 2,3 and 4 get progressively worse in visibly displaying characters. Changing the wait to a 1 each row is displayed perfect. My thoughts initially were if I used a small enough wait value then the frequency in writing characters would increase and I wouldn't see the difference. Am I correct in thinking this is related to the I2C frequency and the conversion taking place on the LCD display chip? Are there variable anywhere where I can look at changing? Thanks for any help.
lcd.cls(); lcd.printf("ITG3200 DevID 0x%02X\n",gyro.getWhoAmI()); //was gyro1.getWhoAmI() wait(0.01); lcd.printf("ADXL DevID is: 0x%02X\n", accelerometer.getDeviceID()); wait(0.01); lcd.printf("Ax%i Ay%i Az%i\n", (int16_t)readings[0], (int16_t)readings[1], (int16_t)readings[2]); wait(0.01); lcd.printf("Gx%i Gy%i Gz%i\n\r", gyro.getGyroX(), gyro.getGyroY(), gyro.getGyroZ()); //lcd.printf("Temperature %2.1f \n",gyro.getTemperature()); wait(0.01);
Apologies using this code I have the display working how I want it, but now I have a character appearing I haven't noticed before right at the very end and on another line? I have no idea where this additional character is coming from as it displaces the lines above it?
To help I've put the Temperature display back in on the next line and the strange character appears directly in front of the T on Line 4 Position 1??
posted by Derek Calland 09 Mar 2017