樹莓派 3A+ 好好玩︰Sense Hat 前

傳說 IBM 起始了『 Thinking 』之座右銘,  Apple 改變為『 Thinking Different 』, Nokia 曾經想『 Thinking Smart 』。然而不論『水平思考』全方位盡圓周,『垂直思考』窮碧落至黃泉,這種『思考』仍舊是個『平面』不是個『立體』。或許『因何』而思?『為何』而考??一樣是『思考』的重要向度,如是『思考』將有『價值』之尺度,能以『信念』為中心,認真的對待事物的『價值均衡』。或可了當下追求『富裕』,卻是流於『貪婪』,一切講求『方便』 ,其實製造『浪費』的現狀。將能解『氣候變遷』與『經濟發展』間之『論辯』,方踏出『面對問題』的第一步耶!!

有人認為『思考』就是解決『問題』。不過『問題之先』也許沒有『問題』,那麼應該『如何思考』的呢?事實上,考慮『為何問』 、『如何答』與『問答之先』是什麼?也就是神奇之『切入點』,淵源於一長串『之先』之『之前』的『偶然之思』。彷彿《易》曰︰陰陽不測謂之神。『潛潛之思』虛無飄渺的『問題前意識』或許先行於『意識』,替苦苦『追尋者』開道的乎??

要是有人問︰說欲找 Sense HAT 的資料先從 AstroPi  找起,對嗎?

假使有人答之以『是』,此事『 SenseHAT 』的『變更紀錄』上有

Sense HAT Changelog
v2

※增添

2.2.0

  • Added new stick interface for the joystick

2.1.0
Added gamma, low light and other properties

2.0.0
Library renamed from astro_pi to sense_hat
Class renamed from AstroPi to SenseHat
API otherwise unchanged

v1
1.1.6
Updated IMU settings file path

1.1.5
Introduced IMU settings file

1.1.4
Made _get_char_pixels return cloned lists

1.1.0
Fixed bug in show_letter

1.0.0
API design confirmed

v0
0.0.0
Alpha status

將如何思考這個『問與答』的呢?如果只看待成『 Q&A 』或僅開啟未來之『 Q 』與『 A 』的吧!假使設想『問』有『緣起之因』,『答』有『事物之法』,或能見『問答』之『因緣生法』的耶?!因此這可以是講『閱讀』思考之法之『外傳』的也!!

─── 《勇闖新世界︰ W!O《卡夫卡村》變形祭︰感知自然‧外傳‧一

 

隨著 IoT 物聯網時代的來臨,感測器 Sensor 越來越重要!

此當初所以寫 Sense HAT 外傳也。

如今樹莓派基金會文件充實︰

Getting started with the Sense HAT

Introduction

What you will make

The Sense HAT, which is a fundamental part of the Astro Pi mission, allows your Raspberry Pi to sense the world around it.

Sense HAT

In this project, you will learn how to control the Sense HAT’s LED matrix and collect sensor data, and you will combine these ideas in a number of small projects.

What you will learn

By following this resource with your Raspberry Pi and Sense HAT you will learn how to:

  • Communicate with the Sense HAT using Python
  • Access the outputs of the Sense HAT
  • Program the inputs of the Sense HAT
  • Use the Sense HAT library to display messages and images
  • Use variables to store sensor data
  • Use loops to repeat behaviours

This resource covers elements from the following strands of the Raspberry Pi Digital Making Curriculum:

 

為何舊話重提呢?

想告訴沒有 Sense HAT 硬體者,還有

Sense HAT Emulator

This package emulates the Raspberry Pi Sense HAT. An interactive GTK application is provided to permit manipulation of the emulated sensors, along with command line utilities for recording and playing back sensor readings from an actual HAT.

 

可以玩呦☺

 

Sense Emulator

The Sense HAT emulator application. This GTK application provides an interactive interface for emulating the Raspberry Pi Sense HAT.

Synopsis

sense_emu_gui

Usage

_images/gui_overview.png

The main window is divided into four parts. At the left is a visual representation of the Sense HAT. Scripts using the emulator library (sense_emu) to set the HAT’s LEDs will display the result here. Immediately below the LEDs are the rotation buttons which rotate the view of the HAT. These buttons also affect the action of the joystick buttons (covered below).

To the right of the LEDs are three sliders representing the temperature, pressure, and humidity of the emulated HAT’s environment.

Note

The emulation does not precisely reflect the settings of the temperature, pressure, and humidity sliders. Random errors are introduced that scale according to the sensor specifications, and as the sliders are adjusted, the sensor value will gradually drift towards the new setting at a similar rate to the sensors on the real HAT.

On the far right of the window, three sliders provide the orientation of the emulated HAT in terms of yaw (rotation around the vertical Z axis), pitch (rotation around the Y axis), and roll (rotation around the X axis). Adjusting these sliders affect the accelerometer, gyroscope, and magnetometer (compass) sensors on the emulated HAT. The emulated HAT assumes gravity runs vertically in the direction of the Z axis (as in the real HAT), and that North is in the direction of the X axis.

Finally, at the bottom right of the window, a series of buttons are provided to emulate the joystick on the HAT. The buttons will simulate press, release, and hold events generated by the real joystick. When the view of the HAT is rotated, the joystick buttons will act in the new orientation of the HAT. For example, initially the “up” button will send “up” events. After the HAT is rotated 90° the “up” button will send “right” events. After another 90° rotation, the “up” button will send “down” events, and so on.

Note

The emulator must be run prior to starting any scripts which expect to use the sense_emu library. However, the emulator can be terminated (and restarted) while scripts using the library are running (obviously, when the emulator isn’t running sensor errors can’t be emulated and all sensor readings will appear fixed). Attempting to spawn more than one instance of the emulator will simply activate the existing instance.