Ok, so the parenthesis don't make a difference, no problem...Guess we're going to have to build this up from scratch...
Do you have that LCD connected to your project? Is it working as you expect it to work (i.e. displays HELLO if you command it)
EDIT: Never mind, obviously you do have the LCD connected...
In reference to your I2CWRITE statements a few posts ago...
adr = 24
i2cwrite I2CDAT, I2CCLK, $A0, adr,[(temperature dig 2) + 48]
pause 15.......and so on.....
You do NOT need to store temperature in the manner you are storing it. What you are doing in effect is storing the ASCII equivalent of your temperature value in 3 bytes, then retrieving that same result and trying to display the ASCII result of each of those bytes...in effect, display the ASCII values of the ASCII values of the bytes originally stored....sort of like looking at a camera which is looking at you looking at a camera which is looking at you...infinite regression...
It looks to me like you're doing twice as much work as you need to do!
Try to store the temperature like this:
Code:
adr = 24
i2cwrite i2cdat, i2cclk, $a0, adr,[temperature.highbyte]
adr = 25
i2cwrite i2cdat, i2cclk, $a0, adr,[temperature.lowbyte]
This will store the WORD variable temperature in two bytes as required.
Then for retrieving that same value:
Code:
adr = 24
i2cread i2cdat, i2cclk, $a0, adr, temperature.highbyte
adr = 25
i2cread i2cdat, i2cclk, $a0, adr, tempearture.lowbyte
.............
lcdout DEC2 (temperature/100) , "," , DEC2 (temperature//100)
This should display on the LCD is in fact the temperature sensor and it's code are working properly.
To get the individual digits from this value for display on the LED matrix instead of the LCD:
Code:
adr = 24
i2cread i2cdat, i2cclk, $a0, adr, temperature.highbyte
adr = 25
i2cread i2cdat, i2cclk, $a0, adr, tempearture.lowbyte
.............
digit var byte[5]
digit[5] = temperature dig 4
digit[4] = temperature dig 3
digit[3] = temperature dig 2
digit[2] = ","
digit[1] = temperature dig 1
digit[0] = temperature dig 0
............
Bookmarks