HobbyCNC fórum
FTP tárhely: http://cnctar.hobbycnc.hu v0.9.6 Régi HobbyCNC oldal: http://archiv.hobbycnc.hu

Új regisztráció / Átregisztráció a régi fórumról
    
   


Arduino



 

Időrend:
Oldal 3 / 42 Ugrás ide:
Sorok:
|◄ Első  ◄ Előző   1  2  3  4  5  6  7   Következő ►  Utolsó ►|

  Fórum főoldal  |  A lap aljára

nyiszi | 2374    2021-10-09 12:02:04 [1961]

Köszönöm szépen a tanácsokat.


Csuhás | 6729    2021-10-09 08:55:58 [1960]

Szerintem érdemes venni egy programozót. Magam régebben avrisp mk2 manapság pedig atmel ice eszközt használok. Ezekkel beégethető a prociba egy bootloader amivel már programozó nélkül lehet frissíteni a proci tartalmát.

Előzmény: nyiszi, 2021-10-08 20:47:11 [1957]


ebalint | 1769    2021-10-09 08:19:09 [1959]

Igaz, hogy csak atmega -val...

Előzmény: ebalint, 2021-10-09 08:14:45 [1958]


ebalint | 1769    2021-10-09 08:14:45 [1958]

Szia!

Én - néha - az avrdudess nevű programot használom erre a célra.

Próbáld ki. Fel- és letöltés is megy vele.

Előzmény: nyiszi, 2021-10-08 20:47:11 [1957]


nyiszi | 2374    2021-10-08 20:47:11 [1957]

Egy ATXMEGA-ba hogyan kell betölteni a hex fájlt?

-c ft232r -p m328p -P COM5 -e -U flash:w:".hex":a

Ezt a sort hogyan kell módositani ha a hex fajl itt van?

C:\Users\nyisz\Desktop\NANDLite

A port COM4
Ilyen ic-k vannak a panelen: ft245rl atxmega128a4u

Gondolom az elejet meg erre kell: ft245rl -p m128a4u

Ha sok butaságot írtam akkor azt kérem bocsássátok meg.
Még nem csináltam ilyet.

GG | 347    2021-09-22 22:31:59 [1956]

ha mutatnád a kódrészletet, és tudnánk, hogy a limiter poti hová van dugva, ééés a constrain() is megvan, akkor el lehetne gondolkozni a kérdésen

Előzmény: Sys_m, 2021-09-22 18:03:46 [1955]


Sys_m | 412    2021-09-22 18:03:46 [1955]

Sziasztok, Arduino map() függvény kódban és rc szervo vezérléssel kapcsoltban kérnék segítséget privátban. A példaprogram működik, a feladat matematikai részével vagyok számszakilag bajban.
Egy potméter jelére mozog az rc szervő, de ha egy másik potméterrel úgymond limitet állítok be, akkor a szervó kitérés a limit plafon elérése után visszafelé indul, úgymond visszaszabályoz. A map függvény utolsó tagjához (a servo max) kell berakni egy változót, ami limit beállító potméter adataiból táplálkozik, ha jól kalkulálok.

Üdv.: Sys_m


Törölt felhasználó    2021-08-17 20:08:38 [1954]

Visual Studio Code stm32 projekt alat hibakod jön valaki tudja e mi okoza mindegyik beálitásnál hhasonlit a hiba!
funkcio beállitások:
;default_envs = VARIANT_ADC ; Variant for control via ADC input
default_envs = VARIANT_USART ; Variant for Serial control via USART3 input
;default_envs = VARIANT_NUNCHUK ; Variant for Nunchuk controlled vehicle build
;default_envs = VARIANT_PPM ; Variant for RC-Remotes with PPM-Sum signal
;default_envs = VARIANT_PWM ; Variant for RC-Remotes with PWM signal
;default_envs = VARIANT_IBUS ; Variant for RC-Remotes with FLYSKY IBUS
;default_envs = VARIANT_HOVERCAR ; Variant for HOVERCAR build
;default_envs = VARIANT_HOVERBOARD ; Variant for HOVERBOARD
;default_envs = VARIANT_TRANSPOTTER ; Variant for TRANSPOTTER build https://github.com/NiklasFauth/hoverboard-firmware-hack/wiki/Build-Instruction:-TranspOtter https://hackaday.io/project/161891-transpotter-ng
;default_envs = VARIANT_SKATEBOARD ; Variant for SKATEBOARD build controlled via RC-Remotes with PWM signal

forrás

  


ebalint | 1769    2021-08-16 11:34:45 [1953]

Ez történt :

