05. Micro Python SW - Automated St. Andrews crossing

Hi, MicroPython board set Use the MicroPython SW bellow in your project. Same software controls LEDs, barrier and Buzzer, just need to connect it as explained before. To load sw into pyboard first you need to copy code below in to a .txt on your PC using a notepad or simillar (I use notepad++ ). Save with name main.py Connect board via USB cable to PC, when external device ( pyboard ) is detected load the file into the root of the pyboard . You override the empty file already in the board with same name. Reset pyboard in the RST button. Test and adjust as bellow the v1.0 of the Python code explained. Updated version on post 04. Train crossing (part 2) - Automated barrier *** # turn on_off external LEDs, Servo and Buzzer on an external iR input, for a Train Crossing / St. Andrews Crossing # Libraries import time, pyb, machine, math from pyb import Pin, Servo, DAC from array import array def ACT_PN(x): pyb.LED(1).on() # internal ...