Since most of articles on the internet was talking about using RTC and using Serial connection to keep the time synched and none of them told me about how to actually use serial connection and send whatever I want outside of Arduino IDE automatically, here's a script that will make a decent clock that is bound to your computer.
1. Program Arduino with SerialDisplay example.
2. Wire up display.
3. Write this code, changing the "COM18" part to the port Arduino is connected to.
@echo off
:a
set /p x="%time%" <nul >\\.\COM18
timeout /t 1 >nul
goto a
4. Save this as (whatever).cmd/bat and leave it running.
5. Voila, it's working!! Or not.
If it doesn't work:
1. Have you checked what port Arduino is connected to? You are supposed to change the "COM18" part to the port Arduino is getting signal from.
2. Are you sure your Arduino is actually connected? Try different USB ports.
3. Are you using battery power? This requires constant connection to your computer.
Note: RX LED should flash once a second.
No comments:
Post a Comment