Mega 2560 3r -re szerettem volna valamelyik MARLIN programot feltölteni.
Az Arduino IDE vel lefordítottam hibaüzenet nélkül, fel is töltöttem.
Nem működött megfelelően, pontosabban sehogy.

Ezért egy korábban jól működő .HEX filet kerestem, mind a flash-, mind az eprom -ra.
Ezeket az AVRDUDES -el töltöttem le.

Kijelöltem a filekat írásra, elindítottam a folyamatot.

Először a flash -t töltöttem föl, ami a dudes szerint rendben fel is ment.

Ezután folytatta volna az eprom töltését, de ez már nem ment, time out hibával megszakadt a folyamat.

Ezután a 2560 -hoz nem tudtam hozzáférni....

Ma USBASP programozóval próbálkoztam. Programot nem tudtam feltölteni,
de megpróbáltam a bootloader beégetést.

Ez sikerült. Ezt követően rendesen hozzáfértem a panelhez a szokott módon.


Mi lehet a probléma?
A dudes használata eddig nem okozott gondot.


Törölt felhasználó    2021-08-11 13:10:11 [1952]

servo példa müködik vele ha ez csak a kérdés RC ESC vezérlő ugyan az csak nincs hall viszacsatolás....
Most futatok egy hasonló projektet hc12 uart távirányitos alapon irányváltás, sebbeség szabályzás ...
De a uart paracs mindegy mind küldesz el eredmény ugyanaz bluetools,wifi,lora,hc12(433,896),stb...

Előzmény: csatlos.laszlo, 2021-08-11 12:37:29 [1951]


csatlos.laszlo | 145    2021-08-11 12:37:29 [1951]

Tisztlet fórumosok!
Kérdésem: Valaki nem irt még arduinora elektromos kerékpár motorvezérlő programot 3f BLDC motor. Bluetooth telefon kapcsolattal?


PSoft | 18613    2021-07-12 19:15:12 [1950]

Egy -úgy gondolom- hasznos kis eszköz Arduino-val.
Arduino Cable Tracer


Törölt felhasználó    2021-07-11 23:44:43 [1949]

eredeti...


Előzmény: Törölt felhasználó, 2021-07-11 23:34:52 [1948]


Törölt felhasználó    2021-07-11 23:34:52 [1948]

Gyüjteményböl turtam...

van egy másik is...

TakeOneClient

TakeOneServer

link

Előzmény: Devecz Miklós, 2021-07-11 21:35:14 [1947]


Devecz Miklós | 2658    2021-07-11 21:35:14 [1947]

Nem jött össze, ennél a sornál kiakad:

http.begin("192.168.4.1", 80, "/led/"+stateVal);

Előzmény: Törölt felhasználó, 2021-07-11 18:39:44 [1946]

Törölt felhasználó    2021-07-11 18:39:44 [1946]

2 esp egymás közöt csak cliens/server nyomogomb/led példa!

cliens:
-------
/*
*
* https://www.14core.com/wiring-programming-esp8266-1212e-nodemcu-wifi-remote-clientserver-mode/
14CORE | ESP8266 to ESP8266 Remote Client & Server Test
/------------------------ CLIENT ---------------------/
*/

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

const char* ssid = "SERVER"; //AP Name (Server Name)
const char* password = "1234567890"; //Set wifi password
//const char* password = "" //Open no password
const char* host = "http://192.168.4.1"; //Default IP of ESP8266
String stateVal="0";

int val1;
const int inVal1 = 14; // Pin Push Button

HTTPClient http;
void setup() {
Serial.begin(115200);
// pinMode(inVal1, INPUT_PULLUP);
pinMode(inVal1, INPUT);
delay(10);
Serial.print("CONNECTED TO AP: ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".......");
delay(500);
}
Serial.println("CONNECTED...");
}
void loop(){

//Serial.println(val1);

val1=digitalRead(inVal1);
if (val1 == 1){ //Turn val1 to HIGH state
stateVal="1";}
else{
stateVal="0";
}

if(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, password);
delay(500);
}else{
http.begin("192.168.4.1", 80, "/led/"+stateVal);
int httpCode1 = http.GET(); //get value
delay(100);
}
}


-------

server
------
/*
*
* https://www.14core.com/wiring-programming-esp8266-1212e-nodemcu-wifi-remote-clientserver-mode/
14CORE | ESP8266 to ESP8266 Remote Client & Server Test
/------------------------ SERVER ---------------------/
*/

#include <ESP8266WiFi.h>
const char* ssid = "SERVER";
const char* password = "1234567890";

const int led = 2;
int val;
WiFiServer server(80);

