In the last question I asked how to get the value from the output from serial.
In this we got this code:
import serial import re import time port = serial.Serial(port = "/dev/ttyAMA0", baudrate = 115200, timeout = 1) def send_serial(): cde = "t\r" port.write(cde.encode('ascii')) results = re.findall(r'(\d+)x(\d+)p(\d+)', port.read(9999)) print results I get in this [('1920', '1080', '60'), ('1920', '1080', '60')]
There are two missing values.
HDMI IN CH1 1920x1080p60 RGB HDMI IN CH2 640x 480p60 RGB HDMI OUT 1920x1080p60 RGB Also interested in how to format the output in different variables. Well, it's also interesting how to get data from such a list.
HDMI IN CH1 VP IN CH1 interlaced 0 - hstart 148 141 active width 1920 1920 vstart 36 36 active height 1080 1080 total width 2200 2199 total height 1125 1120 field rate 60 60 piclk 148507000 147840000 hsync 44 - vsync 5 - colorspace RGB LIMITED - HDMI IN CH2 VP IN CH2 interlaced 0 - hstart 48 65529 active width 640 0 vstart 33 8191 active height 480 0 total width 800 799 total height 525 523 field rate 60 60 piclk 25203000 25104000 hsync 96 - vsync 2 - colorspace RGB LIMITED - HDMI OUT VP OUT active width - 1920 active height - 1080 total width 2200 2200 total height 1125 1125 active width - 1920 active height - 1081 color in RGB - color out RGB 444 YUV444/RGB hsync - 44 vsync - 5 it is also desirable to save all values such as "hstart" and "vstart" into separate variables. The name of the values can be something like this, hdmi_in_chn1_1, hdmi_in_chn1_2, hstart_1, hstart_2 and so on.
findall()so that all values return" 2- "format output to different variables" (which variables exactly?) 3- "how to get data from (new in a different format) line. " Try to limit your questions to one question, so that your questions are more likely to help someone else (if you just put all your current problems with programming in the question form, then no one else except you will be helped by answers to such questions). - jfs