Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino without PC #19

Closed
BodnaBersch opened this issue Feb 16, 2022 · 4 comments
Closed

Arduino without PC #19

BodnaBersch opened this issue Feb 16, 2022 · 4 comments
Assignees
Labels
Grove_4Digital_Display Label for Grove_4Digital_Display UAY Unassigned yet

Comments

@BodnaBersch
Copy link

I coded a program but it is only working with the PC connected. If the PC isn`t connected the Timer doesn´t work properly it only counts up to 2 or 3. I Have no Idea.

[ADUINO UNO R3]
main.zip
image
image

@Combinacijus
Copy link
Contributor

I have a few notes not sure if thiese would fix your problem tho

  1. Sensor() uses pulseIn() function which is blocking this might block execution or atleast make it slower if no pulse is detected. So maybe try commenting line 37
  2. Timer() counts seconds by sleeping for 1000ms which is not accurate because you don't take into account time it takes to run code (especially unknown pulseIn blocking time). For this I would adapt ideas from non blocking sleep sketch. Basically to use millis() or micros() to check if 1sec have passed.
  3. Line 100 and 102 don't mix bool with int. Technically it works but readability is worse
  4. If nothing works I would keep only Timer() inside loop() without any if statement to rule out any mistakes in those

@lakshanthad
Copy link

Hello @BodnaBersch,

Have you followed the tips from @Combinacijus? Any updates on the issue now?

Thank you.

@MatthewJeffson MatthewJeffson added UAY Unassigned yet Grove_4Digital_Display Label for Grove_4Digital_Display labels Oct 9, 2024
@Lesords Lesords self-assigned this Oct 15, 2024
@Lesords Lesords assigned ackPeng and unassigned Lesords Oct 16, 2024
@ackPeng
Copy link

ackPeng commented Oct 16, 2024

@BodnaBersch Hi, does this problem still exist?

@Lesords
Copy link
Contributor

Lesords commented Oct 30, 2024

Hello,

I'm going to close this issue, feel free to re-open it if you have any other questions.

[Autocommentary]

@Lesords Lesords closed this as completed Oct 30, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PR Assemble Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Grove_4Digital_Display Label for Grove_4Digital_Display UAY Unassigned yet
Projects
Status: Done
Development

No branches or pull requests

6 participants