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
const int LED1 = 8; | |
void setup() { | |
pinMode(LED1, OUTPUT); | |
} | |
void loop() { | |
for (int i = 0; i < 100; i++) { | |
digitalWrite(LED1, HIGH); | |
delay(random(10, 50)); |
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
#include <SoftwareSerial.h> | |
#include <MP3Player_KT403A.h> | |
const int pinSW1 = 6; | |
SoftwareSerial mp3(2, 3); | |
void setup() { | |
mp3.begin(9600); | |
pinMode(pinSW1, INPUT_PULLUP); | |
delay(100); |
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
int Trig = A0; | |
int Echo = A1; | |
int Duration; | |
float Distance; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(Trig, OUTPUT); | |
pinMode(Echo, INPUT); | |
} |
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
#include <SoftwareSerial.h> | |
#include <MP3Player_KT403A.h> | |
//MP3 Player | |
SoftwareSerial mp3(2, 3); | |
//HC-SR04 | |
int Trig = A0; | |
int Echo = A1; | |
int duration; |
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
pcm.!default { | |
type asym | |
playback.pcm { | |
type plug | |
slave.pcm "hw:0,0" | |
} | |
capture.pcm { | |
type plug | |
slave.pcm "hw:1,0" | |
} |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import snowboydecoder | |
import sys | |
import signal | |
from light import Light | |
interrupted = False | |
LED=17 |
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
# -*- coding: utf-8 -*- | |
import sys | |
import base64 | |
import requests | |
def get_wave(fname): | |
with open(fname) as infile: | |
return base64.b64encode(infile.read()) | |
endpoint = "https://snowboy.kitt.ai/api/v1/train/" |
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
# -*- coding: utf-8 -*- | |
import RPi.GPIO as GPIO | |
from light import Light | |
interrupted = False | |
LED=17 | |
GPIO.setwarnings(False) | |
import snowboydecoder | |
….. |
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
# -*- coding: utf-8 -*- | |
import RPi.GPIO as GPIO | |
from light import Light | |
interrupted = False | |
GPIO.setwarnings(False) | |
aquest_dir = "/home/pi/smart/aquestalkpi/" | |
from smbus2 import SMBus | |
import time |
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
# -*- coding: utf-8 -*- | |
Import bme | |
….. | |
sensitivity = [0.5]*len(models) | |
detector = snowboydecoder.HotwordDetector(models, sensitivity=sensitivity) | |
callbacks = [lambda: snowboydecoder.play_audio_file(snowboydecoder.DETECT_DING), | |
lambda: bme.temp_led()] #snowboydecoder.play_audio_file(snowboydecoder.DETECT_DONG)] | |
print("ウェイクワードを発話して下さい。Ctrl+Cで終了します。") |