void setup() {
Serial.begin(115200);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
server.begin();
}

void loop() {
WiFiClient client = server.available(); // If client is connected
if (!client) { return;}
//Read client request
String req = client.readStringUntil('\r');
if (req.indexOf("/led/0") != -1) val=0;
if (req.indexOf("/led/1") != -1) val=1;


digitalWrite(led, val);

// Serial.println(val);


client.flush();

}


------

Előzmény: Devecz Miklós, 2021-07-11 16:42:14 [1945]


Devecz Miklós | 2658    2021-07-11 16:42:14 [1945]

Sajnos ez nem jó.
Nekem olyan kellene, ami független a Wifi hálózattól.

Előzmény: Törölt felhasználó, 2021-07-11 16:20:26 [1944]


Törölt felhasználó    2021-07-11 16:20:26 [1944]

https://github.com/itead/ITEADLIB_Arduino_WeeESP8266

„The size of data from ESP8266 is too big for arduino sometimes, so the library can't receive the whole buffer because the size of the hardware serial buffer which is defined in HardwareSerial.h is too small.

Open the file from \arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.h.

See the follow line in the HardwareSerial.h file.

#define SERIAL_BUFFER_SIZE 64

The default size of the buffer is 64. Change it into a bigger number, like 256 or more.”


Nem tudom ez segít, de ellenörizni kell.

Előzmény: Devecz Miklós, 2021-07-11 16:12:06 [1943]


Devecz Miklós | 2658    2021-07-11 16:12:06 [1943]

Sziasztok!

Valaki készített már olyan kapcsolást, Ahol Esp-now segítségével vitt át adatokat ESP8266-tal?

A konkrét probléma:

Master: nyomógomb és/vagy Max9814 mikrofon
Slave: villogó led

Sehol nem találok példát rá, az én képességeimet meg meghaladja a programozása.


PSoft | 18613    2021-05-18 20:27:11 [1942]

Mikor Svejk kérdezte, emlékeztem, rögtön írni akartam hogy Te már igen...
De azért...mégis csak jobb, elegánsabb lett így.

Előzmény: Devecz Miklós, 2021-05-18 20:14:38 [1941]


Devecz Miklós | 2658    2021-05-18 20:14:38 [1941]

Igen, arduino alapú, léptetőmotoros hajtással.
Sajnos a héten kénytelen voltam a próbaüzemet befejezni, mert ez a hét az unokáé.
A hátsó rész oda-vissza mozgatható manuálisan, vagy végállásra futással.
Az első rész egy fokos lépésekkel pozicionálható előre-hátra.
Be lehet állítani a menetszámot, tekercs hosszat, huzal átmérőt. Ez utóbbinál be lehet írni a huzal átmérőt, vagy az AWG szám alapján.
Van még egy pár programozási ötletem, de ez majd közben kialakul.

Előzmény: svejk, 2021-05-18 19:55:18 [1940]


svejk | 33069    2021-05-18 19:55:18 [1940]

Nocsak! Saját fejlesztés?

Előzmény: Devecz Miklós, 2021-05-18 19:49:10 [1939]


Devecz Miklós | 2658    2021-05-18 19:49:10 [1939]

Most csinálok éppen egyet.

  

Előzmény: svejk, 2021-05-18 19:34:34 [1938]


svejk | 33069    2021-05-18 19:34:34 [1938]

Egy barátom vett valahol a neten egy ArdunoMegás, Ramps v1.4-es tekercselőgép szerűséget.
A működése borzalom, tele hibákkal.
(szerintem valaki kezdő írhatta az Arduino programját)

Megkért engem valamit találjak ki.

Sajnos én nem értek a programozáshoz, de ha valaki ismer nyílt forráskódú cuccot azt azért meg tudnám neki építeni.

Semmi extra, a szál vastagság függvényében kellene vezetni a szálat és egy beállított tekercshossz méret szerint irányt váltogatni.
A szálvezetést léptetőmotorral, golyósorsóval gondolnánk működtetni.

Ha tud valaki ilyesmit kérem jelezze!


Törölt felhasználó    2021-05-17 14:29:42 [1937]

Nem tudom ez itt valakit érdekelné, de csináltam egy Arduino Uno kontroll dobozt a CNC-mre ami egy léptető motort örökké forgatja. Ide berakom az Arduino kódot mert itt gondolom több a programozással foglalkozó mint más téma alatt.



