用 Sense HAT 做一個小遊戲

Sense HAT 的功能很強,今天介紹一個 project 做的一個小遊戲。

先安裝png libary

sudo pip3 install pypng

再裝程式

git clone https://github.com/jrobinson-uk/RPi_8x8GridDraw

切換目錄

cd RPi_8x8GridDraw

執行

sudo python3 sense_grid.py

img_2006

程式一開始 Sense HAT 的 8×8 LED 全是 off

img_2005

在畫面上先點選顏色,在指定位置,當你完成後,再按 Play grid

img_2007

img_2008

錄影

接下來介紹一款小遊戲

https://github.com/TeCoEd/Egg-Drop/find/master

下載 chick.png, egg.png 及 egg_drop_final.py

將這三個檔都移動到 RPi_8x8GridDraw 下

執行 sudo python3 egg_drop_final.py

來看錄影

玩玩看

 

 

PINE A64+ 開箱文– 續

PINE A64+ 可以外加藍芽及 Wifi 無線網卡

img_2016

再接上喇叭、鍵盤滑鼠、HDMI 、網路、MicroSD 、電源。img_2011

PINE A64+ 2G 的網路是 10/100/1000 ,但是經過測試 1000 跟 HUB 的相容性太低。建議用 100 或無線網路。

目前下載的系統可以使用的是 Remix 及 android。

讓大家嘗鮮 android

img_2012

img_2014

瀏覽器

img_2015

錄影

 

PINE A64+ 開箱文

PINE A64 它是世界上第一個 64-bit 1.2Ghz 的迷你電腦,它是一般電腦、平板電腦、多媒體中心等等。請上網站

PINEA64P_large

規格:

PINE64

目前它推出三款 512M, 1G, 2G

PINEA64P-1_largePINEA64-2GBPN_large

它可以外加 Bluetooth and Wifi 模組

PIC-1-2_large

介紹一款組裝:

PINE A64+ 正面

IMG_2000

背面

IMG_2001

底蓋

IMG_1999

螺絲由底往上穿過

IMG_1998

再將柱子鎖上

IMG_1997

將 PINE A64+ 對準四個小柱子,鎖上螺絲

IMG_1996

上蓋對準柱子,鎖上螺絲

IMG_1994

從底部觀看

IMG_1995

從上方觀看

IMG_1993

準備 MicroSD 卡,安裝系統。電源及 4K HDMI 線、網路線

IMG_6065-Edit_large

週邊可以外加的設備,藍芽鍵盤、RTC備用電池、鋰電池、擴充模組、藍芽及無線板、七吋螢幕、MicroSD、無線鍵盤滑鼠、遙控器、無線滑鼠、鏡頭模組

48c9e9c092a9714c8b438af050aa49df_original

 

Intel Edison使用篇四

擴充板可以疊加

SparkFun_Edison_Boards-16

一個 intel edison 可以同時接多個擴充板,還有固定柱及螺絲可以選擇

  • 10x Standoff – M2 x 3mm
  • 6x Phillips Head Screw – M2 x 3mm
  • 6x Nut – M2

 

13187-01

使用方式

Battery_Block_Tutorial-01

Pi block

  • USB Power – used to provide 5V to Pi Block and power the Edison. Note that the data lines are not connected to the Edison.
  • Power Button – The power switch is connected to the “PWRBTN” line on the Edison. This give the user the ability to place an Edison in sleep or power down the module completely. This does not affect power to other Blocks in the stack.
  • Power LED – The power LED illuminates when power is present on VSYS. This can come from the onboard USB Power or any other powered Block in the stack.
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield.
  • LED Jumper – If power consumption is an issue, cut this jumper to disable the power LED.
  • VSYS Jumper – By default, a USB cable must be attached to the USB Power port to provide power to the 5V pins on the RPi B Header. You can power the Edison and Pi Block from another Block (e.g. Base Block), but there will not be 5V on the pins labeled “5V”. By closing this jumper, you can power the Edison and Pi Block from another Block, and ~4.2V (VSYS) will appear on the pins labeled “5V”.
  • RPi B Header – Same configuration as the old Raspberry Pi Model B pinout

 

