Outils pour utilisateurs

Outils du site


wiki:projets:consoleretro

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
wiki:projets:consoleretro [2015/09/24 12:20]
fabien_nasa
wiki:projets:consoleretro [2016/09/11 10:59] (Version actuelle)
Ligne 1: Ligne 1:
 +
 ====== Console de jeu retro ====== ====== Console de jeu retro ======
  
Ligne 23: Ligne 24:
 Imprimante 3D (Ici makerboot replicator 2X ou Ultimaker²) avec PLA ou ABS\\ Imprimante 3D (Ici makerboot replicator 2X ou Ultimaker²) avec PLA ou ABS\\
  
-Matériel : \\ 
--boitier 
--câble de connexion (DIN ou VGA) 
--potentiomètre,bouton,etc,,, 
  
- +===== Matériels nécessaires =====
- +
-===== matériels nécessaires =====+
  
 Ici il faut lister tout le matériel nécessaire, leur prix ainsi qu'une photo si possible\\ Ici il faut lister tout le matériel nécessaire, leur prix ainsi qu'une photo si possible\\
 - Atmega 328 P\\ - Atmega 328 P\\
 - Quartz 16 MHz\\ - Quartz 16 MHz\\
-- Résistance - condensateur\\+- Régulateur de tension L7805CV \\ 
 +- Résistance (10KΩ, 510Ω, ,,,)\\ 
 +- Condensateur (10μF,2x 22pF, 100μF,,,,)\\ 
 +- Bouton poussoir (pour les manettes)\\ 
 +Potentiomètre 10KΩ\\
 - Connecteur DIN (pour les manettes)\\ - Connecteur DIN (pour les manettes)\\
 - Connecteur AV-VGA\\ - Connecteur AV-VGA\\
Ligne 42: Ligne 41:
  
  
-===== Construction ===== +===== Étape de fabrication =====
- +
- +
- +
-Etape de fabrication :+
  
  
 ==== Partie 1  ==== ==== Partie 1  ====
