lcm电子工程师是做什么的
时间: 2023-06-04 20:07:43 浏览: 52
lcm电子工程师主要从事电子产品的设计、开发、测试、制造和维护等工作。他们主要研究和掌握数字电路、模拟电路、信号处理、微处理器、嵌入式系统、电源电路、通信电路、自动化控制等方面的知识和技能,以实现电子产品的高效、稳定和可靠运行。
相关问题
用的是LCM1602液晶显示屏
好的,那么我稍微修改一下代码,以适配 LCM1602 液晶显示屏:
```
#include "reg52.h"
#define uchar unsigned char
#define uit unsigned int
sbit RS=P2^6;
sbit RW=P2^5;
sbit E=P2^7;
uchar code hanzi[] = {
0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10, /* 南 */
0x10,0x10,0x10,0x10,0xFF,0x00,0x00,0x00, /* 信 */
0x40,0x20,0x10,0x08,0x04,0x03,0x00,0x00, /* 大 */
0x10,0x08,0x04,0x02,0xFF,0x00,0x00,0x00, /* 欢 */
0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x10, /* 迎 */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 空格 */
};
void delay(uit ms)
{
uit i,j;
for(i=ms;i>0;i--)
{
for(j=110;j>0;j--);
}
}
void w_com(uchar com)
{
RS=0;
RW=0;
E=1;
P0=com;
E=0;
delay(1);
}
void w_dat(uchar dat)
{
RS=1;
RW=0;
E=1;
P0=dat;
E=0;
delay(1);
}
void lcd_ini(void)
{
delay(15); // 液晶屏上电后需要等待15ms以上
w_com(0x38);
delay(5);
w_com(0x38);
delay(5);
w_com(0x38);
delay(5);
w_com(0x0c);
delay(5);
w_com(0x01);
delay(5);
w_com(0x06);
delay(5);
}
void main(void)
{
uchar i, j;
lcd_ini();
w_com(0x80);
for(i=0;i<6;i++) // 显示“南信大欢迎你”
{
for(j=0;j<8;j++)
{
w_dat(hanzi[i*8+j]);
}
}
while(1)
{
;
}
}
```
在 LCM1602 液晶显示屏上电后需要等待15ms以上,所以我将延迟时间增加到了15ms。另外,液晶屏的初始化需要连续写入3次0x38,每次之间需要间隔5ms以上。
python lcm
LCM (Least Common Multiple) in Python can be calculated using the following code:
```python
def lcm(a, b):
"""Function to calculate the LCM of two numbers"""
# Find the greater number among a and b
max_num = max(a, b)
# Loop until we find the LCM
while True:
if max_num % a == 0 and max_num % b == 0:
lcm = max_num
break
max_num += 1
return lcm
# Example usage
num1 = 4
num2 = 6
result = lcm(num1, num2)
print("The LCM of", num1, "and", num2, "is", result)
```
In this example, the `lcm()` function takes two numbers as input and finds the LCM by iterating from the greater number until it finds a number that is divisible by both input numbers.