Python Forum
Using RTC time in Rasberry Pi Programs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using RTC time in Rasberry Pi Programs
#1
Good Day,

I need some advice on this. I am planning to generate pwm with different frequencies from a Rasberry Pi 5. I learnt that the Pi 5 has an RTC and it can be enabled by connecting the official 3 Volt rechargeable battery. Unfortunately this battery is out of stock for me.

I want to write a program in which I want to specify the time of the day at which the program starts to generate a pwm of say 110 Hz at 11:08 AM and it does until 12:04 PM. Then from 12:04 PM to 1:10 PM it generates a pwm at 316 Hz. Like this I want it to generate pwm of specific frequencies at different hours of the day for 24 hours.

Is it possible to write a program for this application in Python. Or which language is best for this type of programs. I will be keeping the Pi 5 powered on all the time with backup to generate pwm so it wouldn't go off power. I like to know if I can specify the clock time in the program exactly the time of the day instead of specifying the period of time in the program.

I am not an expert in programming I am just giving an approximate example

from time 11:08 to 12:04 Local Time
pwm start pin 14
frequency 110 Hz
Duty Cycle 50 percent
from time 12:05 to 13:10 Local Time
pwm start pin 14
frequency 316 Hz
Duty Cycle 50 percent
.
.
.
.
Is it possible to do this.

Thanks
Reply


Messages In This Thread
Using RTC time in Rasberry Pi Programs - by sab201 - Aug-18-2024, 08:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using print command to send command to rasberry pi terminal MondazeBear 2 2,683 Aug-02-2021, 03:15 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020