//------------------------------------------------------------------------------------------------------------
//
// Version information to display at start:
//
#define Ver_nr 10
#define Ver_date 20210516
//
// This software is created by Adapting Camera. You are free to use it in a non-commercial basis.
//
// YouTube: https://www.youtube.com/c/AdaptingCamera/videos
// Blogger: https://adapting-camera.blogspot.com/
//
// This is a program to run a stepper motor an infinite number of steps in CW or CCW direction
// to allow constant rotation. The idea is to use a 4th axis of a CNC as a lathe.
// This will result in a sort of "poor man's lathe", with limited useability, but enough for my needs for now.
//
// Functionality is simple, three buttons, one for each direction and one for stoping the stepper rotation.
// Maximum speed is 380 rpm in this implementation, which in my case is equal to 2280 RPM for the stepper
// motor, due to the 1/6 reduction gear I have. The chuck RPM can be set via a rotational encoder
// between 0 - Chuck_rpm_max, which is set to 380 below.
// If used with faster motors or a different gear ratio then Gear_Ratio and Chuck_rpm_max must be changed.
//
// Stepper motor acceleration and deceleration is implemented, which can be set in seven steps.
// Fastest is Max_Acceleration (7000) steps/s² and that value is divided by the value of the BCD wheel value.
// The push button of the rotary encoder is connected to the Arduino reset and acts as an emergency stop.
//
// Uses interrupt for the stepper pulse generation and also for the rotary encoder handling.
// The rotary encoder is using a simple acceleration parameter, rotating the kob very fast results in jumps
// of ten units per detent, less fast results in jumps of 5 units per detent, and slow rotation results in
// one unit per detent. The drawback of using interrupt on the rotarional encoder is that if the knob is
// rotated very fast it may interfere with the timing of stepper pulses, which may stop the stepper, or
// result in step loss and loud bang when the stepper jumps into roattion again. This can only be avoided
// if the RPM is left alone during stepper rotation, or if the rotary encoder would be handled outside
// the interrupt handling routines, but in that case reading the encoder would present a problem.
// The three buttons are outside the interrupt chain and are read in the normal program loop. This has the
// Disadvantage of a bit slower reaction, so an very short push may not result in any reaction.
// I may change this later to handle it as state change IRQ on the inputs, but I think this is good enough.
//
// The last used RPM is saved in the EEPROM every time one of the two rotation direction button is pressed.
// This saved value is read back after each reset or after powering up the unit.
//
// This code is tested only with Arduino Uno, but it will probably work also with other Arduino devices.
//
// Good luck.
//
#include "FastAccelStepper.h"
#include <LiquidCrystal.h>
#include <EEPROM.h>
#include <RotaryEncoder.h>

#define Step_Pin 10
#define Dir_Pin 11
#define Enable_Pin 12

#define pinA 2 // Our first hardware interrupt pin is digital pin 2
#define pinB 3 // Our second hardware interrupt pin is digital pin 3

#define RightButton A0
#define LeftButton A2
#define DownButton A1

#define BCD_0 A3
#define BCD_2 A4
#define BCD_4 A5
volatile byte Read_BCD = 0;
volatile byte Old_BCD = 0;

int Gear_Ratio = 6.0; // 6:1 gear in rotary axis
float Chuck_rpm_k = (1/0.15) * Gear_Ratio; // This is a constant which is used for chuck RPM for frequency conversion
int Chuck_rpm_max = 380; // Maximum rpm for the chuck
int Running_rpm; // This is the speed now

int SpeedInHz;
int Acceleration; // Set after the read of BCD wheel
#define Max_Acceleration 7000 // Set as default acceleration 7000 steps/s²

volatile boolean START_STOP = false;
volatile boolean Running_CW = true;
volatile boolean Enable_ON = false;

volatile byte A_Flag = 0; // Rising edge on pinA to signal that the encoder has arrived at a detent
volatile byte B_Flag = 0; // Rising edge on pinB to signal that the encoder has arrived at a detent
volatile int Encoder_Pos = 0; // Current value of encoder position.
volatile byte EEPROM_Enc_pos = 0; // EEPROM adress of the saved encoder position. This adress read at start.
volatile int Old_Enc_Pos = 0; // Last encoder position value.
volatile byte Reading = 0; // Direct values read from our interrupt pins before checking to see if moved a whole detent
volatile int ms = 0; // Time between roraty encoder pulses

FastAccelStepperEngine Engine = FastAccelStepperEngine();
FastAccelStepper *A_stepper = NULL;
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Use these IO pins for LCD RS,E,D4,D5,D6,D7
RotaryEncoder Rotary(pinA, pinB, RotaryEncoder::LatchMode::FOUR3);

