Note for actions written to the display.

Jacobsen

New Member
With the sentence: "IF Solar <= 0 THEN NoSolar" I would like to send the following message to the display "No Solar"
Using HD44780
I have tried several options. And checked the datarecord for the display and <b> EEPROM. </b>
But I haven' t been able to send the message that when there is no sun, &quot;No Solar&quot; has to be inserted in the place where the

variable&quot;Solar&quot; outputs the values.
Do you have a suggestion for how I should solve this problem?

<code><pre><font size=2>
DisplayLine1:
READADC10 0,Solar
'Solar = 512' 2.50 Volt
byte = $80; Start Line 1
GOSUB SendCmdByte
<b> EEPROM 6,(&quot;Solcelle:&quot;) ; 6..14 </b>
FOR get = 6 TO 14
READ get,byte
GOSUB SendDataByte
NEXT

IF Solar &lt;= 0 THEN NoSolar

LET Solar = Solar * 50 / 32 * 10 / 32

Disp1000Linie1:
byte = Solar / 10000 | &quot;0&quot;
IF Solar &gt;= 10000 THEN Disp1000Digit1
byte = &quot; &quot;
Disp1000Digit1:
GOSUB SendDataByte
Disp100Linie1:
byte = Solar / 1000 // 10 | &quot;0&quot;
IF Solar &gt;= 1000 THEN Disp100Digit1
byte = &quot; &quot;
Disp100Digit1:
GOSUB SendDataByte
Disp10Linie1:
byte = Solar / 100 // 10 | &quot;0&quot;
GOSUB SendDataByte
Disp10Digit1:
byte = &quot;.&quot;
GOSUB SendDataByte
DispUnits1:
byte = Solar / 10 // 10 | &quot;0&quot;
GOSUB SendDataByte

DispDecimal1:
byte = Solar // 10 | &quot;0&quot;
GOSUB SendDataByte
byte = &quot; &quot;
GOSUB SendDataByte
byte = &quot;V&quot;
GOSUB SendDataByte
byte = &quot;o&quot;
GOSUB SendDataByte
byte = &quot;l&quot;
GOSUB SendDataByte
byte = &quot;t&quot;
GOSUB SendDataByte

NoSolar:
byte = $80; Start Line 1
GOSUB SendCmdByte
<b> EEPROM 15,(&quot;NoData&quot;) ;66..85 </b>
FOR get = 15 TO 20
READ get,byte
GOSUB SendDataByte
NEXT

goto DisplayLine1
</font></pre></code>

<b> regards </b>
Monie
 

Fowkc

Senior Member
Where you have:

IF Solar &lt;= 0 THEN NoSolar

It's unlikely (although it will depend on your setup) that whatever you're using to measure the light (LDR potential divider, phototransistor etc) will ever give a voltage of 0v. It might get close, but &quot;close&quot; might not cut it with the PICAXE reading, which could be say 10 or 15 in low light.

In addition, the &quot;&lt;&quot; less than sign is pointless as you have it, as there's no such thing as a negative value on the PICAXE.

Try altering your IF...THEN line to respond to slightly higher READADC10 values. DEBUG after the READADC10 command would also tell you what sort of values you are getting in &quot;no sun&quot; conditions.
 
Top