Imprimante à partir d’un lecteur de CD (9 / 11 étapes)

Étape 9: Code de base

Définir CONF_WORD = 0x3f70
Contenu « Todos los pins PORTA del como E/S
TRISA = 0 X 00
TRISB = 0 x 00 ' Configuro el PORTB completo como salida.

Symbole motorpen1 = PORTA.0
Symbole motorpen2 = PORTA.1
Symbole motora1 = PORTB.0
Symbole motora2 = PORTB.1
Symbole motorb1 = PORTB.2
Symbole motorb2 = PORTB.3
Symbole bobina1 = PORTB.4
Symbole bobina2 = PORTB.5
Symbole bobina3 = PORTB.6
Symbole bobina4 = PORTB.7

PORTB = 0 X 00
PORTA = 0 X 00
Dim sleeptime As Byte
Dim sleeppap As Byte
Dim cambio comme Bit
Dim fila As Byte
Dim fila2 As Byte
Dim fila3 As Byte
Dim fila4 As Byte
Dim fila5 As Byte
Dim OPBI As Byte

bipo = 1
sleeppap = 2

Fila = 255
fila2 = 255
fila3 = 255
fila4 = 255
Fila5 = 255

Cambio = True

Inicio :
Botones :

GoSub avanzarmotor1
GoSub avanzarmotor1
GoSub ecribirletra
GoSub ecribirletra
Fila = 0
fila2 = 0
fila3 = 0
fila4 = 0
Fila5 = 0
GoSub ecribirletra
GoSub ecribirletra

"aca empieza el codigo

"aca termina el codigo

Fila = 0
fila2 = 0
fila3 = 0
fila4 = 0

Goto botones

Fin

ecribirletra :

Si fila5.7 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.6 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.5 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.4 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.3 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.2 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.1 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila5.0 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.7 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.6 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.5 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.4 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.3 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.2 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.1 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila4.0 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.7 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.6 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.5 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.4 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.3 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.2 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.1 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila3.0 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.7 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.6 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.5 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.4 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.3 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.2 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.1 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila2.0 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.7 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.6 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.5 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.4 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.3 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.2 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.1 = True Then
GoSub bajarlapicera
Endif
GoSub moverhorizontal
Si fila.0 = True Then
GoSub bajarlapicera
Endif
GoSub volvertodo
GoSub avanzarmotor1
Retour

bajarlapicera :
motorpen1 = 1
motorpen2 = 0
WaitMs 102
motorpen1 = 0
motorpen2 = 1
WaitMs 102
motorpen1 = 0
motorpen2 = 0
WaitMs 102
Retour

moverhorizontal :
bipo = bipo + 1
Si bipo = 5 alors bipo = 1
PORTB = 0
motora1 = 1
motorb1 = 1
WaitMs sleeppap
PORTB = 0
motora1 = 1
motorb2 = 1
WaitMs sleeppap
PORTB = 0
motora2 = 1
motorb2 = 1
WaitMs sleeppap
PORTB = 0
motora2 = 1
motorb1 = 1
WaitMs sleeppap
PORTB = 0
Retour

moverhorizontalatras :
bipo = bipo + 1
Si bipo = 5 alors bipo = 1
PORTB = 0
motora2 = 1
motorb1 = 1
WaitMs 6
PORTB = 0
motora2 = 1
motorb2 = 1
WaitMs 6
PORTB = 0
motora1 = 1
motorb2 = 1
WaitMs 6
PORTB = 0
motora1 = 1
motorb1 = 1
WaitMs 6
PORTB = 0
Retour

volvertodo :
Dim y As Byte
Pour y = 0 à 41
motora2 = 1
motorb1 = 1
WaitMs sleeppap
PORTB = 0
motora2 = 1
motorb2 = 1
WaitMs sleeppap
PORTB = 0
motora1 = 1
motorb2 = 1
WaitMs sleeppap
PORTB = 0
motora1 = 1
motorb1 = 1
WaitMs sleeppap
PORTB = 0
Prochaine y
PORTB = 0
Retour

avanzarmotor1 :
Si cambio = True Then
Cambio = False
D’autre
Cambio = True
Endif

Si cambio = True Then
PORTB = 0
bobina1 = 1
WaitMs sleeptime
PORTB = 0
bobina1 = 1
bobina2 = 1
WaitMs sleeptime
PORTB = 0
bobina2 = 1
WaitMs sleeptime
PORTB = 0
bobina2 = 1
bobina3 = 1
WaitMs sleeptime
PORTB = 0
D’autre
PORTB = 0
bobina3 = 1
WaitMs sleeptime
PORTB = 0
bobina3 = 1
bobina4 = 1
WaitMs sleeptime
PORTB = 0
bobina4 = 1
WaitMs sleeptime
PORTB = 0
bobina4 = 1
bobina1 = 1
WaitMs sleeptime
PORTB = 0
Endif
Retour

retrocedermotor1 :
Si cambio = True Then
Cambio = False
D’autre
Cambio = True
Endif
Si cambio = True Then
PORTB = 0
bobina4 = 1
WaitMs sleeptime
PORTB = 0
bobina3 = 1
bobina4 = 1
WaitMs sleeptime
PORTB = 0
bobina3 = 1
WaitMs sleeptime
PORTB = 0
bobina2 = 1
bobina3 = 1
WaitMs sleeptime
PORTB = 0
D’autre
PORTB = 0
bobina2 = 1
WaitMs sleeptime
PORTB = 0
bobina2 = 1
bobina1 = 1
WaitMs sleeptime
PORTB = 0
bobina1 = 1
WaitMs sleeptime
PORTB = 0
bobina4 = 1
bobina1 = 1
WaitMs sleeptime
PORTB = 0
Endif
Retour