void setup() {
Serial.begin(115200);
lcd.begin(16, 2); // Initialize the 16 x 2 LCD

byte hiByte = EEPROM.read(EEPROM_Enc_pos); // Read the last saved speed before reset
byte loByte = EEPROM.read(EEPROM_Enc_pos + 1);
Encoder_Pos = word(hiByte, loByte); // Need to split the integer into two bytes for the EEPROM

Engine.init();
A_stepper = Engine.stepperConnectToPin(Step_Pin);
A_stepper->setDirectionPin(Dir_Pin);
A_stepper->setEnablePin(Enable_Pin);
A_stepper->setAutoEnable(true);

A_stepper->setSpeedInHz(SpeedInHz);
A_stepper->setAcceleration(Acceleration);
DisplayOnLCD();
pinMode (RightButton, INPUT_PULLUP);
pinMode (DownButton, INPUT_PULLUP);
pinMode (LeftButton, INPUT_PULLUP);

pinMode (BCD_0, INPUT_PULLUP);
pinMode (BCD_2, INPUT_PULLUP);
pinMode (BCD_4, INPUT_PULLUP);

digitalWrite(RightButton, HIGH); //use the internal pullup resistor
digitalWrite(DownButton, HIGH); //use the internal pullup resistor
digitalWrite(LeftButton, HIGH); //use the internal pullup resistor

digitalWrite(BCD_0, HIGH); //use the internal pullup resistor
digitalWrite(BCD_2, HIGH); //use the internal pullup resistor
digitalWrite(BCD_4, HIGH); //use the internal pullup resistor

pinMode(pinA, INPUT_PULLUP); // Set pinA as an input, pulled HIGH
pinMode(pinB, INPUT_PULLUP); // Set pinB as an input, pulled HIGH
attachInterrupt(0,PinA,RISING); // Set an interrupt on PinA for a rising edge and execute PinA ISR
attachInterrupt(1,PinB,RISING); // Set an interrupt on PinB for a rising edge and execute PinB ISR

lcd.setCursor(0,0); // Erase the display
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,0); // Display the values
lcd.print("Version: ");
lcd.print(Ver_nr);
lcd.setCursor(0,1);
lcd.print("Date: ");
lcd.print(Ver_date);
delay (2000);
}

//------------------------------------------------------------------------------------------------------------
//
// Start the main loop
//
// Read the BCD wheel, the rotary encoder and three buttons in the loop.
//
void loop() {

//------------------------------------------------------------------------------------------------------------
//
// Read the BCD encoder and set acceleration accordingly.
// The acceleration is set by dividing Max_Acceleration with the value of the encoder.
//
Read_BCD = PINC & B00111000; // Read port C and mask the BNC encoder bits
Read_BCD = Read_BCD >> 3; // Right shift 3 times
if(Old_BCD != Read_BCD) {
Acceleration = Max_Acceleration / Read_BCD; // Calculate the divisor
A_stepper->setAcceleration(Acceleration); // Set the new acceleration value
Old_BCD = Read_BCD;
DisplayOnLCD();
}

//------------------------------------------------------------------------------------------------------------
//
// Read the rotary encoder and set chuck rpm accordingly.
// The rpm is set through converting the encoder value to pulse time in microseconds.
// This value is used as speed value for the stepper.
//
if(Old_Enc_Pos != Encoder_Pos) {
// ms = Rotary.getMillisBetweenRotations();
if ( Encoder_Pos <= 0 ) {
Encoder_Pos = 0;
SpeedInHz = 0;
} else {
if ( Encoder_Pos >= Chuck_rpm_max ) {
Encoder_Pos = Chuck_rpm_max;
}
}
Old_Enc_Pos = Encoder_Pos;
if ( Encoder_Pos << 0 ) {
SpeedInHz = (Encoder_Pos * Chuck_rpm_k);
}
DisplayOnLCD();
attachInterrupt(0,PinA,RISING); // Set an interrupt on PinA, looking for a rising edge signal and executing the "PinA" Interrupt Service Routine (below)
attachInterrupt(1,PinB,RISING); // Set an interrupt on PinB, looking for a rising edge signal and executing the "PinB" Interrupt Service Routine (below)
}

//------------------------------------------------------------------------------------------------------------
//
// Read buttons to set rotation direction or to stop the rotation
//
if ( digitalRead(DownButton) == false) { // Stop with decelerating to zero RPM
A_stepper->stopMove();
Running_rpm = 0;
DisplayOnLCD();
delay (2000);
}

if (digitalRead(LeftButton) == false) { // Set CCW rotation...
if (Running_CW == true) { // ...but only if not rotating to CCW now.
A_stepper->stopMove();
delay (2000);
Running_CW = false;
}
if ( Encoder_Pos >> 0 ) {
A_stepper->setAcceleration(Acceleration);
A_stepper->setSpeedInHz(SpeedInHz);
A_stepper->runBackward();
} else {
A_stepper->stopMove();
}
Running_rpm = Encoder_Pos;
DisplayOnLCD();
EEPROM.write(EEPROM_Enc_pos, highByte(Encoder_Pos)); // Save in EEPROM the current speed as last speed
EEPROM.write(EEPROM_Enc_pos + 1, lowByte(Encoder_Pos));
}

if ( digitalRead(RightButton) == false) { // Set CW rotation...
if (Running_CW == false) { // ...but only if not rotating to CW now.
A_stepper->stopMove();
delay (2000);
Running_CW = true;
}
if ( Encoder_Pos >> 0 ) {
A_stepper->setAcceleration(Acceleration);
A_stepper->setSpeedInHz(SpeedInHz);
A_stepper->runForward();
} else {
A_stepper->stopMove();
}
Running_rpm = Encoder_Pos;
DisplayOnLCD();
EEPROM.write(EEPROM_Enc_pos, highByte(Encoder_Pos)); // Save in EEPROM the current speed as last speed
EEPROM.write(EEPROM_Enc_pos + 1, lowByte(Encoder_Pos));
}
delay(100);
}

