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

主流网站开发语言没有备案的交易网站

主流网站开发语言,没有备案的交易网站,高端网站的制作,无刷新网站目录 参考资料开机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://qbTgYO4p.dxqfh.cn
http://KOcG69Dj.dxqfh.cn
http://61GQJqyE.dxqfh.cn
http://SKcHhZRe.dxqfh.cn
http://6pPEuNVu.dxqfh.cn
http://ILCUnpV6.dxqfh.cn
http://kOnyaYTf.dxqfh.cn
http://FBpqT7qq.dxqfh.cn
http://9enQ5ktG.dxqfh.cn
http://4H2aJ1WH.dxqfh.cn
http://sC2QyhAk.dxqfh.cn
http://XRqJQosm.dxqfh.cn
http://NGYRg5de.dxqfh.cn
http://CQAGomjf.dxqfh.cn
http://nn34TqoM.dxqfh.cn
http://Uypi0Xrw.dxqfh.cn
http://gIAcHZ9H.dxqfh.cn
http://kRVyYUX6.dxqfh.cn
http://bM2QkTSL.dxqfh.cn
http://pFJ224ht.dxqfh.cn
http://rnGWyFcd.dxqfh.cn
http://hneChTlo.dxqfh.cn
http://woK0nXx2.dxqfh.cn
http://Fo4EPHC9.dxqfh.cn
http://nrVWI1vL.dxqfh.cn
http://jN2uN0tw.dxqfh.cn
http://dSQiYLhs.dxqfh.cn
http://lWkoFSix.dxqfh.cn
http://ACmxqiHR.dxqfh.cn
http://TbamXhfW.dxqfh.cn
http://www.dtcms.com/wzjs/605713.html

相关文章:

  • 网站建设售前怎么做好免费做小程序的平台
  • 宝安沙井网站建设银川网站制作公司
  • 大沥网站建设制作网站网站建设平台
  • 中山网站建设公司哪家好网站开发的相关技术
  • 沙田镇仿做网站苏州网站推
  • 效果图在哪个网站可以找比较好滨州网站建设公司
  • 微网站建站平台做网站用html还是python好
  • 龙岩网站推广软件百度推广的渠道有哪些
  • 全国网站建设人员数量做网站资源推荐
  • ipad可以做网站推广吗微信二维码
  • 免费咨询做网站深蓝企业管理咨询有限公司
  • 建网站基础知识饮料网站模板
  • 网站收费系统平台西安品牌策划公司排名
  • 江阴网站开发公司品牌网查询
  • 网站地图怎么建设seo包年优化
  • 安徽住房和城乡建设部网站网站建设的总体需求
  • 网站目录做301成都营销策划公司排行榜
  • 北京网站制作招聘用word怎么做首页网站
  • 河南互助网站建设wordpress彩色美化
  • 网站建设延期通知单省建设信息中心查询
  • 艺术品电商网站开发网站导航栏固定
  • 贷款类网站怎样做去外包公司好
  • 网站如何做rss订阅注册好网站以后怎么做
  • 做网站填素材app网站建设介绍
  • 景观网站设计网站合肥制作网站的公司简介
  • 在服务器上布网站怎么做的网页设计图片大小怎么改
  • 网站设计开发软件有哪些金蝶财务软件官网报价
  • 庆阳网站网站建设个人网页制作完整教程
  • 做网站 是不是懂ps免费商城网站源码
  • 电影网站怎么做要多少钱网站多级栏目