Hello master,
Does anyone have an arduino source code for diy dtg?
Especially for Epson P407 or P607.
Thanks and regards,
Rag
Hello master,
Does anyone have an arduino source code for diy dtg?
Especially for Epson P407 or P607.
Thanks and regards,
Rag
What is "DTG" ?
...R
Robin2:
What is "DTG" ?...R
Printer for Direct To Garment
When I Googled "Epson P407" the responses were for a high quality colour printer.
It would be quite impractical to send images to that with an Arduino. Consider a RaspberryPi, or a cheap laptop.
...R
Please Google "Dtg P407"
// BY KUSUMA NADA AUDIO SOUND SYSTEM 2020
#define encoder_a 2 //keep this on and interrupt pin
#define encoder_b 3 //keep this on and interrupt pin
#define motor_step 9
#define motor_direction 8
#define motor_en 10 //
#define senzor_front 6 // sensor depan
#define senzor_rear 7 // sensor samping
#define load_button 4
#define eject_button 5
volatile long motor_position, encoder;
int home_position = 0;
int load_position = 0;
int pe_load = 0;
void setup() {
pinMode(encoder_a, INPUT);
pinMode(encoder_b, INPUT);
// disable pullup as we aren't using an open collector encoder
digitalWrite(encoder_a, LOW);
digitalWrite(encoder_b, LOW);
//set up the various outputs
pinMode(motor_step, OUTPUT);
pinMode(motor_direction, OUTPUT);
pinMode(motor_en, OUTPUT);//
digitalWrite(motor_en, HIGH);//
// then the senzors inputs
pinMode(senzor_front, INPUT_PULLUP);
pinMode(senzor_rear, INPUT_PULLUP);
pinMode(load_button, INPUT_PULLUP);
pinMode(eject_button, INPUT_PULLUP);
//--------------------------------------------------
// encoder pin on interrupt 0 (pin 2)
attachInterrupt(0, encoderPinChangeA, CHANGE);
// encoder pin on interrupt 1 (pin 3)
attachInterrupt(1, encoderPinChangeB, CHANGE);
encoder = 0;
// -------------------------------------------------
}
// -------------------------------------------------
void encoderPinChangeA(){
if (digitalRead(encoder_a) == digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}
void encoderPinChangeB(){
if (digitalRead(encoder_a) != digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}
// -------------------------------------------------
void loop() {
// Control platen position of boot up and move to front
if (home_position == 0) {
digitalWrite(motor_direction, HIGH);
TurnStepper();
if (digitalRead(senzor_front) == LOW) {
home_position = 1;
}
}
// eject platen
if (digitalRead(eject_button) == LOW) {
home_position = 0;
}
// load platen
if (digitalRead(load_button) == LOW) {
load_position = 1;
}
if (load_position == 1) {
digitalWrite(motor_direction, LOW);
TurnStepper();
if (digitalRead(senzor_rear) == LOW) {
load_position = 0;
pe_load = 1;
}
}
// -------------------------------------------------
if (encoder > 0){
digitalWrite(motor_direction, HIGH); // output direction HIGH
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position++; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
else if (encoder < 0){
digitalWrite(motor_direction, LOW); // output direction LOW
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position--; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
// -------------------------------------------------
}
void TurnStepper() {
digitalWrite(motor_step, HIGH);
delayMicroseconds(1000); // speed motor
digitalWrite(motor_step, LOW);
delayMicroseconds(1000); // speed delay, the lower it is the faster
}
Silahkan dikomentari, maaf saya menggunakan bahasa indonesia, silahkan yang mau tanya , akan saya jawab semampu saya, terima kasih
RAGFashion:
Please Google "Dtg P407"
If you wish me to read a specific document please post a link to it.
Better still, as you are the person who wants advice, please take to trouble to write a description of what you are trying to do and the specific problem you need help with.
...R
wikastana:
// BY KUSUMA NADA AUDIO SOUND SYSTEM 2020#define encoder_a 2 //keep this on and interrupt pin
#define encoder_b 3 //keep this on and interrupt pin
#define motor_step 9
#define motor_direction 8
#define motor_en 10 //#define senzor_front 6 // sensor depan
#define senzor_rear 7 // sensor samping
#define load_button 4
#define eject_button 5volatile long motor_position, encoder;
int home_position = 0;
int load_position = 0;
int pe_load = 0;void setup() {
pinMode(encoder_a, INPUT);
pinMode(encoder_b, INPUT);// disable pullup as we aren't using an open collector encoder
digitalWrite(encoder_a, LOW);
digitalWrite(encoder_b, LOW);//set up the various outputs
pinMode(motor_step, OUTPUT);
pinMode(motor_direction, OUTPUT);
pinMode(motor_en, OUTPUT);//
digitalWrite(motor_en, HIGH);//// then the senzors inputs
pinMode(senzor_front, INPUT_PULLUP);
pinMode(senzor_rear, INPUT_PULLUP);pinMode(load_button, INPUT_PULLUP);
pinMode(eject_button, INPUT_PULLUP);
//--------------------------------------------------
// encoder pin on interrupt 0 (pin 2)
attachInterrupt(0, encoderPinChangeA, CHANGE);
// encoder pin on interrupt 1 (pin 3)
attachInterrupt(1, encoderPinChangeB, CHANGE);
encoder = 0;
// -------------------------------------------------}
// -------------------------------------------------
void encoderPinChangeA(){
if (digitalRead(encoder_a) == digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}void encoderPinChangeB(){
if (digitalRead(encoder_a) != digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}
// -------------------------------------------------void loop() {
// Control platen position of boot up and move to front
if (home_position == 0) {
digitalWrite(motor_direction, HIGH);
TurnStepper();
if (digitalRead(senzor_front) == LOW) {
home_position = 1;
}
}// eject platen
if (digitalRead(eject_button) == LOW) {
home_position = 0;
}// load platen
if (digitalRead(load_button) == LOW) {
load_position = 1;
}
if (load_position == 1) {
digitalWrite(motor_direction, LOW);
TurnStepper();
if (digitalRead(senzor_rear) == LOW) {
load_position = 0;
pe_load = 1;
}
}
// -------------------------------------------------
if (encoder > 0){
digitalWrite(motor_direction, HIGH); // output direction HIGH
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position++; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
else if (encoder < 0){
digitalWrite(motor_direction, LOW); // output direction LOW
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position--; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
// -------------------------------------------------
}void TurnStepper() {
digitalWrite(motor_step, HIGH);
delayMicroseconds(1000); // speed motor
digitalWrite(motor_step, LOW);
delayMicroseconds(1000); // speed delay, the lower it is the faster
}
Makasih mas...
Stepper motor nya perlu tipe tertentu tdk?
wikastana:
Silahkan dikomentari, maaf saya menggunakan bahasa indonesia, silahkan yang mau tanya , akan saya jawab semampu saya, terima kasih
Pak, selain arduino apakah butuh tambahan driver?
wikastana:
Silahkan dikomentari, maaf saya menggunakan bahasa indonesia, silahkan yang mau tanya , akan saya jawab semampu saya, terima kasih
ada tutorial dari awalnya gak pak?
buat DTG dengan arduino
saya mau nyoba2 mumpung ada printer ga kepake dirumah
Slamet_st:
ada tutorial dari awalnya gak pak?
buat DTG dengan arduino
saya mau nyoba2 mumpung ada printer ga kepake dirumah
Printernya tipe apa gan?
wikastana:
// BY KUSUMA NADA AUDIO SOUND SYSTEM 2020#define encoder_a 2 //keep this on and interrupt pin
#define encoder_b 3 //keep this on and interrupt pin
#define motor_step 9
#define motor_direction 8
#define motor_en 10 //#define senzor_front 6 // sensor depan
#define senzor_rear 7 // sensor samping
#define load_button 4
#define eject_button 5volatile long motor_position, encoder;
int home_position = 0;
int load_position = 0;
int pe_load = 0;void setup() {
pinMode(encoder_a, INPUT);
pinMode(encoder_b, INPUT);// disable pullup as we aren't using an open collector encoder
digitalWrite(encoder_a, LOW);
digitalWrite(encoder_b, LOW);//set up the various outputs
pinMode(motor_step, OUTPUT);
pinMode(motor_direction, OUTPUT);
pinMode(motor_en, OUTPUT);//
digitalWrite(motor_en, HIGH);//// then the senzors inputs
pinMode(senzor_front, INPUT_PULLUP);
pinMode(senzor_rear, INPUT_PULLUP);pinMode(load_button, INPUT_PULLUP);
pinMode(eject_button, INPUT_PULLUP);
//--------------------------------------------------
// encoder pin on interrupt 0 (pin 2)
attachInterrupt(0, encoderPinChangeA, CHANGE);
// encoder pin on interrupt 1 (pin 3)
attachInterrupt(1, encoderPinChangeB, CHANGE);
encoder = 0;
// -------------------------------------------------}
// -------------------------------------------------
void encoderPinChangeA(){
if (digitalRead(encoder_a) == digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}void encoderPinChangeB(){
if (digitalRead(encoder_a) != digitalRead(encoder_b)){
encoder--;
}
else{
encoder++;
}
}
// -------------------------------------------------void loop() {
// Control platen position of boot up and move to front
if (home_position == 0) {
digitalWrite(motor_direction, HIGH);
TurnStepper();
if (digitalRead(senzor_front) == LOW) {
home_position = 1;
}
}// eject platen
if (digitalRead(eject_button) == LOW) {
home_position = 0;
}// load platen
if (digitalRead(load_button) == LOW) {
load_position = 1;
}
if (load_position == 1) {
digitalWrite(motor_direction, LOW);
TurnStepper();
if (digitalRead(senzor_rear) == LOW) {
load_position = 0;
pe_load = 1;
}
}
// -------------------------------------------------
if (encoder > 0){
digitalWrite(motor_direction, HIGH); // output direction HIGH
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position++; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
else if (encoder < 0){
digitalWrite(motor_direction, LOW); // output direction LOW
digitalWrite(motor_step, HIGH); // output step HIGH
digitalWrite(motor_step, LOW); // output step LOW
_delay_us(900); // tunggu 200 microsecond
motor_position--; // posisi motor bergeser tambah satu point
encoder = 0; // reset ke 0
}
// -------------------------------------------------
}void TurnStepper() {
digitalWrite(motor_step, HIGH);
delayMicroseconds(1000); // speed motor
digitalWrite(motor_step, LOW);
delayMicroseconds(1000); // speed delay, the lower it is the faster
}
Maaf gan ini pake panel lcd nga??ane punya mks gen1 bekas laser.. Siapa tau bisa digunakan
Oh ada step step nya nga gan bangunnya?
Question asked of moderators as follows
Do we have a Forum section for the language now being used in this Thread (I don't recognise it)
It appears to be Indonesian but there is no forum section devoted to that