Let's try to write a kind of arduino sketch and a python script to interface a coffee pot with teh webz !
So... i've read the begining of an instructable about this idea.
| #define LATCH 7 // latch commun aux deux 74hc595 | |
| #define DS1 8 // data pour le premier | |
| #define DS2 10 // data pour le second | |
| #define SH_CP1 9 // shift clock pour le premier | |
| #define SH_CP2 11 // shift clock pour le second | |
| const byte charset[10] = { | |
| B10111110, // 0 | |
| B00000110, // 1 | |
| B01111100, // 2 |
| #define LATCH 7 | |
| #define DS1 8 | |
| #define DS2 10 | |
| #define SH_CP1 9 | |
| #define SH_CP2 11 | |
| const byte charset[10] = { | |
| B10111110,//0 | |
| B00000110,//1 | |
| B01111100,//2 |
Let's try to write a kind of arduino sketch and a python script to interface a coffee pot with teh webz !
So... i've read the begining of an instructable about this idea.
| // Compteur 8 bits sur un arduino | |
| int tabl[8] = {0}; | |
| void convertBin(int nb) // convertit l'argument en binaire | |
| { | |
| // recherche des plus grandes puissances de deux retranchables | |
| // à l'argument sans le rendre négatif (on commence par les plus grands) |
| /* | |
| !========================================================================! | |
| ! Programme de Mathieu GABORIT et Lucas BOURNEUF ! | |
| ! pour le projet FANGIO (séquence 3) ! | |
| ! Licence : WTFPL ! | |
| !========================================================================! | |
| //*/ | |
| // let's try to go infinity... | |
| int ratio1 = -25; | |
| int ratio2 = 25; | |
| task main() { | |
| RotateMotorEx(OUT_BC, 100, 540*11,ratio1, true, false); | |
| RotateMotor(OUT_BC, 50, 360); | |
| RotateMotorEx(OUT_BC, 100, 540*11,ratio2, true, false); | |
| } |
| #!/usr/bin/env python2 | |
| #-*- encoding: utf-8 -*- | |
| # | |
| # bridge.py | |
| # | |
| # 12/2011 Mathieu Gaborit <mat.gaborit@gmx.com> | |
| # License : WTFPL | |
| import sys | |
| import os |
| // Tom fait des carrés, de plus en plus grands | |
| void carre(int dist) { | |
| int i; | |
| for(i=0;i<4;i++){ | |
| RotateMotor(OUT_BC, 75 ,360*dist); // 360degrés ~= 10cm | |
| RotateMotorEx(OUT_BC,75,540,-100, true, false); // fait tourner le robot de 90degrés | |
| } | |
| } |
| // utilisation des capteurs | |
| #define Port_Tactile IN_1 | |
| #define Port_Telemetre IN_2 | |
| #define Port_Microphone IN_3 | |
| void setup() | |
| { |
| // On reprend le prgm de Léopard. Objectif : on reste à dix centimètres environ de la cible, qui avance et recule. | |
| #define Touch IN_1 | |
| #define Devant IN_4 | |
| #define Motors OUT_BC | |
| #define PAS 5 | |
| #define PAS_RECUL 5 | |
| int vitesse = 50; |