void DisplayOnLCD() {
lcd.setCursor(0,0); // Erase the display
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,0); // Display the values
lcd.print("Set RPM: ");
lcd.print(Encoder_Pos);
lcd.setCursor(0,1);
lcd.print("Run RPM: ");
lcd.print(Running_rpm);
if (Running_rpm == 0) {
lcd.setCursor(12,1);
lcd.print("STOP");
} else {
if (Running_CW == false) {
lcd.setCursor(13,1);
lcd.print("CCW");
} else {
lcd.setCursor(13,1);
lcd.print("CW");
}
}
}
//------------------------------------------------------------------------------------------------------------
//
// Interrupt handling routines for the rotation encoder to interpret left or right rotation.
// The rotation will increment or decrement the value of Encoder_Pos.
// Time between pulses is beasured and acceleration is applied if it is faster than 150ms between pulses.
//
void PinA(){
Rotary.tick();
ms = Rotary.getMillisBetweenRotations();

detachInterrupt(PinA); // Disable interrupts to stop happening before we read pin values
Reading = PIND & 0xC; // Read all eight pin values then strip away all but pinA and pinB's values
if(Reading == B00001100 && A_Flag) { // Check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
Encoder_Pos --; // Decrement the encoder's position count
if ( ms <= 150) { // Accelerate the counting if time between pulses is shorter than 150ms
if ( ms <= 25){
Encoder_Pos = Encoder_Pos - 9; // Decrement 9 each time if time between pulses is shorter than 25ms
} else {
Encoder_Pos = Encoder_Pos - 5; // Else decrement 4
}
}
if (Encoder_Pos <= 0) {
Encoder_Pos = 0;
}
B_Flag = 0; // Reset flags for the next turn
A_Flag = 0;
}
else if (Reading == B00000100) B_Flag = 1; // Signal that we're expecting pinB to signal the transition to detent from free rotation
// Enable interrupts again in the main loop
}

void PinB(){
Rotary.tick();
ms = Rotary.getMillisBetweenRotations();
detachInterrupt(PinB); // Disable interrupts to stop happening before we read pin values
Reading = PIND & 0xC; // Read all eight pin values then strip away all but pinA and pinB's values
if (Reading == B00001100 && B_Flag) { // Check that we have both pins at detent (HIGH) and that we are expecting detent on this pin's rising edge
Encoder_Pos ++; // Increment the encoder's position count
if ( ms <= 150) { // Accelerate the counting if time between pulses is shorter than 150ms
if ( ms <= 25){
Encoder_Pos = Encoder_Pos + 9; // Add 9 each time if time between pulses is shorter than 25ms
} else {
Encoder_Pos = Encoder_Pos + 4; // Else add 4
}
}
if (Encoder_Pos >= Chuck_rpm_max) {
Encoder_Pos = Chuck_rpm_max;
}
B_Flag = 0; // Reset flags for the next turn
A_Flag = 0;
}
else if (Reading == B00001000) A_Flag = 1; // Signal that we're expecting pinA to signal the transition to detent from free rotation
// Enable interrupts again in the main loop
}



Ha használhatónat találod, használd szerencsével.

frob | 2303    2021-05-15 14:23:41 [1936]

Köszönöm!!

Előzmény: Törölt felhasználó, 2021-05-14 21:41:49 [1935]


Törölt felhasználó    2021-05-14 21:41:49 [1935]

