Maker Pro
Maker Pro

I made a celling fan winding machine but this round doing again reset i want fix turn one time set

Gaurav verma

Feb 25, 2022
4
Joined
Feb 25, 2022
Messages
4
कृपया मेरी मदद करें
मेरे पास कुछ उपकरण हैं
Arduino uno
7 खंड प्रदर्शन
रिले
सेंसर
मेरे पास कोड है

///////////// परियोजना द्वारा: जियोप्रोग्रामर
#शामिल "सेवसेग.एच"
सेवसेग सेवसेग;
इंट बटन1 = ए0;
इंट बटन2 = ए1;
इंट स्टार्टबटन = ए2;
इंट मैग्नेटसेंसर = A3;
इंट RELE = A4;
फ्लोट स्पीड = 370;
इंट सेटनंबर = 0;
बूलियन पॉज़नंबर = झूठा;
बूलियन लॉक = झूठा;
बूलियन मैग्नेटलॉक = सच;
इंट मैग्नेटफ्लैग = 0;
व्यर्थ व्यवस्था() {
पिनमोड (बटन 1, INPUT_PULLUP);
पिनमोड (बटन 2, INPUT_PULLUP);
पिनमोड (मैग्नेटसेंसर, INPUT_PULLUP);
पिनमोड (स्टार्टबटन, INPUT_PULLUP);
पिनमोड (RELE, OUTPUT);
बाइट अंक अंक = 4;
बाइट डिजिटपिन्स [] = {13, 10, 9, 2};
बाइट सेगमेंटपिन [] = {12, 8, 4, 6,7, 11, 3, 5};

बूल रेसिस्टर्सऑनसेगमेंट = सत्य;
बाइट हार्डवेयरकॉन्फिग = COMMON_CATHODE;
बूल अपडेटविथडेले = झूठा;
बूल अग्रणीZeros = सच;
बूल अक्षमडेकपॉइंट = सच;

sevseg.begin(hardwareConfig, numDigits, digitPins, सेगमेंटपिन, रेसिस्टर्सऑनसेगमेंट,
UpdateWithDelays, अग्रणीZeros, अक्षमDecPoint);
sevseg.setBrightness(50);
digitalWrite (RELE, High);
}
शून्य लूप () {

के लिए (लंबे i = 0; i <= गति; i++){
sevseg.setNumber (सेटनंबर, 0);
sevseg.refreshDisplay ();
}
//------------------------------------------------ -------------नोपका +
अगर (लॉक == झूठा) {
अगर (डिजिटल रीड (बटन 2) == कम) {
गति = 370;
सेटनंबर ++;
अगर (सेटनंबर> 9999)
सेटनंबर = 0;
}
}
//------------------------------------------------ -----------------नोपका -
अगर (लॉक == झूठा) {
अगर (डिजिटल रीड (बटन 1) == कम) {
गति = 370;
सेटनंबर--;
अगर (सेटनंबर <0)
सेटनंबर = 0;
}
}
//------------------------------------------------ ------------- ओरिव नोपका गनुलेबा
अगर (डिजिटल रीड (बटन 1) == कम && डिजिटल रीड (बटन 2) == कम) {
गति = 370;
सेवसेग.ब्लैंक ();
देरी (350);
मैग्नेटलॉक = सच;
ताला = झूठा;
सेटनंबर = 0;
digitalWrite (RELE, High);
}
//------------------------------------------------ ----------------स्टार्ट वाइंडिंग
अगर (डिजिटल रीड (स्टार्टबटन) == कम) {

गति = 300;
अगर (सेटनंबर <0) {
सेटनंबर = 0;
digitalWrite (RELE, High);
}

अगर (सेटनंबर> 0) {
ताला = सच;
मैग्नेटलॉक = झूठा;
सेवसेग.ब्लैंक ();
देरी (500);
digitalWrite (RELE, LOW);
}
}

//------------------------------------------------ ---------------------------चुंबक
अगर (मैग्नेटलॉक == झूठा) {
अगर (डिजिटल रीड (मैग्नेटसेंसर) == कम) {
अगर (मैग्नेटफ्लैग ==0) {
गति = 10;
सेटनंबर--;
अगर (0==सेटनंबर){
digitalWrite (RELE, High);
सेवसेग.ब्लैंक ();
देरी (350);
ताला = झूठा;
मैग्नेटलॉक = सच;
}
}
मैग्नेटफ्लैग = 1;
}
और अगर (मैग्नेटफ्लैग == 1) {
मैग्नेटफ्लैग = 0;
}
}

}
 

