|
raspberry
2019年12月1日 星期日
test
2018年8月8日 星期三
用一片sd卡建立media center
原來是早就有的東西,
手機,電腦各作業系統都有,但連網速度很慢,連看youtube都連不上,
我看是不要用好了。
參考網址
https://learn.adafruit.com/raspberry-pi-as-a-media-center/overview
燒錄好sd卡後開機,有參數要先設訂,選單點的方法和windows的操作不一樣,慢慢適應。
語言先選English(US)才好,因為選了中文,
結果進入後的選單都是亂碼,不知如何操作。
勉強一個個選單查看,才找到語言設定,改成英語。
後續操作還在摸索。(2018009)
2018年8月5日 星期日
2018年8月3日 星期五
作業系統(SD卡)燒錄
參考:
http://yhhuang1966.blogspot.com/2017/02/raspbian.html
因為不明原因,網路完全不通了,所以要將這張SD卡重新燒image檔,但因被分割了,所以燒不成,來此網站,參考將SD卡重新格式化,就可以了。
http://yhhuang1966.blogspot.com/2017/02/raspbian.html
因為不明原因,網路完全不通了,所以要將這張SD卡重新燒image檔,但因被分割了,所以燒不成,來此網站,參考將SD卡重新格式化,就可以了。
2018年7月27日 星期五
2018年7月21日 星期六
raspberry-gpio-python雜記
★GPIO.RISING 正緣觸發參數 GPIO.FALLING 負緣觸發參數
★中斷 軟體中斷才會耗用CPU資源,又叫做系統呼叫。
到底是raspberry Pi 板子本身就有硬體中斷,還是GPIO做出軟體中斷?
★有關input 上/下拉電阻,event_detect,debouce...
★參考https://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage/
★中斷 軟體中斷才會耗用CPU資源,又叫做系統呼叫。
到底是raspberry Pi 板子本身就有硬體中斷,還是GPIO做出軟體中斷?
★有關input 上/下拉電阻,event_detect,debouce...
★參考https://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage/
GPIO.setmode(GPIO.BOARD) # or GPIO.setmode(GPIO.BCM)
mode = GPIO.getmode()GPIO.setwarnings(False)GPIO.setup(channel, GPIO.IN)GPIO.setup(channel, GPIO.OUT)GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)----------------------------chan_list = [11,12] # add as many channels as you want! # you can tuples instead i.e.: # chan_list = (11,12) GPIO.setup(chan_list, GPIO.OUT)-----------------------------取得值GPIO.input(channel)設定值GPIO.output(channel, state)多組設定chan_list = [11,12] # also works with tuples GPIO.output(chan_list, GPIO.LOW) # sets all to GPIO.LOW GPIO.output(chan_list, (GPIO.HIGH, GPIO.LOW)) # sets first HIGH and second LOWpitch_s = raw_input("Enter Pitch 200 to 2000): ") duration_s = raw_input("Enter Duration second): ")清除所有腳位,恢復初始狀態GPIO.cleanup()也可以只清部份GPIO.cleanup(channel) GPIO.cleanup( (channel1, channel2) ) GPIO.cleanup( [channel1, channel2] )取得軟硬體資訊★有提示的輸入GPIO.RPI_INFOGPIO.RPI_INFO['P1_REVISION'] GPIO.RPI_REVISIONGPIO.VERSION★def mycallback(channel): print("Button pressed")在上面中參數channel沒有作用,但不可以除去,否則會有runtime error,一定至少要有一個參數,在這裡至於給什麼,都可以。
★def buzz(pitch, duration) : 頻率 時間
period = 1.0 / pitch period 是週期,振動一次花的時間
half_period = period / 2
cycles = int(duration * pitch) 頻率 X 時間 = 總共振動的次數
for i in xrange(cycles) :
GPIO.output(buzzer_pin, GPIO.HIGH)
time.sleep(half_period)
GPIO.output(buzzer_pin, GPIO.LOW)
time.sleep(half_period)
linux 指令筆記
- python abc.py & 會使程式背景執行
- ps和top https://blog.gtwang.org/linux/ps-top-find-processes-by-cpu-memory-usage/
- find 指令 https://blog.miniasp.com/post/2010/08/27/Linux-find-command-tips-and-notice.aspx
- rm 指令,刪檔 https://www.phpini.com/linux/rm-delete-files-directory-command
- mv 移動檔案、目錄,可以順便改名
- cp 就是copy
訂閱:
意見 (Atom)
