共 7 篇文章 |
|
让golang在Raspberry Pi上飞一会。Golang的文档上说是支持多平台的,其中也包括了ARM,看来有戏了,兴冲冲打开http://code.google.com/p/go/downloads/list (golang编译器的下载页面) ,却发现没有arm平台的二进制大包下载。以上过程只是在Rapsberry上编译golang的编译器,如果我们只想在Raspberry上运行go语言编写的程序,那大可不用这样子... 阅222 转0 评0 公众公开 18-03-15 16:58 |
C screen_chan -1 //refresh current screen every 5 seconds }}func loop_update_display() { current_screen := 0 for screen := range screen_chan { if screen >= 0 { if screen != current_screen { //btn pushed current_screen = screen display_loading() } } switch current_screen { case 0: display_screen0() case 1: display_... 阅843 转0 评0 公众公开 18-03-15 16:58 |
// 风扇端口 func fWrite(status string){ fio.Output() if status == ''''''''high''''''''{ fio.High() }else if status == ''''''''low''''''''{ fio.Low() } }// 监控端口 f... 阅131 转0 评0 公众公开 18-03-15 16:56 |
【golang】golang实现GPIO控制。在go里mmap之后返回的是一个数组,而不是一个指针,并且go的数组指针指向的并不是数组的首地址,所以不能直接对指针赋值来改变寄存器的值,而是直接对数组赋值达到这个效果。经过几次的调试,最后得到确认,数组的[0]才是对应的DR,[1]是DDR,因为数据已经从8位转换为32位了,所以数组[0][1]才是我要控制的GPIO_... 阅1165 转4 评0 公众公开 18-03-15 16:55 |
然而在 Go 中:func main() { char := ''?'' fmt.Println(len(char)) // 3}如果你的 interface 变量的值是跟随其他变量变化的(雾),与 nil 比较相等时小心:func main() { var data *byte var in interface{} fmt.Println(data, data == nil) // true fmt.Println(in, in == nil) // true in = data fmt.Println(in, in ==... 阅281 转1 评0 公众公开 18-03-15 16:54 |
src.cpp 源码#include ''''''''src.hpp''''''''#include cxxFoo::cxxFoo(std::string name){ this->name = name;}cxxFoo::~cxxFoo(){}std::string cxxFoo::get_name(){ return this->name;}void cxxFoo::set_name(std::string name){ this->name = name;} 阅337 转0 评0 公众公开 18-03-15 16:54 |