{"id":25388744,"url":"https://github.com/artembotnev/sunsimulation","last_synced_at":"2026-04-26T23:31:06.049Z","repository":{"id":182299383,"uuid":"153336835","full_name":"ArtemBotnev/SunSimulation","owner":"ArtemBotnev","description":"Sunrise - sunset arduino emulation library","archived":false,"fork":false,"pushed_at":"2019-11-11T15:04:43.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-09T21:42:54.789Z","etag":null,"topics":["arduino-library","esp32","time"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtemBotnev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-10-16T18:46:11.000Z","updated_at":"2025-02-09T18:27:31.000Z","dependencies_parsed_at":"2023-07-19T13:44:18.402Z","dependency_job_id":null,"html_url":"https://github.com/ArtemBotnev/SunSimulation","commit_stats":null,"previous_names":["artembotnev/sunsimulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArtemBotnev/SunSimulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2FSunSimulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2FSunSimulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2FSunSimulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2FSunSimulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtemBotnev","download_url":"https://codeload.github.com/ArtemBotnev/SunSimulation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2FSunSimulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32317162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-library","esp32","time"],"created_at":"2025-02-15T13:38:32.967Z","updated_at":"2026-04-26T23:31:06.032Z","avatar_url":"https://github.com/ArtemBotnev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Emulation library of light day regimen (sunrise – sunset) for Arduino.\nIt supports smooth increase/decrease of brightness according to established duration.\n### For what?\nThis functionality can be useful in projects on birdhouse automatization.\nFor example: regulation light day in hen-house or wakening parrots.\nDuring smooth change of brightness, birds don’t feel stress.\n### How does it work?\nDeclare regimen:\n```c++\nSunSimulation *s;\n```\nFirst of all we should define time of sunrise and sunset, best place for it is setup() function:\n```c++\n//sunrise time 6:15 am\n// 6 — sunrise hour\n// 15 – minutes\n// sunrise duration 40 minutes\nTimeSet *sunrise = new TimeSet(6, 15, 40);\n\n// sunset time 8:42 pm\nTimeSet *sunset = new TimeSet(20, 42, 50);\n```\nNext step is create regimen and initialize it:\n```c++\ns = new SunSimulation(sunrise, sunset);\ns-\u003eregimenInit();\n```\nFunction regimenInit() returns string, which reports about successful or wrong initialization. We can check it:\n```c++\nString message = s-\u003eregimenInit();\nSerial.println(message);\n```\nNow in loop() function we can change variable which responsible for light brightness according to current time.\n```c++\n// 6 – current hour\n// 35 – current minute\n// 43 – current second\n// br – our brightness value\n\ns-\u003echangeBrightness(6, 35, 43, \u0026br);\nSerial.println(br);\n```\nAlso we can change our previous regimen during loop() run:\n```c++\ns-\u003ereloadRegimen(newSunrise, newSunset);\n```\nNote: \u003cbr\u003e\nWe can use another constructor and set brightness variable pointer once.\nAnd then invoke changeBrightness with only three parameters.\n\n```c++\n// second constructor\ns = new SunSimulation(sunrise, sunset, \u0026br);\n\ns-\u003echangeBrightness(6, 35, 43);\n```\n\nFor more details see example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembotnev%2Fsunsimulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartembotnev%2Fsunsimulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembotnev%2Fsunsimulation/lists"}