serial lcd with clock upgrade

grimmjaw

Member
hi

im planning to use Serial lcd with clock upgrade as a timer in my project.unfortunetly i have a problem with the programming (serial connection)



my question is how to set the alarm every 4 hours and also display the current time on the LCD.my confusion is for the display syntax is in a loop but for the alarm is not.(example from the datasheet)how can i combine this two syntax?do i only need to program the alarm ones and then program the picaxe for displaying the current time only?



thanks for the help in advance


p/s:sorry if the question sound stupid ,i'm still new in both picaxe and programming
 
Last edited:

inglewoodpete

Senior Member
I have to admit I don't fully understand your problem. I don't have an AXE033 or clock upgrade myself but thought that if forum members got a little more information, they might be able to help you.

Are you trying to write to the LCD from the PICAXE while using the LCD as a clock? If so, post your code so we can get a better understanding of the problem. Also, which PICAXE are you using?
 

westaust55

Moderator
Grimjaw,

firstly welcome to the PICAXE forum.

You will need to use the AXE033 in i2c comms mode and not serial mode to be able to read the time into the PICAXE.

If you are trying to do something at a regular interval (eg 4 hours as you mention) then in a loop you can check the time and act when the time is reached. Then add the interval time to the current time and go back to comparison mode.

In the Programming Editor, have a look at the datalogger wizard by selecting the option to use the DS1307 RTC for timing and see how it is done there – the wizard will create some code for you to read..
 
Last edited:

grimmjaw

Member
i'm using PICAXE 18X with 18 pin high power project board with serial LCD with clock upgrade.my goal is that i can triger my cat food dispenser every 4 hours and the use the LCD to display the time.i prefer to choose serial connection between the LCD and the PICAXE mainly because i really dont understand how to use the i2c connection.(a beginner :p).

from the datasheet ,what i can gether is:
for displaying the time on the LCD the syntax is:

init: pause 500
main :serout 7,N2400,(1)
pause 10
serout 7,N2400,(0)
pause 490
goto main

for the alarm clock syntax

init: pause 500
main :serout 7,N2400,(253,9,"04:00:00 ")
pause 1000
end

my problem is for the displaying syntax is a loop but for the alarm clock is not.i try to combine them but it doest not displaying time.

i still trying to understand the datalogger idea since it involved sensor
 
Last edited:

tarzan

Senior Member
This may be an easy way to start you off as a beginner.

Setup an interrupt on your 18X input connected to AXE033 alarm output.
In the interrupt sub procedure control cat-feeding apparatus and reset alarm time on axe033.
Add four-hour period to last alarm set time.

Alarm output remains high for five seconds so you’ll need to wait that period before re-invoking the interrupt.
 
Top