bertus

Moderator
Nov 8, 2019
2,629
Joined
Nov 8, 2019
Messages
2,629
Hello,

Please use englis over here.
This is what google translated:
Please help me
I have some tools
Arduino uno
7 segment display
Relay
Sensor
I have code

///////////// Project: Geoprogrammer
# Included "Sevasag.H"
Sevasag Sevasag;
Incent Button 1 = A;
Incent Button 2 = A1;
Int Start Button = A2;
Int magnets = a3;
Int rele = a4;
Float speed = 370;
Intese Saturn = 0;
Boolean posnt = false;
Boolean lock = false;
Boolean Maglark = Truth;
Int magnetflag = 0;
Vain arrangement ()
Pinmode (button 1, input_pullup);
Pinmode (button 2, input_pullup);
Pinmod (magnets, input_pullup);
Pinmode (Start Button, Input_pullup);
Pinmod (RELE, Output);
Byte point points = 4;
Byte Digitpins [] = {13, 10, 9, 2};
Byte segmentation [] = {12, 8, 4, 6,7, 11, 3, 5};

Bool ResistorsOnsgent = Truth;
Byte HardwareConfig = Common_cathode;
Bool Updatwithdale = False;
Bool leading zeros = truth;
Bull disabledpoint = truth;

Sevseeg.begin (hardwareConfig, numdigits, digitpins, segments, resistorson,
Updatewithdelays, leading zeros, disabled decpoint);
Sevseeg.setbrightness (50);
Digitalwrite (Rele, High);
}
Zero loop ()

For (long i = 0; i <= speed; I ++) {
Sevseeg.setnumber (Satnambar, 0);
Sevseeg.Refreshdisplay ();
}
// ------------------------------------------------ ------------- Nopa +
If (lock == false) {
If (Digital Reid (button 2) == Less) {
Speed = 370;
Satnamb ++;
If (Satnambar> 9999)
Seth = 0;
}
}
// ------------------------------------------------ ----------------- Dopa -
If (lock == false) {
If (Digital Reid (button 1) == less) {
Speed = 370;
Satner -;
If (satens <0)
Seth = 0;
}
}
// ------------------------------------------------ ------------- Oriv Nopaka Gunulba
If (Digital Reid (button 1) == Low && Digital Reed (Button 2) == Less) {
Speed = 370;
Sevasag.bon ();
Delay (350);
Maglarka = Truth;
Lock = false;
Seth = 0;
Digitalwrite (Rele, High);
}
// ------------------------------------------------ ---------------- Start Winder
If (Digital Reid (Start Button) == Less)

Speed = 300;
If (Satnambar <0) {
Seth = 0;
Digitalwrite (Rele, High);
}

If (Satnambar> 0) {
Lock = truth;
Maglark = false;
Sevasag.bon ();
Delay (500);
Digitalwrite (RELE, LOW);
}
}

// ------------------------------------------------ --------------------------- Magnet
If (maglock == false) {
If (Digital Reid (Magnets) == Less)
If (Magnetflag == 0) {
Speed = 10;
Satner -;
If (0 == Satnambar) {
Digitalwrite (Rele, High);
Sevasag.bon ();
Delay (350);
Lock = false;
Maglarka = Truth;
}
}
Magnetflag = 1;
}
And if (magnetflag == 1) {
Magnetflag = 0;
}
}

}
 
Last edited:

Gaurav verma

Feb 25, 2022
4
Joined
Feb 25, 2022
Messages
4
But i will try
I made a celling fan winding machine but is not complete i want to some code repaired so that my project complet
Are you mind my poor english
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,607
Joined
Nov 17, 2011
Messages
12,607
Are you mind my poor english
Not at all. We have many non-native English members here.
But: your posts and program code needs to be in English, otherwise we can't understand it and are unable to help. We cannot rely on some poor automatic translation.