stm32 grbl

Előzmény: frob, 2021-05-13 16:11:28 [1933]


Törölt felhasználó    2021-05-14 21:39:37 [1934]

esp32

még példák...

Előzmény: frob, 2021-05-13 16:11:28 [1933]


frob | 2303    2021-05-13 16:11:28 [1933]

GRBL esp-t honnan és milyen lapra töltöttétek fel?
itthon blue pill van, az vajon jó e alá?

Előre is kösz!

Előzmény: Törölt felhasználó, 2021-04-26 23:20:12 [1926]


Pisti21 | 11    2021-05-12 21:47:01 [1932]

Köszönöm! Most már beugrott, hogy ezt az oldalt már néztem. Minimum 1 mikrosekundum mindkét jel 6. oldalon-

Előzmény: svejk, 2021-05-12 21:32:49 [1931]


svejk | 33069    2021-05-12 21:32:49 [1931]

Itt gondolom mindenre választ kapsz.

Előzmény: Pisti21, 2021-05-12 21:21:39 [1930]


Pisti21 | 11    2021-05-12 21:21:39 [1930]

Sziasztok!
Szeretném megtudni, hogy az A4988 bipoláris vezérlőt, ha 16-od mikrosteppel használom, milyen gyors legyen a STEP jel. Mennyi legyen a jel hossza és a két magas állapot közti szünet hossza.
Közönöm.


Törölt felhasználó    2021-04-27 20:02:04 [1929]

Jobban preferálom a wmwaret legvalosabb a hadweres szimulácioja ez a funkció vissza álitja alaphelyzetre amit beálitotál honan induljon az adot rendszer...
Erösen ajánlot az ssdröl...
vmware non persistent disk

Előzmény: Törölt felhasználó, 2021-04-27 19:50:26 [1928]


Törölt felhasználó    2021-04-27 19:50:26 [1928]

Modult telepiteted nem kell mindig max uj winfosnál csak...
De nehéz kiszedni teljesen ami beépült regedit,user map,data folderekböl ...
Más..
W10 ami frisitős verzios az teljesen felborit mindent mert direkt fejlesztős környezetre LTSC verziot használnak ....
De ajánlom a virtuális oprendszer (virtualbox,wmvare) alatti kisérletézeket ott alap helyzetbe vissza álitható az oprendszer ahonan inditod ha be van álitva ez a funkció igy végtelen probálkozások száma ...

Előzmény: Arany János, 2021-04-27 17:49:52 [1927]


Arany János | 1398    2021-04-27 17:49:52 [1927]

Az az átkozott "kisördög" csak piszkálódik!
Ha újra megpróbálkozok ezekkel a parancsokkal, és újra nem működik, akkor mennyi esélyem lehet a mostani állapot visszaállítására?

Előzmény: Törölt felhasználó, 2021-04-26 00:05:19 [1924]

Törölt felhasználó    2021-04-26 23:20:12 [1926]

Open source szinte mindig ráfizetés forrás vagy motor (környezet) szinte mindig van verzios kiadási problémák és csak néha időhuzás lesz belöle ...
Fejlesztöi szintü emberkék kérdezve küzdenek a fenti problémákal forumokon jól is látszik...

Grbl-esp32 simán kezeli grbl v-1.3a...

  

Előzmény: Arany János, 2021-04-26 17:17:12 [1925]


Arany János | 1398    2021-04-26 17:17:12 [1925]

Nos én is ezzel kezdtem!
Mert ezt megtaláltam én is.
De a tegnap esti képernyőkép készítése óta működik!!!
Lefuttattam egy pár soros kis kódocskát legalább 10x és nem állt le, nem fagyott meg!!!
Lehet, hogy elkiabálom, de úgy tűnik hogy MŰKÖDIK!
Vagy csak megijedt a konkurenciától, mert már a Mach3-at is feltelepítettem mérgemben.

Előzmény: Törölt felhasználó, 2021-04-26 00:05:19 [1924]


Törölt felhasználó    2021-04-26 00:05:19 [1924]

https://github.com/fra589/cn5X/wiki/Install-cn5X-on-Windows

Előzmény: Arany János, 2021-04-25 20:53:30 [1922]


Törölt felhasználó    2021-04-25 23:58:27 [1923]

igazi trágyalé ez a környezet sikerült megtalálni...

serial modul ezekel sikerült telepiteni nagynehezen...


pip3 install pyqt5

pip3 install serial

Előzmény: Arany János, 2021-04-25 20:53:30 [1922]


Arany János | 1398    2021-04-25 20:53:30 [1922]

