Cos'è ElectroYou | Login Iscriviti

ElectroYou - la comunità dei professionisti del mondo elettrico

Programmazione Arduino

Linguaggi e sistemi

Moderatori: Foto UtentePaolino, Foto Utentefairyvilje

0
voti

[1] Programmazione Arduino

Messaggioda Foto UtenteAndreDS » 19 lug 2011, 15:17

Salve a tutti,
ho voluto riprendere un mio vecchio progetto, forse è passato anche un anno, e quel progetto non è mai stato iniziato.
Questo è il momento giusto di realizzare il mio vecchio "sogno".
Posseggo un braccio robotico AL5A Lynxmotion e ho sempre voluto utilizzarlo in un modo divertente e diverso dal solito.
Quindi ho pensato, anche con l'aiuto dei video che girano su Youtube, di utilizarlo per farlo giocare a dama.
Questo è il video che ho visto io:
http://www.youtube.com/watch?v=Gl3CROmtHEU
Soltanto che non so come fare...
  • Si può utilizzare la SSC32 o Arduino UNO?
  • Quel programma di dama come lo abbino alla webcam?
  • Come lo devo programmare?

Queste sono informazioni sul forum (http://www.lynxmotion.net/viewtopic.php?f=6&t=6534)
1. The checkers game: http://www.3dkingdoms.com/checkers.htm

2. The position of the the pieces is determined with a color average algorithm. Every webcam frame is converted to an 8x8 color matrix containing the color average for every square on the board. If that changes it means that there is movement. After the movement stops, the matrix is compared to an already stored one ( obtained by clicking sample at the beginning of the game). Since I'm only interested in the white pieces, I am searching for changes in the amount of "green" (because red pieces don't have any green) .
So, on the square where there is a surplus of green means that is a new white piece, and on the square where there is less green a white piece is missing. When these to conditions are met it means that a piece was moved and the board. The stored color matrix is changed with the new values( the same thing as clicking sample).

3. The arm movement is strait foreword. I have created 64 small projects in RIOS, picking and placing for every black square. So, if i want to pick a piece from square 5 and place it on square 8 for ex. I'm telling RIOS (via socket) to play projects "src5" and then "dst8".
I tried to avoid the troublesome of positioning the arm (from code) for every movement since there are lot of repetitive movements.


Vi prego aiutatemi [-o<

Ne sarei grato.


Andrea
Avatar utente
Foto UtenteAndreDS
5 1 3
New entry
New entry
 
Messaggi: 93
Iscritto il: 25 nov 2010, 12:49

0
voti

[2] Re: Programmazione Arduino

Messaggioda Foto UtenteDonJ » 19 lug 2011, 15:23

Ah, qui c'è un bel po' di programmazione sotto.
Come stiamo a linguaggi? Pilloline o pasti completi?

perché partendo dalla webcam devi riuscire a riconoscere i pezzi sulla scacchiera (tramite computer), poi devi sviluppare un algoritmo di intelligenza artificiale (su computer) per calcolare la mossa successiva e poi confezionarla, spedirla ad arduino e poi arduino andrà a muovere il braccio robotico.
Ovviamente dovrai anche scrivere il programma per arduino.
"Computers, operating systems, networks are a hot mess. They're barely manageable, even if you know a decent amount about what you're doing. Nine out of ten software engineers agree: it's a miracle anything works at all."
@fasterthanlime
Avatar utente
Foto UtenteDonJ
4.611 6 10 13
Master EY
Master EY
 
Messaggi: 2560
Iscritto il: 19 lug 2009, 22:13
Località: Croccamauria

0
voti

[3] Re: Programmazione Arduino

Messaggioda Foto UtenteAndreDS » 19 lug 2011, 15:34

Bhé, sono sincero, pillole da 1 grammo! Ho solo iniziato a prendere lezioni da mio fratello per le programmazioni di base (il terminale ti fa una domanda e in base alla tua risposta lui ti dice qualcosa, niente di ché), ma poi ho smesso perché per tutti e due ci sono stati gli esami.
Io sono più per l'elettronica, mio fratello per l'informatica.
Spero possa aiutarmi lui...
Se posso avere delle informazioni in più le faccio leggere a mio fratello.
Grazie della risposta! Intanto ho già delle informazioni in più che posso già far vedere a mio fratello! Grazie!

Ciao
Andrea
Avatar utente
Foto UtenteAndreDS
5 1 3
New entry
New entry
 
Messaggi: 93
Iscritto il: 25 nov 2010, 12:49

0
voti

[4] Re: Programmazione Arduino

Messaggioda Foto UtenteDonJ » 19 lug 2011, 15:52

Mi sa che per una cosa del genere muovere un braccio meccanico sia la parte quasi più semplice
"Computers, operating systems, networks are a hot mess. They're barely manageable, even if you know a decent amount about what you're doing. Nine out of ten software engineers agree: it's a miracle anything works at all."
@fasterthanlime
Avatar utente
Foto UtenteDonJ
4.611 6 10 13
Master EY
Master EY
 
Messaggi: 2560
Iscritto il: 19 lug 2009, 22:13
Località: Croccamauria


Torna a PC e informatica

Chi c’è in linea

Visitano il forum: Nessuno e 31 ospiti