Forum des Objets Communicants et Solutions pour les Libérer...
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Forum des Objets Communicants et Solutions pour les Libérer...


 
AccueilAccueil  GalerieGalerie  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  

 

 clock farm

Aller en bas 
AuteurMessage
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 163
Carottes : 3753

clock farm Empty
MessageSujet: clock farm   clock farm Icon_minitimeMer 18 Mar 2015 - 23:32

... Experiment .. I edited the script to reproduce the clock, instead of the time, the
 various animal sounds downloaded from the internet ... if you want to try the effect of the rabbit doing cluck ...

https://hubic.com/home/pub/?ruid=aHR0cHM6Ly9sYjEwNDAuaHViaWMub3ZoLm5ldC92MS9BVVRIXzQzM2QyNDgwNTIzN2JkZjZmYmEzYWYzZjUwYmIyMGUyL2RlZmF1bHQvLm92aFB1Yi8xNDI2NzE1OTI5XzE0MjkzMDc5Mjk/dGVtcF91cmxfc2lnPTBkMDZhM2I5NmUxM2RhNzA3MGQ4NDg4ZmFjMDFjODNiNzFlNGFjYWUmdGVtcF91cmxfZXhwaXJlcz0xNDI5MzA3OTI5#

these are the ways that I have found
and I put them here
/usr/openkarotz/Extra/Animals

the script in the same folder clock
/usr/www/cgi-bin/apps

clockAnimals
Code:
#!/bin/bash

source /www/cgi-bin/setup.inc
source /www/cgi-bin/url.inc
source /www/cgi-bin/utils.inc
source /www/cgi-bin/leds.inc
source /www/cgi-bin/ears.inc

ReadUrlParam

# ----- dir to animals mp3
GRUNT=Extra/Animals
# --- array animals
v[0]='anatra-domestica.mp3'
v[1]='asino.mp3'
v[2]='canarino.mp3'
v[3]='cavallo.mp3'
v[4]='coyote.mp3'
v[5]='elefante.mp3'
v[6]='fringuello.mp3'
v[7]='gallina.mp3'
v[8]='gallo.mp3'
v[9]='gheppio.mp3'
v[10]='gufo-reale.mp3'
v[11]='inseparabili.mp3'
v[12]='lupo.mp3'
v[13]='maiale.mp3'
v[14]='megattera.mp3'
v[15]='merlo.mp3'
v[16]='mp.mp3'
v[17]='pecore.mp3'
v[18]='pettirosso.mp3'
v[19]='megattera.mp3'
v[20]='merlo.mp3'
v[21]='mp.mp3'
v[22]='pecore.mp3'
v[23]='pettirosso.mp3'

H=${URLParam[hour]}
 
CheckMandatoryDirectory  "$CNF_DATADIR/Apps"
CheckMandatoryDirectory  "$CNF_DATADIR/Apps/Clock"
CheckMandatoryDirectory  "$CNF_DATADIR/Apps/Clock/Data"
        
if [ -e "$CNF_DATADIR/Run/karotz.sleep" ]; then
   DATA='{"return":"1","msg":"Unable to perform action, rabbit is sleeping."}'
   SendResponse "$DATA"
   exit 0
fi

Log "[APPS][CLOCK]" "Clock Animals Called"

D=$(date +%H)
HOUR=$(( 10#$D ))

if [ -f "$CNF_DATADIR/$GRUNT/${v[$HOUR]}" ]; then
    Log "[APPS][CLOCK]"  "Playing sound : "$CNF_DATADIR/$GRUNT/${v[$HOUR]}
    PlaySound  $CNF_DATADIR/$GRUNT/${v[$HOUR]} 1
    EarsReset
    DATA='{"return":"0","hour":"'$HOUR'"}'
else
    DATA='{"return":"1","msg":"No sound for this time.'$CNF_DATADIR/$GRUNT/${v[$HOUR]}'"}'      
fi

SendResponse "$DATA"
the index of the table is the time

Carlo

would be nice to do it for nabaztag v2 ... nabzlol
Revenir en haut Aller en bas
 
clock farm
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Clock is on strike?
» Plugin clock ne fonctionne pas avec install locale

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum des Objets Communicants et Solutions pour les Libérer... :: II. Nabaztag, Karotz, mir:ror, Dal:Dal (Violet Object Operating System) :: Le monde de Karotz-
Sauter vers: