-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into RoverFuncs
- Loading branch information
Showing
8 changed files
with
128 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,34 @@ | ||
# LYNCS-Noshiro2019 | ||
能代宇宙イベントのためのCanSatプログラム | ||
[![Build Status](https://travis-ci.com/LYNCS-Keio/LYNCS-Noshiro2019.svg?branch=master)](https://travis-ci.com/LYNCS-Keio/LYNCS-Noshiro2019) | ||
[![Total alerts](https://img.shields.io/lgtm/alerts/g/LYNCS-Keio/LYNCS-Noshiro2019.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/LYNCS-Keio/LYNCS-Noshiro2019/alerts/) | ||
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/LYNCS-Keio/LYNCS-Noshiro2019.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/LYNCS-Keio/LYNCS-Noshiro2019/context:python) | ||
|
||
能代宇宙イベントのためのCanSatプログラム | ||
|
||
```bash | ||
cd raspberry_pi | ||
``` | ||
|
||
```bash | ||
sudo pigpio | ||
``` | ||
```bash | ||
python3 main.py | ||
``` | ||
で実行できる。 | ||
# Dependencies | ||
- opencv-python | ||
- pynmea2 | ||
- smbus2 | ||
- pyserial | ||
- RPI.GPIO | ||
see [dependency graph](https://github.com/LYNCS-Keio/LYNCS-Noshiro2019/network/dependencies) | ||
# Installation | ||
pipenvでパッケージを再現できる。pipenvは次のコマンドでインストールできる。 | ||
```bash | ||
pip install pipenv | ||
``` | ||
パッケージのインストールには次のコマンドを使う。 | ||
```bash | ||
pipenv install | ||
``` | ||
パッケージの追加は次のようにしてできる。numpyをインストールする場合、 | ||
```bash | ||
pipenv install numpy | ||
``` | ||
のようにすればよい。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import core | ||
import time | ||
|
||
index = 1 | ||
pressure_sum = 0 | ||
|
||
try: | ||
while True: | ||
index += 1 | ||
pressure_sum += core.readData()[1] | ||
time.sleep(0.001) | ||
|
||
finally: | ||
print(pressure_sum / index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .core import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
#!usr/bin/python | ||
|
||
import time | ||
|
||
__all__ = ['readData'] | ||
|
||
def writeReg(reg_address, data): | ||
pass | ||
|
||
|
||
def get_calib_param(): | ||
pass | ||
|
||
_dammy_bme_count = 0 | ||
_ascend_descend_flag = False ## False::上昇 True::降下 | ||
_dammy_gravity = 0.2 | ||
|
||
def readData(): | ||
global _dammy_bme_count | ||
global _ascend_descend_flag | ||
global _gnd_flag | ||
|
||
mesure_high = _dammy_bme_count | ||
|
||
if _ascend_descend_flag: | ||
_dammy_bme_count -= _dammy_gravity | ||
|
||
if not _ascend_descend_flag: | ||
_dammy_bme_count += _dammy_gravity | ||
if _dammy_bme_count >= 50: | ||
_ascend_descend_flag = True | ||
|
||
if _dammy_bme_count < 0: | ||
_dammy_bme_count = 0 | ||
|
||
time.sleep(0.0005) | ||
return [mesure_high, 0, 0] | ||
|
||
|
||
if __name__ == '__main__': | ||
try: | ||
while True: | ||
print(readData()) | ||
time.sleep(0.01) | ||
|
||
except KeyboardInterrupt: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,5 +36,5 @@ def __del__(self): | |
ca = capture() | ||
time.sleep(2) | ||
stream = ca.cap() | ||
ca.flush(stream) | ||
ca.flush() | ||
del ca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import pigpio | ||
import sys | ||
import time | ||
|
||
pi = pigpio.pi() | ||
|
||
|
||
try: | ||
DMUX_pin=[11,9,10] | ||
DMUX_out = [1, 0, 0] | ||
for pin in range(0, 2): | ||
pi.set_mode(DMUX_pin[pin], pigpio.OUTPUT) | ||
pi.write(DMUX_pin[pin], DMUX_out[pin]) | ||
|
||
args = sys.argv | ||
pi.set_mode(13, pigpio.OUTPUT) | ||
|
||
pi.hardware_PWM(13, 50, int(args[1])) | ||
time.sleep(1) | ||
|
||
finally: | ||
pi.hardware_PWM(13, 0, 0) | ||
|
||
for pin in range(0, 2): | ||
pi.write(DMUX_pin[pin], 0) |