I made a celling fan winding machine but is not complete i want to some code repaired so that my project complet
This is not a helpful description of your problem. Tell us exactly what the program is supposed to do and where it fails to do so.

Another issue: the Google translation shows no comments in the code at all. Do not expect us to dig into undocumented code. Good comments are essential to follow and understand the structure of a program.

Next: You also seem to use some kind of library (at least acc. to the Google translation). Unless this is a C standard library, we need to know the interface for this library. Posting the header file is a good start. No need to put the full text of the header file into the post. You can simply pack the header file into a ZIP archive, then drag and drop it into the edit box (this box where you write text). The zip will be added as an attachment.

Last not least: please use the "code" insertion menu option for better readability of your code:
upload_2022-2-25_18-20-52.png
 

Gaurav verma

Feb 25, 2022
4
Joined
Feb 25, 2022
Messages
4
Its file convert Eeprom i am not done it
My Arduino uno code
Code:
///////////// PROJECT BY: GeoProgrammer
#include "SevSeg.h"
SevSeg sevseg;
int Button1 = A0;
int Button2 = A1;
int StartButton = A2;
int magnetsensor = A3;
int RELE = A4;
float Speed =370;
int SetNumber =0;
boolean pauseNumber = false ;
boolean lock = false;
boolean magnetlock =true;
int magnetflag = 0;
void setup() {
    pinMode(Button1,INPUT_PULLUP);
    pinMode(Button2,INPUT_PULLUP);
     pinMode(magnetsensor,INPUT_PULLUP);
    pinMode(StartButton,INPUT_PULLUP);
     pinMode(RELE,OUTPUT);
  byte numDigits = 4;
  byte digitPins[] = {13, 10, 9, 2};
  byte segmentPins[] = {12, 8, 4, 6,7, 11, 3, 5};
 
  bool resistorsOnSegments = true;
  byte hardwareConfig = COMMON_CATHODE;
  bool updateWithDelays = false;
  bool leadingZeros = true;
  bool disableDecPoint = true;
 
  sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
  updateWithDelays, leadingZeros, disableDecPoint);
  sevseg.setBrightness(50);
      digitalWrite(RELE,HIGH);
}
void loop() {
 
    for (long i = 0; i <=  Speed; i++){
      sevseg.setNumber(SetNumber ,0);
      sevseg.refreshDisplay();
      }
  //-------------------------------------------------------------Knopka +
if (lock == false){
if(digitalRead(Button2)==LOW){
       Speed = 370;
           SetNumber ++;
          if(SetNumber  > 9999)
          SetNumber  = 0;
        }
}
//-----------------------------------------------------------------Knopka -
            if (lock == false){
            if(digitalRead(Button1)==LOW){
           Speed = 370;
           SetNumber--;        
          if(SetNumber  < 0)
          SetNumber  =  0;
                    }
                       }
//-------------------------------------------------------------orive knopka ganuleba
  if (digitalRead(Button1)==LOW && digitalRead(Button2)==LOW ){
        Speed = 370;
        sevseg.blank();
        delay(350);
        magnetlock = true;
        lock = false;
        SetNumber=0;
        digitalWrite(RELE,HIGH);
                }    
//----------------------------------------------------------------START Winding
if(digitalRead(StartButton)==LOW){
  
  Speed=300;
   if(SetNumber  < 0){
    SetNumber  =  0;
     digitalWrite(RELE,HIGH);
                }
      
   if(SetNumber  > 0){
  lock = true;
  magnetlock = false;
  sevseg.blank();
  delay(500);
   digitalWrite(RELE,LOW);
               }  
            }            
      
  //---------------------------------------------------------------------------Magnet
    if (magnetlock == false){
  if(digitalRead(magnetsensor)==LOW){
            if ( magnetflag ==0){
            Speed = 10;
            SetNumber--;        
            if (0==SetNumber){
             digitalWrite(RELE,HIGH);
            sevseg.blank();
            delay(350);
              lock = false;                
                magnetlock = true;
                }
                              }
            magnetflag=1;
            }
            else if( magnetflag==1) {
               magnetflag =0;
            }
              }
      
}

Moderators note : added code tags
 
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,607
Joined
Nov 17, 2011
Messages
12,607
We (at least I) still have no idea what is wrong, where and what do you want to fix?
 
Top