in python 3
import serialfrom time import sleepserial_port = # You need to put the correct port# Read from serial ser and return the string that was readdef read_BLE(ser):# Write your code here# Write the string, command, to serial ser; return nothingdef write_BLE(command, ser):# Write your code here# Open the serial port and when successful, execute the codethat followswith serial.Serial(port=serial_port, baudrate=9600, timeout=1)as ser:# Set the name of the HM-10 module# Print the response from the BLE module# Ask for the name from the HM-10 module# Print the response from the BLE module
Solution