.

13044-01

GPIO block

  • Level Select – Jumper selects GPIO reference voltage, Can be set to 3.3v or VSYS
  • Power Pins – Raw access to power pins on Edison
    • GND – Ground pin for all blocks and Edison
    • VSYS – Raw input for Edison and all Blocks.
      • Normal output (with power blocks) 4.0V-4.1V.
      • You can power an Edison through this pin. Acceptable voltages 3.3V-4.5V
    • 1.8v – 1.8v supplied by Edison internal power supply
    • 3.3v – 3.3v supplied by Edison internal power supply
  • General GPIO – Genaral use GPIO pins.
  • GPIO/UART1 – GPIO pins that can also be used as a second UART. (Useful for GPS receivers and other serial devices)
  • GPIO/PWM – GPIO pins capable of generating PWM waveforms. (Useful for LED dimming and Motor control)
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield.

 

13038-04

Battery block

  • USB Micro B – Provides power to the stack and the ability to recharge the battery
  • Power Switch – Removes all power from the stack other power supplies may still power the stack
  • Power LED – Illuminated when power is available on VSYS line; This may illuminate if another block supplies power
  • Power LED Jumper – If power consumption is an issue, cut the jumper to disable LED
  • Charge LED – LED is illuminated while charging; LED is off if no charge power is present or charge is complete
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield.

 

13037-01

OLED block

  • Button Pin Mapping
  • Battery Supply
  • Input Jumpers

 

13035-01

 

Intel Edison使用篇三

Intel® Edison for Arduino

它有 USB host Type-A connector, Micro USB device, 還有 6 類比 inputs 及 20 數位 input/output , 1x UART, 1x I2C, and 1x ICSP 6-pin header (SPI) Power jack with 7V-15V DC input.

13097-02

還有擴充板很多種,先看 base block

  • USB OTG – The USB Micro AB port provides access to the Edison OTG port. This port is capable of providing power to an OTG device or power can be supplied to the Edison through this port.
  • Console – The Micro USB B port provides power and a console access port to an Intel Edison Stack. This Block supplies a voltage to the Edison and other Blocks through the VSYS line at 4V. This voltage may vary up to +/-0.1V depending on load.
  • Power Button – The power switch is connected to the “PWRBTN” line on the Edison. This gives the user the ability to place an Edison in sleep or power down the module completely. This does not affect power to other Blocks in the stack.
  • Power LED – The power LED illuminates when power is present on VSYS. This can come from the Console Block, or any other powered Block in the stack.
  • Data LEDs – The Data LEDs help the user identify if the console is active. This is a feature commonly found on our FTDI breakout.
  • LED Jumpers – If power consumption is an issue, cut each jumper to disable LEDs
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield.

 

13045-01

ADC block

  • Signal Inputs – Four single inputs are available. The reference voltage for each is produced internal to the ADC under software control; do not exceed 3.3V input to these pins!
  • Differential Channel Setting Table – Use two inputs to create a differential pair. Useful for eliminating noise in some sensors or measuring very small signals. This table shows the channel options for the “getDiffResult(channel)” function.
  • I2C Address Select – Apply solder to only one of the four jumpers to select the address. Do not short two of these at once. Bad stuff will happen.
  • I2C Bus Select – Change both of these jumpers to select between routing the I2C signals to bus 6 or bus 1. Bus 1 is the default (and preferred) channel, as it has no other system devices on it. Bus 6 is shared with some internal devices, but if you wish to use this block with the Arduino IDE, you’ll want to change these jumpers so the solder blobs connect the bottom pad with the center pad.
  • 3.3V 150mA Supply – This supply provides an on-board reference for the ADC, and can power small sensors (for example, potentiometers or temperature sensors).

 

13770-03

9DOF block

有3D 陀螺儀、加速器、G sensor 等

A (INT2) – Accelerometer/magnetometer interrupt 2. This pin can be configured to change on a number of different conditions. See datasheet pp 58 and 65-67 for more details on configuring the device. Closing this jumper with a solder blob connects the INT2 pin on the LSM9DS0 to GPIO 49 on the Edison.