Articles Liés

Imprimante matricielle d’un lecteur de CD/DVD avec Arduino

Imprimante matricielle d’un lecteur de CD/DVD avec Arduino

Hé !Depuis longtemps en parcourant les pages ici de Instructables, quelque chose attirer mon attention, une imprimante faite d'un lecteur de CD et j'ai été étonné.J'ai pensé: « c'est incroyable, je dois faire un! »Je sais que ce genre de projets ne r
Renforcer un 3D imprimé partie

Renforcer un 3D imprimé partie

Comme nous le savons tous, la 3D parties imprimées produites par nos imprimantes de type domestique ordinaire ne sont pas si forts et lorsqu'il est utilisé à la place de pièces réelles, elles ne durent pas longtemps. J'ai pensé qu'il serait génial si
Matching 3D imprimé partie à RC palonnier

Matching 3D imprimé partie à RC palonnier

J'ai récemment vous avez une imprimante 3D et voulez faire des mécanismes robotisés, utilisant principalement les servomoteurs RC pour la motion. Donc le premier défi pour moi, c'était comment to fiable « interface » un servo à une 3D imprimé partie.
Comment faire pour imprimer à partir d’iwork sur un ipad.

Comment faire pour imprimer à partir d’iwork sur un ipad.

j'ai fait ce guide pour montrer un moyen d'imprimer à partir d'iwork sur votre ipad.Ce que vous devez :1) ipad2) iwork pour ipad (Pages, Keynote ou Numbers)3) mac os x avec l'application mail.4) le script apple depuis ce lien http://files.macscripter
De 3d imprimé partie de métal, la méthode perdu pla/abs

De 3d imprimé partie de métal, la méthode perdu pla/abs

si vous avez votre part imprimé 3d tout fini et sa belle. Maintenant ce qu'il faut faire avec elle ? Je sais qu'il devienne une belle coulée de bronze qui sera un saké de garder pour toujours.   Ici, je démontrerai transformer votre pièce 3d imprimé
Installer un OS à partir d’un lecteur Flash

Installer un OS à partir d’un lecteur Flash

Étape 1: Télécharger1. Commencez par Télécharger Universal USB Installer dehttp://www.pendrivelinux.com/Universal-USB-Installer-Easy-as-1-2-3/Puis télécharger le système d'exploitation que vous voulez installer. (Assurez-vous qu'il est sous forme d'I
Photo 360 degrés de Rig partir d’un lecteur de CD-ROM brisé

Photo 360 degrés de Rig partir d’un lecteur de CD-ROM brisé

OK les gars, mon premier Instructable ici, justes apprendre les ficelles du métier, donc commencer par le projet plus simple jamais.Supposons que vous avez un petit objet 3d, comme les objets d'art, montré sur la vidéo ici et vous avez besoin présent
Créé un oreiller imprimé à partir de zéro avec le papier transfert

Créé un oreiller imprimé à partir de zéro avec le papier transfert

ceci est un court et facile instructable pour quiconque s'intéresse à la création d'un oreiller avec des estampes graphiques personnalisés à l'aide de papier de transfertÉtape 1: fournitures 1. deux morceaux de tissu de coton légèrement plus grand pa
Démonter un lecteur de CD/DVD et la réutilisation de ses parties

Démonter un lecteur de CD/DVD et la réutilisation de ses parties

Salut!Parler de pilotes de CD et DVD, ils sont géniaux ! Vous pouvez trouver beaucoup de cool et de précieux (pour une hobbist) choses à l'intérieur de les utiliser dans vos projets. Il y a tellement de choses que vous pouvez faire avec un ou plusieu
CupBot - plateforme robotique imprimés 3D

CupBot - plateforme robotique imprimés 3D

Voici un excellent week-end, que vous pouvez entreprendre des projets de robotique appelé CupBots basé sur le Raspberry Pi et le BeagleBone Black qui sont des cartes de crédit ordinateurs de taille et comprend également l'impression 3D...La plupart d
Modification de la Pantum 2502W pour l’impression Laser Direct de circuits imprimante

Modification de la Pantum 2502W pour l’impression Laser Direct de circuits imprimante

Beaucoup d'entre vous ont suivi mes séries de Instructables sur recibler une imprimante laser Lexmark E260 impression toner directement sur les planches de lui. Une fois imprimé et « fixe » pour le cuivre par les vapeurs de l'acétone, le toner agit c
3D imprimés Prototype NFC Bracelet (projet TfCD par Jeremy Evers et Bas Van Der Werf)

3D imprimés Prototype NFC Bracelet (projet TfCD par Jeremy Evers et Bas Van Der Werf)

Ce instructable qui suit vous aidera à faire votre propre bracelet NFC. Ce bracelet peut être donné différentes fonctions en écrivant du code avec votre smartphone sur la puce NFC. Une puce NFC est une puce qui peut communiquer à bout portant avec un
Imprimante 3D super bon marché de CD-Rom Drives

Imprimante 3D super bon marché de CD-Rom Drives

Cette idée a été inspirée par toutes les machines CNC de CD-Rom que j'ai vu sur Instructables. Je les ai vus utilisé comme drawbots, outils de coupe laser, perceuses à colonne, mais je n'ai pas vu un encore utilisé pour une imprimante 3D... du moins
Comment choisir, utiliser et améliorer une imprimante 3D

Comment choisir, utiliser et améliorer une imprimante 3D

Cette instructable contient beaucoup d'informations que j'ai rassemblé sur les imprimantes 3D et leur utilisation. Certaines de ces informations est uniquement pertinent pour le Prusa Mendel I2, parce que je n'ai qu'un Prusa Mendel I2 et donc je sais