Exemplo n.º 1
0
def init():
    global SCREEN_SIZE
    pygame.mixer.pre_init(frequency=22050, size=-16, channels=2, buffer=512)
    pygame.init()
    if pygame.mixer and not pygame.mixer.get_init():
        print 'Warning, no sound'
        pygame.mixer = None
    pygame.display.set_caption('Fluxagama')
    window = pygame.display.set_mode((SCREEN_SIZE[0], SCREEN_SIZE[1]))
    text.init_text()
Exemplo n.º 2
0
# author: lianghy
# time: 2019/12/13 17:13:33
"""主要功能函数库。库中函数都是能够backward的功能函数。"""

import os
from os.path import isfile, isdir, join
import logging as lg
from io import StringIO
import json
#import circuit as qc
import tkinter as tk
from tkinter import messagebox as xm
import view as xv
import circuit as xc
import text as xt
tx = xt.init_text()

############################# to review


class ClassName(object):
    """docstring for ClassName"""
    def __init__(self, arg):
        super(ClassName, self).__init__()
        self.arg = arg


class ACRecord(object):
    """docstring for ACRecord"""
    def __init__(self):
        super(ACRecord, self).__init__()
Exemplo n.º 3
0
        orientation = "Roll: SouthWest-West"
    elif roll < 315:
        orientation = "Roll: West-NorthWest"
    elif roll < 360:
        orientation = "Roll: NorthWest-North"
        
    return orientation

def find_compass():
    north = sense.get_compass()
    north = round(north, 1)
    
    return north

# initialize text
text.init_text()

# initialize dataloggers
logger = DataLogger()
sense_logger = SenseLogger()

# set timedelta
time_between = timedelta(minutes=10)

# get initial orientations
base_orientation_yaw = find_orientation_by_yaw()
logger.log_orientation(base_orientation_yaw)
base_orientation_roll = find_orientation_by_roll()
logger.log_orientation(base_orientation_roll)

# get baseline for acceleration