Skip to content

Commit 61b1913

Browse files
author
Shota Aoki
authored
Merge pull request #28 from rt-net/add-readme
Create README.md
2 parents b276ae7 + 1c10a01 commit 61b1913

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

SampleProgram/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Sample Program
2+
3+
このディレクトリにはLED、スイッチ、ブザーなどのRaspberryPiMouseの周辺機器を使うサンプルコードがあります。
4+
5+
This directory contains examples how to use RaspberryPiMouse's peripherals like LEDs, switches, buzzer, etc.
6+
7+
# How To Use
8+
9+
各機能ごとにShell Script、C、Pythonで書かれたサンプルコードを用意しています。
10+
11+
Each peripheral example has sample code files written Shell Script, C and Python.
12+
13+
## Shell Script
14+
15+
```sh
16+
$ bash step1.sh
17+
18+
Ctrl-c を押して終了してください。
19+
Press [Ctrl-c] to terminate.
20+
```
21+
22+
## C
23+
24+
サンプル実行前に、gccでコンパイルします。
25+
26+
Compile an example code via gcc command before execution.
27+
28+
```sh
29+
$ gcc step1.c -o step1
30+
$ ./step1
31+
32+
Ctrl-c を押して終了してください。
33+
Press [Ctrl-c] to terminate.
34+
```
35+
36+
## Python
37+
38+
```sh
39+
$ python3 step1.py
40+
41+
Ctrl-c を押して終了してください。
42+
Press [Ctrl-c] to terminate.
43+
```
44+
45+
# Step1
46+
47+
LED0~LED3が点滅します。
48+
49+
The LED0 ~ LED3 blinks.
50+
51+
# Step2
52+
53+
キーボード入力でブザーを鳴らします。
54+
入力キーと音階のペアは[./SCALE](./SCALE)を参照してください。
55+
56+
'0'を入力するとブザーが止まります。
57+
'c'を入力するとプログラムが終了します。(Shell ScriptではCtrl-cで終了します。)
58+
59+
Beep the buzzer with keyboard input.
60+
Refer to the [./SCALE](./SCALE) file for the pairs of input characters and scales.
61+
62+
Press '0' to stop beeping.
63+
Press 'c' to terminate the program. (Press Ctrl-c for the Shell Script.)
64+
65+
# Step3
66+
67+
スイッチを押してLEDを点消灯します。
68+
組み合わせは次のとおりです。
69+
70+
Turn on/off LEDs by the switches.
71+
The combination of LEDs and switches are defined as bellow.
72+
73+
- SW0 : LED3
74+
- SW1 : LED1 & LED2
75+
- SW2 : LED0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy