پاسخ : کد دستوری بجای Debounce
میشه برنامه رو اگه میدونین کامل واسم بذارین ؟
نوشته اصلی توسط tifoos
Config PortA = Input Dim A As Byte Cursor On Do waitus 30 If PinA.1 = 0 Then waitms 100 Incr A If A > 20 Then '2 second interopt =100m*20 cls Locate 1 , 1 : Lcd "amin" End If End If If Pina.1 = 1 Then A=0 cls End If loop
$regfile = "m16def.dat" $crystal = 8000000 Config Porta = Output Config Portb = Input Porta = &H00 Portb = &HFF '---------------------------- Dim X As Bit Dim Y As Byte X = 0 Y = 0 '---------------------------- Do If Pinb.0 = 0 And X = 0 Then X = 1 Y = Y + 1 Porta = Y End If If Pinb.0 = 1 And X = 1 Then X = 0 Loop End 'end program
Config PortA = Input Dim A As Byte Cursor On Do waitus 30 If PinA.1 = 0 Then waitms 100 Incr A If A > 20 Then '2 second interopt =100m*20 cls Locate 1 , 1 : Lcd "amin" End If End If If Pina.1 = 1 Then A=0 cls End If loop
$regfile = "m16def.dat" $crystal = 8000000 Config Porta = Output Config Portb = Input Porta = &H00 Portb = &HFF '---------------------------- Dim X As Bit Dim Y As Byte X = 0 Y = 0 '---------------------------- Do If Pinb.0 = 0 And X = 0 Then X = 1 Y = Y + 1 Porta = Y End If If Pinb.0 = 1 And X = 1 Then X = 0 Loop End 'end program
دیدگاه