Search code examples
microcontrolleravrbasic

create switching blinker on the BASCOM


I want to create a switching blinker in BASCOM. I wrote this code for this:

$regfile = "m16def.dat"
$crystal = 1000000

Config Portc = &B11111111
Config Portd.0 = 0
Portd.0 = 1
Portc = &H00

Do
If Portd.0 = 1 Then
   Portc = &B11000011
   Waitms 500
   Portc = &H00
   Waitms 500
Else
   Portc = &B00111100
   Waitms 500
   Portc = &H00
   Waitms 500
End If
Loop

but the result is this in proteus: enter image description here

any help would be appreciated.


Solution

  • I read this then I changed If Portd.0 = 1 Then to If Pin = 1 Then and it works. I do not exactly why my first command didn't work!