--Réalisation du/des manettes  +-Réalisation de/des manettes, lien vers les fichiers stl : https://drive.google.com/folderview?id=0B1DKn6mfGJCcMjR2bjVBQzR2VHM&usp=sharing 
--réalisation du boitier de la console +  * [[http://pmclab.fr/3dviewer/?file=:projets:consoleretro:gamepad2_top.stl|gamepad2_top.stl]] 
--réalisation de la carte mère de la console a partir de l'Atmega 328+  * [[http://pmclab.fr/3dviewer/?file=:projets:consoleretro:gamepad2_bottom.stl|gamepad2_bottom.stl]] 
 +  * [[http://pmclab.fr/3dviewer/?file=:projets:consoleretro:gamepad2_buttons.stl|gamepad2_buttons.stl]] 
 +-réalisation du boitier de la console\\ 
 +-réalisation de la carte mère de la console a partir de l'Atmega 328\\
  
  
 ==== Partie 2  ==== ==== Partie 2  ====
--réalisation de différents jeux vidéos couleur ou noir et blanc +-réalisation de différents jeux vidéos couleur ou noir et blanc\\ 
--Amélioration de la console avec des passages a des cartouches de jeu +-Amélioration de la console avec des passages a des cartouches de jeu\\ 
--Réalisation de cartouche avec atmega intégré+-Réalisation de cartouche avec Atmega intégré\\
  
  
  
  
-- lien vers les fichiers stl : https://drive.google.com/folderview?id=0B1DKn6mfGJCcMjR2bjVBQzR2VHM&usp=sharing \\ 
 - les schéma \\ - les schéma \\
 \\ \\
-- les codes nécessaires\\ exemple : \\ +==== Le code ====
-<code=Arduino>+
  
-printnf("La puissance ! Charlotte ...")+<code=cpp> 
 +#include <TVout.h> 
 +#include <fontALL.h>
  
-</code> 
  
-*/+TVout TV;
  
 +int const pot=A0;
 +int zOff = 150;
 +int xOff = 0;
 +int yOff = 0;
 +int cSize = 50;
 +int view_plane = 64;
 +int val;
 +float angle = PI/60;
 +unsigned char cube2d[8][2];
 +int i=0;
 +int a=1;
 +int j=1;
 +int b=0;
 +int b2=0;
 +int G=0;
 +int c=0;
 +int point=0;
 +int vitesse =1;
 +int choix=0;
 +int rouge;
 +int partie=0;
 +int best=0;
 +int best_comp=0;
 +int hauteur=2; 
 +int ordinateur;
 +int presentation=0;
  
 +void setup(){
 +  Serial.begin(9600);
 +  TV.begin(PAL,120,96);
 +  pinMode(2,INPUT);
 +  pinMode(8,INPUT);
 +  TV.select_font(font6x8);
 +  TV.print(40,00,"PONG");
 +  TV.select_font(font6x8);
 +  TV.print(00,30,"Partie classique");
 +  TV.print(00,60,"Mode survie");
 +  TV.print(00,90,"Copyright Fabien");
  
 +}
  
-===== Journal de bord ===== 
  
-/*  +void loop(){ 
-Ici il faut mettre l'avancement du projet au jours le jourCela permet au documenteur de partager son experience (choixdifficultés...), mais aussi au PMClab de savoir si un projet continue de se construire.+  choix = digitalRead(2); 
 +  rouge=digitalRead(8); 
 +   
 +  if(rouge==HIGH){ 
 +    partie++; 
 +    delay(1000); 
 +  } 
 +  if(partie>2){ 
 +    partie=1; 
 +  } 
 +  if(partie==1){ 
 +    TV.print(00,20,"->"); 
 +    TV.draw_line(00,50,12,50,BLACK); 
 +    TV.draw_line(00,52,12,52,BLACK); 
 +    TV.draw_line(00,54,12,54,BLACK); 
 +    TV.draw_line(00,51,12,51,BLACK); 
 +    TV.draw_line(00,53,12,53,BLACK); 
 +    TV.draw_line(00,55,12,55,BLACK); 
 +    TV.draw_line(00,56,12,56,BLACK); 
 +  } 
 +  if(partie==2){ 
 +    TV.draw_line(00,20,12,20,BLACK); 
 +    TV.draw_line(00,22,12,22,BLACK); 
 +    TV.draw_line(00,24,12,24,BLACK); 
 +    TV.draw_line(00,21,12,21,BLACK); 
 +    TV.draw_line(00,23,12,23,BLACK); 
 +    TV.draw_line(00,25,12,25,BLACK); 
 +    TV.draw_line(00,26,12,26,BLACK); 
 +    TV.print(00,50,"->"); 
 +  } 
 +  if(choix==HIGH && partie ==1){ 
 +     
 +    TV.clear_screen(); 
 +        TV.print(50,00,"3"); 
 +    delay(1500); 
 +    TV.draw_line(50,00,60,00,BLACK); 
 +    TV.print(50,00,"2"); 
 +    delay(1500); 
 +    TV.draw_line(50,00,60,00,BLACK); 
 +    TV.print(50,00,"1"); 
 +    delay(1500); 
 +    TV.clear_screen(); 
 +    G=0; 
 +    point=0; 
 +    best_comp=0; 
 +    i=0; 
 +    j=1; 
 +    b=0; 
 +    b2=0; 
 +    c=0; 
 +    vitesse=1; 
 +    hauteur=2; 
 +    presentation=0; 
 +    while(G==0){ 
 +      val= analogRead(pot); 
 +      if(val>800){ 
 +        val=810; 
 +      } 
 +  if((hauteur*(i)+8)-15<8){ 
 +    ordinateur=8; 
 +  } 
 +  else{ 
 +    ordinateur=(hauteur*(i)+8)-15; 
 +  } 
 +  TV.draw_line(03,8+(87/100)*(val/10),03,38+(87/100)*(val/10),WHITE); 
 +  TV.draw_line(03,9,03,8+(val/10),BLACK); 
 +  TV.draw_line(03,38+val/10,03,94,BLACK); 
 +  TV.draw_line(vitesse*(j)+3,hauteur*(i)+8,vitesse*(j)+3,hauteur*(i)+8,WHITE); 
 +  
 + if(j>(60/vitesse)){ 
 +    TV.draw_line(115,ordinateur,115,(hauteur*(i)+8)+15,WHITE); 
 +    TV.draw_line(115,0,115,(hauteur*(i)+8)-15,BLACK); 
 +    TV.draw_line(115,(hauteur*(i)+8)+15,115,95,BLACK); 
 + } 
 +     
 +  TV.draw_line(00,8,00,95,WHITE); 
 +  TV.draw_line(118,8,118,95,WHITE); 
 +  TV.draw_line(00,95,118,95,WHITE); 
 +  TV.draw_line(00,8,118,8,WHITE); 
 +   
 +  TV.draw_line(55,8,55,15,WHITE); 
 +  TV.draw_line(55,23,55,31,WHITE); 
 +  TV.draw_line(55,39,55,47,WHITE); 
 +  TV.draw_line(55,55,55,63,WHITE); 
 +  TV.draw_line(55,71,55,79,WHITE); 
 +  TV.draw_line(55,87,55,95,WHITE); 
 +   
 +  TV.select_font(font6x8); 
 +  TV.print(00,00,"J1:"); 
 +  TV.print(20,00,point); 
 +  TV.print(80,00,"J2:"); 
 +  TV.print(100,00,best_comp); 
 +  Serial.print("potVal: \n"); 
 +  Serial.print(val);
  
-*/ 
  
 +  
 +    if(((hauteur*i)+8 < 8+(val/10) || (hauteur*i)+8> 38+val/10 )&& j==0 && G==0 && c==1){
 +      G=1;
 +      point--;
 +      if(point>best){
 +        best=point;
 +      }
 +      choix=0;
 +      TV.clear_screen();
 +      TV.select_font(font8x8);
 +      TV.println("\nSCORES :  \n");
 +      TV.println(point);
 +      delay (5000);
 +      TV.select_font(font6x8);
 +      TV.println("\n Nouvelle partie ?\n");
 +      if(point>6){
 +        TV.println("\n Bon score\n");
 +      }
 +      delay (5000);
 +      delay(9000);
 +      TV.clear_screen();
 +      TV.select_font(font6x8);
 +      TV.print(40,00,"PONG ");
 +      TV.print(00,30,"Partie classique");
 +      TV.print(00,60,"Mode survie");
 +      TV.print(00,90,"Best Score :");
 +      TV.print(80,90,best);
 +    }
 +    
 +  if(i<(88/hauteur) && b==0){
 +    i=i+a;
 +  }
 +  else{
 +    i=i-a;
 +    b=1;
 +  }
  
 +  if((vitesse*j)+3<115 && b2==0 && G==0 ){
 +    if(j!=0 ){
 +     TV.draw_line(vitesse*(j+3)-(vitesse-1)*3,9,vitesse*(j+3)-(vitesse-1)*3,94,BLACK);
 +    }
 +     j++;
 +  }
 +  
 +  if(i==0){
 +    b=0;
 +  }
 +  
 +  if(j==112/vitesse){
 +    b2=1;
 +    best_comp ++;
 +  }
 +  
 +  if(b2==1){
 +    if(j!=0){
 +    TV.draw_line(vitesse*(j+3)-(vitesse-1)*3,9,vitesse*(j+3)-(vitesse-1)*3,94,BLACK);
 +    }
 +    j--;
 +    c=1;
 +  }
 +  if(j==0){
 +    b2=0;
 +    point++;
 +  }
 +  
 +  }
 +  }
 +  
 +  
 +  if(choix==HIGH && partie ==2){
 +    
 +    TV.clear_screen();
 +        TV.print(50,00,"3");
 +    delay(1500);
 +    TV.draw_line(50,00,60,00,BLACK);
 +    TV.print(50,00,"2");
 +    delay(1500);
 +    TV.draw_line(50,00,60,00,BLACK);
 +    TV.print(50,00,"1");
 +    delay(1500);
 +    TV.clear_screen();
 +    G=0;
 +    point=0;
 +    best_comp=0;
 +    i=0;
 +    j=1;
 +    b=0;
 +    b2=0;
 +    c=0;
 +    vitesse=1;
 +    hauteur=2;
 +    presentation=0;
 +    while(G==0){
 +      val= analogRead(pot);
 +      if(val>800){
 +        val=810;
 +      }
 +  if((hauteur*(i)+8)-15<8){
 +    ordinateur=8;
 +  }
 +  else{
 +    ordinateur=(hauteur*(i)+8)-15;
 +  }
 +  TV.draw_line(03,8+(val/10),03,38+val/10,WHITE);
 +  TV.draw_line(03,9,03,8+(val/10),BLACK);
 +  TV.draw_line(03,38+val/10,03,94,BLACK);
 +  TV.draw_line(vitesse*(j)+3,hauteur*(i)+8,vitesse*(j)+3,hauteur*(i)+8,WHITE);
 + 
 + if(j>(60/vitesse)){
 +    TV.draw_line(115,ordinateur,115,(hauteur*(i)+8)+15,WHITE);
 +    TV.draw_line(115,0,115,(hauteur*(i)+8)-15,BLACK);
 +    TV.draw_line(115,(hauteur*(i)+8)+15,115,95,BLACK);
 + }
 +    
 +  TV.draw_line(00,8,00,95,WHITE);
 +  TV.draw_line(118,8,118,95,WHITE);
 +  TV.draw_line(00,95,118,95,WHITE);
 +  TV.draw_line(00,8,118,8,WHITE);
 +  
 +  TV.draw_line(55,8,55,15,WHITE);
 +  TV.draw_line(55,23,55,31,WHITE);
 +  TV.draw_line(55,39,55,47,WHITE);
 +  TV.draw_line(55,55,55,63,WHITE);
 +  TV.draw_line(55,71,55,79,WHITE);
 +  TV.draw_line(55,87,55,95,WHITE);
 +  
 +  TV.select_font(font6x8);
 +  TV.print(00,00,"J1:");
 +  TV.print(20,00,point);
 +  TV.print(80,00,"J2:");
 +  TV.print(100,00,best_comp);
 +  Serial.print("potVal: \n");
 +  Serial.print(val);
 +
 +
 +  
 +    if(((hauteur*i)+8 < 8+(val/10) || (hauteur*i)+8> 38+val/10 )&& j==0 && G==0 && c==1){
 +      G=1;
 +      point--;
 +      if(point>best){
 +        best=point;
 +      }
 +      choix=0;
 +      TV.clear_screen();
 +      TV.select_font(font8x8);
 +      TV.println("\nSCORES :  \n");
 +      TV.println(point);
 +      delay (5000);
 +      TV.select_font(font6x8);
 +      TV.println("\n Nouvelle partie ?\n");
 +      if(point>6){
 +        TV.println("\n Bon score\n");
 +      }
 +      delay (5000);
 +      delay(9000);
 +      TV.clear_screen();
 +      TV.select_font(font6x8);
 +      TV.print(40,00,"PONG ");
 +      TV.print(00,30,"Partie classique");
 +      TV.print(00,60,"Mode survie");
 +      TV.print(00,90,"Best Score :");
 +      TV.print(80,90,best);
 +    }
 +    
 +  if(i<(88/hauteur) && b==0){
 +    i=i+a;
 +  }
 +  else{
 +    i=i-a;
 +    b=1;
 +  }
 +
 +  if((vitesse*j)+3<115 && b2==0 && G==0 ){
 +    if(j!=0 ){
 +     TV.draw_line(vitesse*(j+3)-(vitesse-1)*3,9,vitesse*(j+3)-(vitesse-1)*3,94,BLACK);
 +    }
 +     j++;
 +  }
 +  
 +  if(i==0){
 +    b=0;
 +  }
 +  
 +  if(j==112/vitesse){
 +    b2=1;
 +    best_comp ++;
 +  }
 +  
 +  if(b2==1){
 +    if(j!=0){
 +    TV.draw_line(vitesse*(j+3)-(vitesse-1)*3,9,vitesse*(j+3)-(vitesse-1)*3,94,BLACK);
 +    }
 +    j--;
 +    c=1;
 +  }
 +  if(j==0){
 +    b2=0;
 +    point++;
 +  }
 +    if(point>=5 && j>0){
 +    vitesse =2;
 +    hauteur=3;
 +  }
 +  
 +  if(point>=10 && j>0){
 +    vitesse=4;
 +    hauteur=4;
 +    
 +  }
 +  
 +  }
 +  }
 +  
 +  
 +}
 +
 +
 +  
 +
 +
 +</code>
 +
 +
 +
 +
 +
 +===== Journal de bord =====
  
wiki/projets/consoleretro.1443097214.txt.gz · Dernière modification: 2016/09/11 10:47 (modification externe)