Entries by อ.เอ้ด

millis() ใน arduino

แบบที่ 1

 

				
					unsigned long period = 1000; //ระยะเวลาที่ต้องการรอ
unsigned long last_time = 0; //ประกาศตัวแปรเป็น global เพื่อเก็บค่าไว้ไม่ให้ reset จากการวนloop
 
void setup() {
    Serial.begin(115200);
}
 
void loop() {
   
 if( millis() - last_time > period) {

     last_time = millis(); //เซฟเวลาปัจจุบันไว้เพื่อรอจนกว่า millis() จะมากกว่าตัวมันเท่า period 


     Serial.println("Hello arduinona!");
 }
   
}
				
			

ขอบคุณ: https://www.modulemore.com/article/3/%E0%B8%A5%E0%B8%94%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-delay-%E0%B8%AB%E0%B8%B1%E0%B8%99%E0%B8%A1%E0%B8%B2%E0%B9%83%E0%B8%8A%E0%B9%89-millis-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B8%94%E0%B8%B5%E0%B8%81%E0%B8%A7%E0%B9%88%E0%B8%B2

แนวที่ 2

				
					int period = 1000;
unsigned long time_now = 0;

void setup() {
Serial.begin(115200);
}

void loop() {
time_now = millis();

Serial.println(“Hello”);

while(millis() < time_now + period){
//wait approx. [period] ms
}
}
				
			

ติดตั้ง Teamviewer บน Raspberry PI OS

64 Bit Preview Version https://download.teamviewer.com/download/linux/teamviewer_arm64.deb 32 Bit Preview Version https://download.teamviewer.com/download/linux/teamviewer_armhf.deb ใช้คำสั่ง wget เช่น download 32 bits wget https://download.teamviewer.com/download/linux/teamviewer_armhf.deb sudo dpkg -i teamviewer-host_armhf.deb หรือ เรียกไฟล์ติดตั้งบน desktop

Express Auto Backup like VSS

crebkexp.bat

mkdir c:\expresstools
copy %~dp0. c:\expresstools
cd c:\expresstools
schtasks /create /f /sc ONSTART /tn “Express Backup Daily Autoupdate” /tr “cmd.exe /C \”%~dp0bkexpvssd.bat\” -log” /ru SYSTEM /delay 0000:10
schtasks /create /f /sc WEEKLY /d FRI /st 17:05 /tn “Express Backup Weekly Autoupdate” /tr “cmd.exe /C \”%~dp0bkexpvssw.bat\” -log” /ru SYSTEM
rem *** remove old SR add add new SR
schtasks /Delete /tn “Microsoft\Windows\SystemRestore\SR” /F
schtasks /Create /XML sr.xml /tn “Microsoft\Windows\SystemRestore\SR”
rem view volume id use volumelist.bat output vollist.txt
rem *** don’t forget cahnge volume id at bkexpvssd.bat bkexpvssw.bat ***
mountvol q: \?\Volume{35e857de-6db8-4582-bd58-4b0e531a7d8e}\
md q:\bkexp-d
md q:\bkexp-w
mountvol q: /D

bkexpvssd.bat

rem Volume id use volumelist.bat and put to line 2
mountvol Q: \?\Volume{35e857de-6db8-4582-bd58-4b0e531a7d8e}\
rem change Express to correct Drive\path
robocopy C:\EXPRESSI Q:\bkexp-d\EXPRESSI /xo /s /r:1 /w:1 /nfl /ndl /njh /njs /nc /ns /np
mountvol Q: /D

bkexpvssw.bat

rem Volume id use volumelist.bat and put to line 2
mountvol Q: \?\Volume{35e857de-6db8-4582-bd58-4b0e531a7d8e}\
rem change Express to correct Drive\path
robocopy C:\EXPRESSI Q:\bkexp-w\EXPRESSI /xo /s /r:1 /w:1 /nfl /ndl /njh /njs /nc /ns /np
mountvol Q: /D

volumelist.bat

mountvol >vollist.txt

SR.XML

<?xml version=”1.0″ encoding=”UTF-16″?>
<Task version=”1.6″ xmlns=”http://schemas.microsoft.com/windows/2004/02/mit/task”>
<RegistrationInfo>
<Source>Microsoft Corporation</Source>
<Author>Microsoft Corporation</Author>
<Description>This task creates regular system protection points.</Description>
<URI>\Microsoft\Windows\SystemRestore\SR</URI>
<SecurityDescriptor>D:(A;;GA;;;SY)(A;;GA;;;BA)(A;;FRFX;;;LS)</SecurityDescriptor>
</RegistrationInfo>
<Triggers>
<BootTrigger>
<Enabled>true</Enabled>
</BootTrigger>
<CalendarTrigger>
<StartBoundary>2021-08-19T17:10:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
<CalendarTrigger>
<StartBoundary>2021-08-19T12:10:51</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal id=”LocalSystem”>
<UserId>S-1-5-18</UserId>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>true</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<MaintenanceSettings>
<Period>P3D</Period>
<Deadline>P3DT1M</Deadline>
<Exclusive>true</Exclusive>
</MaintenanceSettings>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context=”LocalSystem”>
<Exec>
<Command>%windir%\system32\srtasks.exe</Command>
<Arguments>ExecuteScheduledSPPCreation</Arguments>
</Exec>
</Actions>
</Task>

Gnail POP/IMAP Outlook 2010

User Information Your Name: Name of you E-mail Address:Your E-mail Server Information Account type imap outgoing mail server (SMTP):smip.gmail.com Logon Information User Name:Your E-mail Password: Your Password More Outgoing Server My outgoing server (SMTP) requires authentication Use same settings as my Advanced Server Port Numbers Incoming server (IMAP) 993 Use the following type of encrypted […]

Outlook 2013 2016 2019 Search e-mail no results

Outlook 2013 2016 2019 link search Windows Search Check Windows Serach Service run automatic at Logon allow service to interact with desktop rebuild index File -> Options -> Search Index Options Index option diaglog find Microsoft Outlook ถ้ามี เลือก Advanced เลือก Rebuild ถ้าไม่เจอ ให้ ทำดังนี้ windows 10 , 11 ให้ไปที่ Update & Security เลือก Troubleshootเลือก […]

ESET Windows 7 Service pack KB

Install Eset on Windows 7 Service Pack 1 user patch KB4474419 for x86 http://download.windowsupdate.com/c/msdownload/update/software/secu/2019/09/windows6.1-kb4474419-v3-x86_0f687d50402790f340087c576886501b3223bec6.msu for x64 http://download.windowsupdate.com/c/msdownload/update/software/secu/2019/09/windows6.1-kb4474419-v3-x64_b5614c6cea5cb4e198717789633dca16308ef79c.msu and  KB4490628 for x86 http://download.windowsupdate.com/c/msdownload/update/software/secu/2019/03/windows6.1-kb4490628-x86_3cdb3df55b9cd7ef7fcb24fc4e237ea287ad0992.msu for x64 http://download.windowsupdate.com/c/msdownload/update/software/secu/2019/03/windows6.1-kb4490628-x64_d3de52d6987f7c8bdc2c015dca69eac96047c76e.msu