Add raspberry pi power control pin

This commit is contained in:
Pierrick C 2018-09-15 08:12:54 +02:00
parent 4ed3310042
commit ea15123df4
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,7 @@ import time
import gc import gc
import rtc import rtc
import board import board
from digitalio import DigitalInOut, Direction
from busio import UART from busio import UART
# import micropython # import micropython
import neopixel import neopixel
@ -75,6 +76,11 @@ NEOPIXEL_MAX_VALUE = 70 # max value instead of brightness to spare some mem
gc.collect() gc.collect()
# micropython.mem_info() # micropython.mem_info()
#Set ENable pin for Raspberry power microcontrol
RPI_EN = DigitalInOut(board.D9)
RPI_EN.direction = Direction.OUTPUT
RPI_EN.value = True
# Enable RTC of the feather M0 board # Enable RTC of the feather M0 board
CLOCK = rtc.RTC() CLOCK = rtc.RTC()