Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:55 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : WebMite in Silicon Chip Magazine

     Page 5 of 5    
Author Message
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 06:22am 04 Nov 2023
Copy link to clipboard 
Print this post

Hi

I've just started playing with this on a bare bones 2040 W today.

On setting the watering days, the prescribed timer does not appear to be get set for the current day [Mo] unless [Sa] is selected as well, in fact selecting just [Sa] will set the timer for the set time for today & run at that time. (Set time > than current time). In all other cases, the auto refresh timer gets set to midnight.

Selecting [1] for every day works OK.

Am I missing something? Just wondering.

(Config below only works if [Sa] is selected as well and set time > current time.



Brian
ChopperP
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 06:32am 04 Nov 2023
Copy link to clipboard 
Print this post

Hi Brian,
I may be wrong (yet again) but the system knows that today is Saturday so it won't run today's schedule on Monday.
Is that it? (if so we can have a good laugh together)

Andrew
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 06:51am 04 Nov 2023
Copy link to clipboard 
Print this post

OK.......for some unknown reason, I thought it was Monday. Not feeling too good today. Should be out elsewhere instead of being at home so got confused.
Need to triple check stuff before I post

Laughs on me.

Thanks Andrew.

Brian
ChopperP
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 06:58am 04 Nov 2023
Copy link to clipboard 
Print this post

No mate- I've been retired for 10+ years and I have no idea what day it is.
All day today I have been thinking it is Sunday - that is how I thought to check.
Being in Melbourne, and a public holiday on Tuesday (for some horse race), it has been important to get the supplies in.

Cheers,

Andrew
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 12:37am 05 Nov 2023
Copy link to clipboard 
Print this post

OK, after yesterday's embarrassment of forgetting what day of the week it was (today is Sunday), I'm happy to report that the bare bones "W" works as advertised for the basic stuff on the Watering System Controller prog.

With the weather forecast of 96% rain & it is actually raining (first good wet stuff for a while), that tick box worked as well.

I haven't tried the email yet.

There is certainly a great deal of stuff in the Water System Controller prog etc to keep us less experienced Shedders busy sorting it all out for a good while.
Been fun (mostly) playing around with the program so far. Telnetting into the "W" is great as well.

@Andrew, good luck with the horses on Tues. (Public holidays for the Cup & the AFL GF: what a life in Vic  )

Brian
ChopperP
 
barewires
Newbie

Joined: 13/04/2015
Location: United Kingdom
Posts: 30
Posted: 07:29pm 15 Nov 2023
Copy link to clipboard 
Print this post

Try this code:
[code]
'1st light 10092023 F407#2
'by chatGPT with fixes by RS 13/11/2023
Print MM.Ver,MM.Device$,Date$,Time$
Print "ZELLER'S CONGRUENCE PERPETUAL DAY CALCULATOR"

Print "I work at the 7-11 from 9-5"
Print "Reverse 11-7 and 5-9"
Print "Remember these dates: Last day of Feb, Pi Day 14-3, 4-4, 6-6, 8-8,"
Print "10-10, 12-12 and July 4th as 4-7. Jan 3 common years. Jan 4 leap years"
Print "These dates were all Tuesday in 2023. Add a day for next year but add 2"
Print "when coming into a leap year."

Data 3,1,28,2,14,3,4,4,9,5,6,6,4,7,11,7,8,8,5,9,10,10,7,11,12,12,0,0,0,0
n = 13

Do While n > 0
 Read D,M
'  Print n,D,M
 n = n - 1

'Input "Enter date (1-31): ", D
'Input "Enter month (1-12): ", M

testyear:
'Input "Enter year (e.g., 2023): ", Y
Y = 2023
'Print "Year=";Y
'If Y=0 Then Print "Invalid Year": GoTo testyear
Print D,M,Y,
If M < 3 Then
 M = M + 12
 Y = Y - 1
EndIf
'Print "my="; M,Y
K = Y MOD 100
J = Int(Y / 100)
F = Int((13 * (M + 1)) / 5)
G = Int(K / 4)
H = Int(J / 4)
W = (D + F + K + G + H - (2 * J)) MOD 7

'Print D;M;Y,K,J,F,G,H,Z,W
'Print " D ";"M ";"Y","  K","J","F","G","H","Z","W"

'Print "The day of the week is ";

Select Case W
   Case 0
       Print "Saturday"
   Case 1
       Print "Sunday"
   Case 2
       Print "Monday"
   Case 3
       Print "Tuesday"
   Case 4
       Print "Wednesday"
   Case 5
       Print "Thursday"
   Case 6
       Print "Friday"
End Select
Loop
[/code]

3       1       2023   Tuesday
28      2       2023   Tuesday
14      3       2023   Tuesday
4       4       2023   Tuesday
9       5       2023   Tuesday
6       6       2023   Tuesday
4       7       2023   Tuesday
11      7       2023   Tuesday
8       8       2023   Tuesday
5       9       2023   Tuesday
10      10      2023   Tuesday
7       11      2023   Tuesday
12      12      2023   Tuesday
Edited 2023-11-16 05:34 by barewires
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 08:36pm 15 Nov 2023
Copy link to clipboard 
Print this post

Thanks for posting the "PERPETUAL DAY CALCULATOR".

Note that on this forum, to preserve indentation, the tags [ CODE] and [ /CODE] must be in upper case.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
PilotPirx

Regular Member

Joined: 03/11/2020
Location: Germany
Posts: 68
Posted: 08:24am 16 Nov 2023
Copy link to clipboard 
Print this post

My version of the "PERPETUAL DAY CALCULATOR" (german version):


Print "Wochentagsermittlung"
Input "Tag: ", Tag
Input "Monat: ", Monat
Input "Jahr: ", Jahr

Rem       Monatskorrekturen
If Monat < 3 Then Monat = Monat + 12: Jahr = Jahr - 1
Rem       Wochentagsberechnung nach Zeller's Congruence
K = Jahr Mod 100
J = Int(Jahr / 100)
W = (Tag + Int((Monat+1)*13/5) + K +Int(K / 4) + Int(J / 4) - 2 * J) Mod 7

Rem       Ausgabe des Wochentags
Print "Wochentag: ";
If W = 1 Then Print "Sonntag"
If W = 2 Then Print "Montag"
If W = 3 Then Print "Dienstag"
If W = 4 Then Print "Mittwoch"
If W = 5 Then Print "Donnerstag"
If W = 6 Then Print "Freitag"
If W = 0 Then Print "Samstag"

 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 01:41pm 16 Nov 2023
Copy link to clipboard 
Print this post

  PilotPirx said  german version


Cool. Nice and compact.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 12:34pm 25 Nov 2023
Copy link to clipboard 
Print this post

Hi Geoff

FYI, I just ran MM Edit's Display Variable report on V1.3 & it came up with

  Quote  Lines with unpaired brackets:
313 450 480 483 626

with 'retri.bas being the first line

I don't really know if these affect anything or not.

Brian
ChopperP
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 08:27am 26 Nov 2023
Copy link to clipboard 
Print this post

I cannot see any "unpaired brackets" and the code runs fine (MMBasic does not complain).  So I don't have answer.

Geoff
Geoff Graham - http://geoffg.net
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 10:34am 26 Nov 2023
Copy link to clipboard 
Print this post

I downloaded the program again & left the first commented row in (I had deleted it). The MM Edit report gave the list below. I've included the corresponding lines of code.
   
' retic.bas
' (c) Geoff Graham 2023
 Const Ver = "1.3"

Lines with unpaired brackets:
313 449 479 482 624

313  if Len(RainDetect) And Pin(RainDetectInput) = 0) Then
449  ElseIf LInStr(b(),"GET /setup.html HTTP") > 0) Then
479  ElseIf LInStr(b(),"GET /config") > 0) And (LInStr(b(),".html HTTP") > 0) Then
482  ElseIf LInStr(b(),"POST /config") > 0) And (LInStr(b(),".html HTTP") > 0) Then
624  If StartDay(pnbr) = "" Or StartMonth(pnbr) = "" Or EndDay(pnbr) = "" Or EndMonth(pnbr) = "") Then


I'm having a number of "Senior" moments lately but I'm sure these lines do have extra ")"s in them after the "0"s etc.  

Brian

Edit. Line numbers were one number out
Edited 2023-11-26 20:57 by Chopperp
ChopperP
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 04:07am 27 Nov 2023
Copy link to clipboard 
Print this post

Thanks Brian, it was me having a senior's moment, not you.  I must have looked at that code so many times and the extra brackets remained "hidden" to my eyes until you pointed it out.  It just shows how valuable MMEdit is.

I have not checked the MMBasic source code but my guess is that the interpreter hit the last unpaired closing bracket and thought "what the heck" and simply ignored it.

I have plans to release an updated version over the next month or two and it will include a fix for these bugs.

Geoff
Geoff Graham - http://geoffg.net
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 08:30pm 27 Nov 2023
Copy link to clipboard 
Print this post

Ok Geoff.

I'm not actually doing anything practical with it at the present time, just letting the Pico running on it's own seeing what happens & trying to learn stuff (including what day of the week it is).

I did change the Auto refresh times to Minutes. Easier to interpret that a string of seconds.

Yes, MM Edit is extremely valuable but we won't tell Jim that.

Awaiting the next update.

Brian
ChopperP
 
     Page 5 of 5    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024