树莓派安装编译opencv
一、python2.7
出现以下错误,则需要更换源。
nano是ubuntu系统自带的编辑器。
#更换更新源和下载源
sudo nano /etc/apt/sources.list
#更换镜像 按ctrl+x进行保存退出
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.ustc.edu.cn/rasp
一、python2.7
出现以下错误,则需要更换源。
nano是ubuntu系统自带的编辑器。
#更换更新源和下载源
sudo nano /etc/apt/sources.list
#更换镜像 按ctrl+x进行保存退出
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.ustc.edu.cn/rasp
#1、安装中文字体
sudo apt-get install ttf-wqy-zenhei
#2、设置中文显示
sudo raspi-config
在菜单中找到设置语言的地方,选择zh_CN.UTF-8
提示: 按空格键在前面打勾或去掉勾,PageUp PageDown快速翻页,Tab键切换光标位置
#3、安装中文输入法
sudo apt-get install scim-pinyin
#4、重启生效
sudo reboot
&nb
1、build.gradle中dependencies引用。
implementation ‘org.apache.commons:commons-lang3:3.7’
2、
“{\”code\”:\”0\”,\”data\”:[{\”factweight\”:\”0.00\”,\”planweight\”:\”15.00\”,\”siteno\”:\”1\”,\”taskdate\”:\”2022-06-29 13:36:08\”,\”taskno\”:\”bi2022051
1、build.gradle中dependencies引用。
implementation ‘com.journeyapps:zxing-android-embedded:3.5.0’
2、Activity、Fragment区别。
Activity调用:
IntentIntegrator integrator = new IntentIntegrator(this);
Fragment调用:
IntentIntegrator integrator
下载地址:https://github.com/sknown/libghttp
./configure –enable-static –prefix=/home/jiang/code/libghttp/target_x86
make && make install
出现错误x86_64-unkown-linux-gun
需要安装libtool。
sudo apt-get install libtool
需要将config.guess和
下载地址:https://libmodbus.org/download/
一、交叉编译 libmodbus
为了使 ARM 工控板能使用 libmodbus 相关的功能,所以交叉编译 libmodbus。
目标:交叉编译工具编译 libmodbus 库,并将库及测试文件拷贝到工控板中进行测试。
将 libmodbus-3.1.7.tar.gz 压缩包上传到 ubuntu 系统的 libmodbus 目录下,解压。
在源码目录配置编译:
./configure –b
ubuntu 终端:
# 在主机上执行如下命令
sudo apt install gcc-arm-linux-gnueabihf
# 安装完成后使用如下命令查看版本
arm-linux-gnueabihf-gcc -v
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
printf(“Hello World http://chanpinxue.cn \n”);
pri
ubuntu-22.04-desktop 图形界面下操作非常的卡顿。
解决办法:在虚拟机关机状态下,进入虚拟机设置,取消 3D图形的勾选。
下载地址:https://cn.ubuntu.com/download/desktop
一、配置JDK
1、解压缩。创建软连接。
tar -zxvf jdk1.8.0_51.tar.gz
ln -s jdk1.8.0_51 jdk
2、配置环境变量。
vi ~/.bashrc
export JAVA_HOME=/home/hadoop/app/jdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib
3、使环境变量生效。
source ~/.bashrc
1、在每台服务器或虚拟机上配置hosts,命令行输入:
vi /etc/hosts
在其中添加所有服务器或虚拟机节点ip和对应的域名,如下图所示:
192.168.20.121 hadoop01
192.168.20.122 hadoop02
192.168.20.123 hadoop03
然后单击Esc键,退出编辑模式,再输入:wq 保存退出。
2、创建密钥文件(每台服务器上都需要执行)。输入完ssh-keygen – rsa后,一直默认Enter即可。
ssh
因为VMware Workstation Pro克隆虚拟机造成网卡地址不一致。
要确保以下4个地方显示的网卡地址保持一致。
虚拟机.vmx配置文件
ifconfig –a
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/udev/rules.d/70-persistent-net.rules
修改步骤如下:
1、确认vmx配置文件的mac地址。
ethernet0.generatedAddress = “00:0
防火墙:
CentOS 6.x:iptables
CentOS 7.x:firealld
数据库:
CentOS 6.x默认数据库是:MySQL
CentOS 7.x默认数据库是:MariaDB
时间同步:
CentOS 6.x:ntpdate us.pool.ntp.org
CentOS 7.x:chronyc sources
修改时区:
CentOS 6.x:cp -f /usr/share/zoneinfo/Asia/Shanghai /etc
1、点击“取消”,退出虚拟机程序运行。
2、在弹出窗口中找到存放Vmware虚拟机虚拟磁盘文件和配置文件,找到后缀为.lck文件夹。改名或者删除后缀为.lck的文件夹,或者移动其它文件夹暂时存放。
3、重新打开虚拟机就可以正常运行。
1、舵机红色线接开发板5V,棕色线接开发板GND,橙色信号线接开发板数字引脚9。
2、代码。
#include <Servo.h>
Servo myservo; // 定义Servo对象来控制
#define ServerPin 9
// 舵机 控制线 连接 数字9
#define PotentiometerPin A0 // 电位器 控制线 连接 A0
int i = 0; // 角度存储变量
void setup()
1、电机驱动模块采用 L9110。
2、代码。
const int IA = 7;
//
pin 7 connected to pin IA
const int IB = 8;
//
pin 8 connected to pin IB
byte speed = 255;
// change this (0-255) to control the speed of the motor
void setup() {
pinMode(IA, OU
1、称重模块采用HX711芯片。
2、代码。
#include “HX711.h” //调用24bitAD HX711库
HX711 HX711_CH0(2, 3, 345); //SCK,DT,GapValue
//SCK引脚用于arduino和HX711模块通讯的时序提供
//DT引脚用于从HX711读取AD的数据
//GapValue用于校准输出的重量值,如果数值偏大就加大该值,如果数据偏小就减小该值
int LED = 13;
long Wei
1、注意:Arduino Uno、Arduino Mega2650等板子的接法不同。
2、代码:本文使用的是Arduino Mega2650。
/*
* ——————————————————————————————————————–
* Example sketch/program showing how to re
1、注意:超声波模块的有效范围2cm-450cm(300cm以内)。超声波模块直接放在桌面上,距离小于2cm时,会出现数据不准确,例如1187.52cm。
2、代码:
#define TrigPin 2
#define EchoPin 3
float DistanceCM;
void setup()
{
Serial.begin(9600);
pinMode(TrigPin, OUTPUT);
pinMode(EchoPin, INPUT);