当前位置: 首页 > wzjs >正文

闵行网站建设多久能见效果做空的网站有哪些

闵行网站建设多久能见效果,做空的网站有哪些,网上买保险网站,阿里云 wordpress 教程目录 参考资料开机led控制GPIO输入输出 参考资料 链接: BeagleBone Black使用(一):狗板简介 链接: 使用Beaglebone Black的IO口 开机 直接用usb连接到电脑上,这是个otg口,虚拟成了网卡: 网口登录&…

目录

  • 参考资料
  • 开机
  • led控制
  • GPIO输入输出

参考资料

链接: BeagleBone Black使用(一):狗板简介

链接: 使用Beaglebone Black的IO口

开机

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

直接用usb连接到电脑上,这是个otg口,虚拟成了网卡:
在这里插入图片描述

网口登录:
Debian GNU/Linux 10 beaglebone ttyS0

BeagleBoard.org Debian Buster IoT Image 2020-04-06

Support: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]
默认用户名密码:debian:temppwd

在这里插入图片描述
串口登录(串口可以直接荣root登录 root|root):
在这里插入图片描述
在这里插入图片描述

led控制

开启

 echo none > /sys/class/leds/beaglebone:green:usr3/trigger && echo 1 > /sys/class/leds/beaglebone:green:usr3/brightness

关闭

 echo none > /sys/class/leds/beaglebone:green:usr3/trigger && echo 0 > /sys/class/leds/beaglebone:green:usr3/brightness

python代码:

#!/usr/bin/python
#//
#	blink.py
#	Blinks one LED wired to P9_15.
#	Wiring:	P9_15 connects to the plus lead of an LED.  The negative lead of the
#			LED goes to a 220 Ohm resistor.  The other lead of the resistor goes
#			to ground.
#	Setup:	
#	See:	
#//
import Adafruit_BBIO.GPIO as GPIO
import timeout = "P9_15"GPIO.setup(out, GPIO.OUT)while True:GPIO.output(out, GPIO.HIGH)time.sleep(0.5)GPIO.output(out, GPIO.LOW)time.sleep(0.5)

c代码:


//	blinkLED.c
//      Blinks the USR3 LED.
//	Wiring:	None
//	Setup:	
//	See:	

#include <stdio.h>
#include <unistd.h>int main() {FILE * trigger = fopen("/sys/class/leds/beaglebone:green:usr3/trigger", "w");FILE * brightness = fopen("/sys/class/leds/beaglebone:green:usr3/brightness", "w");int on = 0;fprintf(trigger, "none\n");while(1) {fprintf(brightness, "%d\n", on);fflush(brightness);if(!on) on = 1;else on = 0;usleep(500000);}
}

//	ring.pru0.c
//      Does the "Ring Test" given here: https://pub.pages.cba.mit.edu/ring/
//	Reads P8_19 and writes it to P9_16 as fast as it can.
//	Wiring:	P9_16 connects to the plus lead of an LED.  The negative lead of the
//			LED goes to a 220 Ohm resistor.  The other lead of the resistor goes
//			to ground (P9_1 or P9_2).
//			Wire P8_19 to P9_16 to produce the 'ring' circuit.
//              A Switch goes to P8_19 and 3.3V  (P9_3 or P9_4).
//	Setup:	config_pin P9_16 pruout and config_pin P8_19 to pruin
//	See:	prugpio.h to see which pins attach to R30
//	PRU:	pru0

#include <stdint.h>
#include <pru_cfg.h>
#include <pru_ctrl.h>
#include <stddef.h>
#include <rsc_types.h>
#include "resource_table_empty.h"
#include "prugpio.h"volatile register unsigned int __R30;
volatile register unsigned int __R31;void main(void) {/* Read GPIO input P9_25 and invert to GPIO output P9_29 */while(1) {if(__R31 & P8_19)__R30 = 0;else__R30 = P9_16;}
}

GPIO输入输出