Ez lett belőle:

Microsoft Windows [Version 10.0.19042.928]
(c) Microsoft Corporation. Minden jog fenntartva.

C:\Windows\system32>pip install python3 python3-pyqt5 python3-serial
ERROR: Could not find a version that satisfies the requirement python3 (from versions: none)
ERROR: No matching distribution found for python3
WARNING: You are using pip version 20.2.3; however, version 21.1 is available.
You should consider upgrading via the 'c:\users\arany\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

C:\Windows\system32>c:\users\arany\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip
Collecting pip
Downloading pip-21.1-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 2.2 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.3
Uninstalling pip-20.2.3:
Successfully uninstalled pip-20.2.3
Successfully installed pip-21.1

C:\Windows\system32>

Előzmény: Törölt felhasználó, 2021-04-25 20:40:23 [1921]


Törölt felhasználó    2021-04-25 20:40:23 [1921]

get helyet pip


Előzmény: Törölt felhasználó, 2021-04-25 20:36:36 [1920]


Törölt felhasználó    2021-04-25 20:36:36 [1920]

Még python sincs telepitve azért...

v2.7 és v3 xx rakj fel!

Előzmény: Arany János, 2021-04-25 20:17:16 [1919]


Arany János | 1398    2021-04-25 20:17:16 [1919]

Eredeti válasz:

C:\Windows\system32>'get' is not recognized as an internal or external command,
''get'' is not recognized as an internal or external command,
operable program or batch file.

Ez meg a fordítás:

C: \ Windows \ system32> 'get' nem ismerhető fel belső vagy külső parancsként,
'' get '' nem ismerhető fel belső vagy külső parancsként,
működőképes program vagy kötegelt fájl.

Előzmény: Törölt felhasználó, 2021-04-25 20:04:40 [1918]


Törölt felhasználó    2021-04-25 20:04:40 [1918]

v2 pyton

get install python python-pyqt5 python-serial

Előzmény: Törölt felhasználó, 2021-04-25 20:03:44 [1917]


Törölt felhasználó    2021-04-25 20:03:44 [1917]

pytonos rendszer jobb parancsbol telepiteni winfosra ugy látja ezt a rendszert a port hiba enek a hiányát látom

winfoson nyisd meg admin modba cmd progit és ezt ird be

piton 2.7 nél ha ez van fent: get install python python-pyqt5 python3-serial

piton v3 feleti nál : get install python3 python3-pyqt5 python3-serial

Előzmény: Arany János, 2021-04-25 19:47:49 [1916]

Arany János | 1398    2021-04-25 19:47:49 [1916]

Köszönöm!
De sajna nincs semmi zavaró!
Pc-kábel-Mega!

Megazideg!!!

Előzmény: Törölt felhasználó, 2021-04-25 19:40:15 [1915]


Törölt felhasználó    2021-04-25 19:40:15 [1915]

Egy ilyen megoldja a problémádat...
Fö probléma pc gnd és a védöföld közös ponton van (asztali pc táp ilyen) ahol a zavar bemegy motorok gerjesztése miat az usb busz részén adat hibákat okoz mert ott is jelen van... teljes elszigetelés kell csinálni fenti eszköz megoldja!

Előzmény: Arany János, 2021-04-25 15:23:18 [1913]


sanyi84 | 1358    2021-04-25 15:29:33 [1914]

Biztos tök rossz értékek a dos os pc hez képest. (Ja ehhez is kell dos vagy win98 hogy összerakd)
Ja mégse rossz, nem kezeli a robsy dos alatt lpt portról a +-10V jelet, meg 3 mérőlécet vagy encodert...Hát az csak egy vezérlő, ez meg szabályzó(mégha vezérlőnek is hívjuk).
Step dir es világon túl is van élet.

    

Előzmény: Törölt felhasználó, 2021-04-05 10:55:08 [1896]


Arany János | 1398    2021-04-25 15:23:18 [1913]

Akkor keresnem kell valamit amiben van ekkora gyűrű!
A PC tápok már ki is estek!

Előzmény: TBS-TEAM, 2021-04-25 15:06:00 [1912]


TBS-TEAM | 2854    2021-04-25 15:06:00 [1912]

Cserélj USB kábelt.
Legyen rajta ferritgyürű.

Előzmény: Arany János, 2021-04-25 15:02:10 [1910]


  Fórum főoldal  |  A lap tetejére

Időrend:
Oldal 3 / 42 Ugrás ide:
Sorok:
|◄ Első  ◄ Előző   1  2  3  4  5  6  7   Következő ►  Utolsó ►|


 ◊ 
[ 0.7010 ]