B (INT1) – Accelerometer/magnetometer interrupt 1. This pin can be configured to change on a number of different conditions. See datasheet pp 58 and 63-65 for more details on configuring the device. Closing this jumper with a solder blob connects the INT2 pin on the LSM9DS0 to GPIO 48 on the Edison.

C (DRDYG) – Data Ready, gyroscope. Closing this jumper connects the pin to GPIO 47. See datasheet page 43 for information on configuring this pin.

D (INTG) – Gyroscope interrupt. This pin can be configured to change on a number of different conditions. Closing this jumper will connect the pin to GPIO 46. See datasheet pages 43 and 47-50 for information on configuring this pin.

E (DEN) – Data enable, gyroscope. Enable or !pause data collection. This pin can safely be ignored. Closing this jumper allows processor control of data collection via GPIO 165.

F (CLOCK/DATA) – I/O interface selection jumpers. Default setting is to I2C1 but cutting the small trace visible between the two upper pads of each jumper and closing the bottom two pads with a solder blob allow the user to route control to SPIDEV2. SPI is currently an unsupported feature and will likely be removed from a future revision.

G (CSG) – SPI chip select, gyroscope. Closing this jumper connects the signal to GPIO 111 on the Edison, which is FS0 on SPIDEV2. The CS pin can be either handled manually or by the driver. SPI is currently an unsupported feature and will likely be removed from a future revision.

H (CSXM) – SPI chip select, accelerometer/magnetometer. Closing this jumper connects the signal to GPIO 110 on the Edison, which is FS1 on SPIDEV2. The CS pin can be either handled manually or by the driver. SPI is currently an unsupported feature and will likely be removed from a future revision.

I (SDOG) – SPI serial data out (MISO), gyroscope. SPI is currently an unsupported feature and will likely be removed from a future revision.

J (SDOXM) – Serial data out (MISO), accelerometer/magnetometer. SPI is currently an unsupported feature and will likely be removed from a future revision.

K (I2C PUs) – Pull-up resistor removal for I2C SDA and SCL lines. Most likely, you won’t want to remove these resistors from the system; however, if you have a lot of devices on the I2C bus, you may need to remove some of the pull-ups from the lines to reduce the pull-up strength. (No solder indicates that pull-ups are disabled. Connect all three pads with a solder blob to enable pull-ups.)

L (CS PUs) – Pull-up resistor removal for SPI chip select lines. Normally pull-up resistors should be left in place. SPI is currently an unsupported feature and will likely be removed from a future revision.

M (SDOG PU) – Closed by default, this pin sets the I2C address used by the gyroscope. When closed, the gyroscope’s address is 0x6b. When open, jumper SDOG PD (labeled ‘O’ above) must be closed.

N (SDOXM PU) – Closed by default, this pin sets the I2C address used by the magnetometer/accelerometer. When closed, their collective address is 0x1d. When open, jumper SDOXM PD (labeled ‘P’ above) must be closed.

O (SDOG PD) – Open by default, this pin sets the I2C address used by the gyroscope. When closed, the gyroscope’s address is 0x6a.

P (SDOXM PD) – Open by default, this pin sets the I2C address used by the magnetometer/accelerometer. When closed, their collective address is 0x1e.

 

13033-02

13033-01

UART block

  • UART Header – Standard FTDI header with RX, TX, VCC, and GND broken out.
  • Select Switch – Select between Console (UART2) and UART1
  • Power Button – The power switch is connected to the “PWRBTN” line on the Edison. This give the user the ability to place an Edison in sleep or power down the module completely. This does not affect power to other Blocks in the stack.
  • Power LED – The power LED illuminates when power is present on VSYS. This can come from the Console Block, or any other powered Block in the stack.
  • LED Jumper – If power consumption is an issue, cut each jumper to disable LED
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield.

13040-01

i2C block

  • I2C Port – Standard I2C port broken out. VOUT provides power based on Level Select position.
  • Level Select – Provides level selection between 3.3V and VSYS levels on VOUT. Default 3.3V
  • Expansion Header – The 70-pin Expansion header breaks out the functionality of the Intel Edison. This header also passes signals and power throughout the stack. These function much like an Arduino Shield

 

13034-01_1