root@beaglebone:~# cd /sys/class/gpio
root@beaglebone:/sys/class/gpio# ls -l
total 0
--w------- 1 root root 4096 Jan  1 00:00 export
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96
--w------- 1 root root 4096 Jan  1 00:00 unexport
root@beaglebone:/sys/class/gpio# echo 44 > export
root@beaglebone:/sys/class/gpio# ls -l
total 0
--w------- 1 root root 4096 Jan  1 00:03 export
lrwxrwxrwx 1 root root    0 Jan  1 00:03 gpio44 -> ../../devices/virtual/gpio/gpio44
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64
lrwxrwxrwx 1 root root    0 Jan  1 00:00 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96
--w------- 1 root root 4096 Jan  1 00:00 unexport
root@beaglebone:/sys/class/gpio# cd gpio44
root@beaglebone:/sys/class/gpio/gpio44# ls -l
total 0
-rw-r--r-- 1 root root 4096 Jan  1 00:03 active_low
-rw-r--r-- 1 root root 4096 Jan  1 00:03 direction
-rw-r--r-- 1 root root 4096 Jan  1 00:03 edge
drwxr-xr-x 2 root root    0 Jan  1 00:03 power
lrwxrwxrwx 1 root root    0 Jan  1 00:03 subsystem -> ../../../../class/gpio
-rw-r--r-- 1 root root 4096 Jan  1 00:03 uevent
-rw-r--r-- 1 root root 4096 Jan  1 00:03 value
root@beaglebone:/sys/class/gpio/gpio44# cat direction
in
root@beaglebone:/sys/class/gpio/gpio44# echo out > direction
root@beaglebone:/sys/class/gpio/gpio44# cat direction
out
root@beaglebone:/sys/class/gpio/gpio44# cat value
0
root@beaglebone:/sys/class/gpio/gpio44# echo 1 > value
root@beaglebone:/sys/class/gpio/gpio44# cat value
1

解释一下,首先要把某个(本例中是第44个,即P8_12)gpio export一下,变成用户可用的状态,然后目录里就会多出来一个gpio44目录,进入它对相应文件进行读写就可以操作io口了。输入输出是一样的道理。读的话Linux会自动实时更新value文件里的数据,但更新速度有多快暂时还不清楚,高速io操作的话用这种方法感觉不靠谱。不过速度不敏感的话是没问题的。


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h> //define O_WRONLY and O_RDONLY
#define SYSFS_GPIO_DIR "/sys/class/gpio"
#define MAX_BUF 64void main()
{int fd, len;char buf[MAX_BUF];char ch;int i;//export gpio44fd = open(SYSFS_GPIO_DIR "/export", O_WRONLY);len = snprintf(buf,sizeof(buf),"44");write(fd,buf,len);close(fd);//set directionsnprintf(buf,sizeof(buf),SYSFS_GPIO_DIR"/gpio44/direction");fd = open(buf, O_WRONLY);write(fd, "in", 3);close(fd);//read and print value 10 timesfor(i=0;i<10;i++){snprintf(buf,sizeof(buf),SYSFS_GPIO_DIR"/gpio44/value");fd = open(buf, O_RDONLY);read(fd,&ch,1);printf("%c\n",ch);close(fd);usleep(1000000);}
}

在这里插入图片描述
查看引脚输入状态(空闲高电平3.3V输出1, 接GND输出 0)

root@beaglebone:/sys/class/gpio# cd gpio44/
root@beaglebone:/sys/class/gpio/gpio44# ls
active_low  device  direction  edge  label  power  subsystem  uevent  value
root@beaglebone:/sys/class/gpio/gpio44# cat direction
in
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44# echo out > direction
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44# cat direction
out
root@beaglebone:/sys/class/gpio/gpio44# cat value
0
root@beaglebone:/sys/class/gpio/gpio44#
root@beaglebone:/sys/class/gpio/gpio44# echo 1 > value
root@beaglebone:/sys/class/gpio/gpio44# echo 0 > value
root@beaglebone:/sys/class/gpio/gpio44# cd ../gpio6
gpio60/ gpio61/ gpio62/ gpio63/ gpio65/ gpio66/ gpio67/ gpio68/ gpio69/
root@beaglebone:/sys/class/gpio/gpio44# cd ../gpio68/
root@beaglebone:/sys/class/gpio/gpio68# cat value
1
root@beaglebone:/sys/class/gpio/gpio68# cat direction
in
root@beaglebone:/sys/class/gpio/gpio68# cat direction
in
root@beaglebone:/sys/class/gpio/gpio68# cat value
0
root@beaglebone:/sys/class/gpio/gpio68# cat value
1

在这里插入图片描述


文章转载自:

http://vq8mC56M.mxnfh.cn
http://ptFVAu8Q.mxnfh.cn
http://HKPfoonk.mxnfh.cn
http://GclXmu0B.mxnfh.cn
http://gVzR6AYA.mxnfh.cn
http://poSwqjLX.mxnfh.cn
http://TDaNLs1G.mxnfh.cn
http://ATryOM57.mxnfh.cn
http://YjaAked6.mxnfh.cn
http://RE4XiS3G.mxnfh.cn
http://Qcsdr6Hg.mxnfh.cn
http://HvaJi6QF.mxnfh.cn
http://TH0yV0eV.mxnfh.cn
http://v9l9ttCT.mxnfh.cn
http://kasW92tR.mxnfh.cn
http://qkWZIL3k.mxnfh.cn
http://QbMzIQS3.mxnfh.cn
http://w7rdnr8Z.mxnfh.cn
http://xO47QAqa.mxnfh.cn
http://l25GYyTi.mxnfh.cn
http://Gj0S67cw.mxnfh.cn
http://ED0XEHv9.mxnfh.cn
http://z3r2YuRn.mxnfh.cn
http://zA659PL9.mxnfh.cn
http://0uVocF2U.mxnfh.cn
http://VKoqtgbj.mxnfh.cn
http://ENQ2xV0t.mxnfh.cn
http://elOTUY2U.mxnfh.cn
http://Dg1EYd89.mxnfh.cn
http://A5Dvd0Hp.mxnfh.cn
http://www.dtcms.com/wzjs/749153.html

相关文章:

  • 网站建设成为咨询公司起名用字大全
  • 建立网站大概需要多少钱怎么在网站上做360全景图片
  • 它是企业整体太原seo排名外包
  • 自己怎么建个网站赚钱做网站工作条件
  • 河北省住房和城乡建设厅的网站网站建设付款页面
  • 自由策划网站建设东莞营销型网站建设公司
  • linux网站建设技术指南 pdf中天控股集团有限公司
  • 大型网站故障企业网站建立流程的第一步是
  • 付银行的网站建设费的会计科目做照片模板下载网站好
  • 做粉丝网站会侵权吗南京市溧水区建设局网站
  • 淘宝网的网站设计特色本地邵阳网站建设
  • 陕西省信用建设官方网站网站支付方案的设计
  • 如何在手机上制作网站wordpress more-link
  • php网站开发教学网站建设经验分享
  • 聚享游网站如何做推广如何制作网站的app
  • 公司做网站推广有没有用邯郸网站建设唯辛ls15227
  • 怎么用手机做网站平台2008 iis asp配置网站
  • 手机上可以创建网站吗合肥市住房和城乡建设局网站
  • 怎么自己搭建博客网站源码时代
  • 企业网站留言阿坝网站制作
  • 南京 高端网站建设seo实训总结
  • 教育门户网站模板搜索引擎排名查询
  • 阿里云备案网站备案系统开发流程8个步骤
  • 网站界面设计应该遵循的原则长沙网站搭建seo
  • 宁波网站推广运营注册100万的公司一年缴纳多少税
  • 建个企业网站网页设计的背景与意义
  • 网站运营教程wordpress code theme
  • 湖南省工程建设信息官方网站合肥网站建设服务公司
  • 广东企业网站建设报价十大免费游戏网站点开即玩
  • 网站谷歌地图提交上海seo服务