//https://github.com/Macrobase-tech/CNC-Software?spm=a2g0o.detail.1000023.17.c19f461cQPTcPs
//https://github.com/makerbase-mks/ODrive
//https://github.com/odriverobotics/ODrive

//https://github.com/Macrobase-tech/Nano-V3
//https://github.com/odriverobotics/ODrive/tree/master/Firmware/MotorControl
//https://github.com/odriverobotics/ODrive.git
//https://www.aliexpress.com/item/1005004234919226.html?spm=a2g0o.order_list.0.0.67bc1802wgbrZO&gps-id=pcOrderListRecommend&scm=1007.38956.276740.0&scm_id=1007.38956.276740.0&scm-url=1007.38956.276740.0&pvid=7bf15e4a-0d29-4f58-bef6-dc44457bdcd7&_t=gps-id:pcOrderListRecommend,scm-url:1007.38956.276740.0,pvid:7bf15e4a-0d29-4f58-bef6-dc44457bdcd7,tpp_buckets:668%232846%238112%231997&pdp_ext_f=%7B%22sku_id%22%3A%2212000028475637708%22%2C%22sceneId%22%3A%2228956%22%7D&pdp_npi=2%40dis%21HUF%211028.75%21843.72%21%21%21%21%21%40211b423c16756982933241499e82e6%2112000028475637708%21rec

//https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx/blob/main/projects/usart_rx_idle_line_irq_L4/Src/main.c
//https://www.aliexpress.com/item/1005002542610332.html?spm=a2g0o.productlist.main.21.2dfd7230ESYUXW&algo_pvid=00bed551-a1bd-494f-929a-c1aca9dafea2&algo_exp_id=00bed551-a1bd-494f-929a-c1aca9dafea2-10&pdp_ext_f=%7B%22sku_id%22%3A%2212000021721670199%22%7D&pdp_npi=3%40dis%21HUF%213902.64%213902.64%21%21%21%21%21%40212272e216757800322424277d0685%2112000021721670199%21sea%21HU%21916113630&curPageLogUid=lRD6zrEZani6
//https://www.riscv-mcu.com/nucleistudio.html
//https://www.nucleisys.com/download.php
//https://embeddedexpert.io/?p=930
//https://controllerstech.com/uart-dma-with-idle-line-detection/
//https://www.youtube.com/watch?v=Bo6MC5A8uTE
//https://github.com/1847123212/STM32_USART_DMA_RX
//https://www.youtube.com/watch?v=1CV3tWlRW5A
//https://controllerstech.com/managing-multiple-uarts-in-stm32/
//https://github.com/controllerstech/stm32-uart-ring-buffer

//https://github.com/joeferner/stm32-utils/blob/master/ringbuffer.c
//https://www.baeldung.com/java-ring-buffer
//https://github.com/AndersKaloer/Ring-Buffer
//https://github.com/controllerstech/stm32-uart-ring-buffer/blob/master/Src/UartRingbuffer.c
//https://deepbluembedded.com/stm32-usart-uart-tutorial/
//https://blog.csdn.net/weixin_41865104/article/details/106841159
//https://community.st.com/s/article/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages
//https://community.st.com/s/question/0D53W00001EGOjESAX/how-to-handle-variable-length-receive-data-via-uart
//Jól viszi át a dma idle.. de csak 15 hosszan
//https://www.youtube.com/watch?v=1ndW3lyO33o
//https://embeddedexpert.io/?p=1509
//https://riptutorial.com/ebook/cplusplus
//https://riptutorial.com/ebook/linux
//https://riptutorial.com/Download/linux-device-driver.pdf
//https://riptutorial.com/ebook/embedded-linux
//https://riptutorial.com/ebook/linux-kernel
//https://riptutorial.com/linux-kernel/example/23719/building-and-running-the-module
//https://blog.csdn.net/ic2121/article/details/124029638
//https://www.gd32mcu.com/en/download/7?kw=
//https://www.buildyourcnc.com/item/electronicsAndMotors-electronic-component-breakout-Mach3-USB-Board
//https://github.com/stefanneumeister/node-mach3-api
//https://github.com/ChristianBrandtner/Bluepill_Mach3_Interface
//https://github.com/terjeio/grblHAL
//https://github.com/grblHAL
//https://github.com/terjeio/grblHAL/tree/master/drivers/STM32F1xx
//https://github.com/terjeio/grblHAL/blob/master/drivers/STM32F3xx/Inc/my_machine.h
//https://www.arterytek.com/en/product/AT32F403.jsp
//https://github.com/WeActStudio/ArduinoCore-AT32F4
//https://www.aliexpress.com/item/1005001474741936.html?spm=a2g0o.store_pc_groupList.8148356.12.36947b26Rxk0dW&pdp_npi=2%40dis%21HUF%21HUF%201%2C490.40%21HUF%201%2C281.70%21%21%21%21%21%4021038ede16762904009082311e140f%2112000029156583483%21sh
//https://github.com/WeActStudio/WeActStudio.BluePill-Plus-APM32.git
//https://gd32mcu.com/data/documents/userManual/GD32F30x_User_Manual_Rev2.9.pdf
//https://bestofcpp.com/repo/CommunityGD32Cores-ArduinoCore-GD32
//https://github.com/stevstrong/Ethernet_STM32
//https://www.s-e.hu/RS-232/422/485-KISOKOS
//https://th.bing.com/th/id/R.49dc2f7800491bba88f4b851675af4b3?rik=dPFLu6QxkHTbCA&riu=http%3a%2f%2felectrobist.com%2fwp-content%2fuploads%2f2018%2f08%2fMAX485-BASED-TTL-TO-RS485-TRANSCEIVER-MODULE-IN-PAKISTAN-2.jpg&ehk=1nmEsqoCfNkhqiItvHwWh7rO03FxQETfrjbgLgMFDlY%3d&risl=&pid=ImgRaw&r=0
//
//https://www.integrasources.com/blog/bldc-motor-controller-design-principles/
//https://simple-circuit.com/arduino-sensorless-bldc-motor-controller-esc/
//https://www.bldcmotor-driver.com/photo/domaindemo-39509/document/11455/JY01_V3.5_2018-English.pdf
// http://www.circuitstoday.com/square-wave-generator-using-ua-741

//https://www.bristolwatch.com/ele3/tristate2/hb_big1.jpg
//https://www.bristolwatch.com/ele3/buffer.htm

//Micropython picopi
//https://freenove.com/fnk0081/?spm=a2g0o.detail.1000023.1.70d17a25QzdtmF
//https://www.aliexpress.com/item/1005004709248186.html?spm=a2g0o.productlist.main.65.3d9c17a0fMzwhl&algo_pvid=78eeab7a-beb9-4eac-9090-edf5c09fcf60&algo_exp_id=78eeab7a-beb9-4eac-9090-edf5c09fcf60-32&pdp_ext_f=%7B%22sku_id%22%3A%2212000030183880780%22%7D&pdp_npi=3%40dis%21HUF%212208.09%212208.09%21%21%21%21%21%40211bf2da16764658934922121d06c1%2112000030183880780%21sea%21HU%21916113630&curPageLogUid=jrGlCzhxxm4R
//
//https://github.com/Klipper3d/klipper/blob/master/src/stm32/gpio.c
//https://www.youtube.com/watch?v=2-DsIHSmaXo
//http://abyz.me.uk/rpi/pigpio/pdif2.htmlg
//https://www.youtube.com/watch?v=BKgh896Bj8Q&t=616s
//https://curiousscientist.tech/blog/as5600-nema17-speed-and-position
//https://github.com/adafruit/AccelStepper/blob/master/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
//https://github.com/Walid-khaled/Stepper-Motors-Synchronization-for-Robot-Control
//https://blog.csdn.net/wenguitao/article/details/104858151
//https://forum.arduino.cc/t/how-to-get-an-array-from-serial-read/943646/60
//https://stackoverflow.com/questions/56384201/how-receive-data-with-hal-uart
//https://deepbluembedded.com/stm32-stepper-motor-control-library-unipolar-28byj-48-uln2003/
//https://www.google.hu/imgres?imgurl=https%3A%2F%2Fmicrocontrollerslab.com%2Fwp-content%2Fuploads%2F2022%2F10%2FSTM32-Stepper-Motor-with-ULN2003A-motor-driver-and-stepper-motor-connection-diagram.jpg&imgrefurl=https%3A%2F%2Fmicrocontrollerslab.com%2Fstm32-blue-pill-28byj-48-stepper-motor-uln2003%2F&tbnid=2zWr9hyQ5UGIEM&vet=12ahUKEwid9Ou1uZr9AhUM4aQKHeNtAO8QMygAegQIARA7..i&docid=0ZAKww57lS5BBM&w=1189&h=717&q=stm32%20nucleo%20ulm2003&ved=2ahUKEwid9Ou1uZr9AhUM4aQKHeNtAO8QMygAegQIARA7

//https://www.youtube.com/watch?v=CAVYHlFGpaw&t=1733s
//https://community.st.com/s/question/0D53W00000LCR1zSAH/using-idle-line-detection-dma-on-stm32l42x
//https://deepbluembedded.com/stm32-timers-tutorial-hardware-timers-explained/
//https://www.youtube.com/watch?v=Sk5XrgSaftk

//https://github.com/Deotti-cl/linuxcnc-esp3
//https://www.youtube.com/watch?v=_Goi4YVU0js&t=51s
//https://www.youtube.com/watch?v=UXWcg7PwRJs
//https://github.com/jzolee/HAL2UDP
//https://forum.linuxcnc.org/18-computer/23166-arduino-i-o-with-linuxcnc
//jónak tűnő arduino program cnc vezérlés medicine dispense
//https://github.com/i2make/6axis_bresenham_linkage_stepper_arduino
//https://controllerstech.com/interface-stepper-motor-with-stm32/

//https://github.com/jcchurch13/Mechaduino-Firmware
//https://reprap.org/wiki/Motor_control_loop
//https://www.mikrocontroller.net/attachment/466406/stepper.c
//https://luni64.github.io/TeensyStep/index
//https://github.com/Meekdai/STM32-GRBL/blob/master/user/cnc/stepper.c
//https://github.com/zomborid/STM32Step
//https://www.youtube.com/watch?v=Ioa6haiVveE&t=375s
//https://www.youtube.com/watch?v=FmhKPA-TDSg
//https://www.youtube.com/watch?v=LONGI_JcwEQ&t=9s

//https://deepbluembedded.com/esp32-external-interrupts-pins-arduino-examples/
//https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/memory-types.html
//https://www.youtube.com/watch?v=Kqnw9jvceSg&t=112s
//https://hackaday.com/tag/iram/
//ezt bevinni interrupt timer steppe mtorohoz
//https://github.com/jzolee/HAL2UDP/blob/main/src/main.cpp

//https://www.youtube.com/watch?v=ZLuaE3TrEug


//can bus monitor
//https://boosty.to/car_tools_info
//https://www.youtube.com/watch?v=X-m6XKwzfb8&list=PL3sYUBHMIRst7dwrXQzWDCjYMEsaOjOPc
//https://www.youtube.com/watch?v=ZH_CCs12ptg

//https://www.otpip.hu/ingatlan/M222110/elado-csaladi-haz-2451-ercsi-savanyuret?m=M222110
//https://www.otpip.hu/ingatlan/M229433/elado-csaladi-haz-2471-baracska-vasutallomas?m=M229433
//https://www.otpip.hu/ingatlan/M217128/elado-csaladi-haz-3388-poroszlo-falu-szele?m=M217128
//https://dh.hu/ingatlan/HZ044329/elado-haz-zala-megye-nagykanizsa-nagykanizsa-mellett-kisfakoson-talalhato-ez-az-imadnivalo-kis-haziko
//https://dh.hu/ingatlan/HZ065303/elado-haz-zala-megye-nagykanizsa-varos-szelen

//PWM DMA_ PWM send data 
//https://controllerstech.com/pwm-with-dma-in-stm32/

//python network
//https://github.com/raspberrypilearning/networking-lessons
//https://github.com/kstzl/UrsinaNetworking
//https://github.com/bayrell-os/p2p-network/


//Ursina python
//https://www.ursinaengine.org/ursina_for_dummies.html
//https://www.ursinaengine.org/api_reference.html


//esp32 can
//https://www.youtube.com/watch?v=X-m6XKwzfb8&list=PL3sYUBHMIRst7dwrXQzWDCjYMEsaOjOPc
//ESP32_stereo object distance
//https://www.youtube.com/watch?v=CAVYHlFGpaw&t=1733s
//https://www.arrow.com/en/research-and-events/articles/pid-controller-basics-and-tutorial-pid-implementation-in-arduino
//https://www.youtube.com/watch?v=QpqczRkkfB0&t=10s
//https://github.com/fly51fly/aicoco/issues/3
//https://www.youtube.com/watch?v=CAVYHlFGpaw&t=1739s


//PID Motor Learning Kit Encoder Position Control Speed Control DC Motor PID Development Learning Tutorial
//https://www.aliexpress.com/item/1005002952756075.html?gatewayAdapt=4itemAdapt
//

//OWN 16bit CPU 
//https://www.youtube.com/watch?v=Zt0JfmV7CyI
//https://github.com/sam-astro/Astro8-Computer/tree/main/Astro8-Emulator

//flash write read
//https://www.youtube.com/watch?v=BKgh896Bj8Q


//GRBLHALL
//https://github.com/grblHAL
//https://github.com/terjeio/grblHAL/wiki/Compiling-GrblHAL

//bidirectional 3.3<-->5 voltage shift level
//http://www.chinalctech.com/m/view.php?aid=33

//pico pi overclock in c
//https://www.youtube.com/watch?v=G2BuoFNLoDM

//https://www.youtube.com/watch?v=RLCPKa9SoF0
//https://www.eevblog.com/forum/projects/rotary-encoder-counter-with-serial-interface/
//https://github.com/fbolanos/LS7366R/blob/master/LS7366R.py
//https://eu.mouser.com/ProductDetail/Dialog-Semiconductor/SLG46140V-DIP?qs=w%2Fv1CP2dgqqom5YtzpGtCw%3D%3D
//https://www.renesas.com/br/en/document/apn/cm-277-quadrature-encoder-counter-spi-bus-interface
//https://hu.farnell.com/search?st=slg46140v&gs=true

//https://www.etechnophiles.com/raspberry-pi-pico-projects/
//https://github.com/torvalds/linux/blob/master/drivers/spi/spi-gpio.c
//https://www.xing.com/profile/Ivan_Mitic

//https://www.instructables.com/Make-Your-Own-OscilloscopeMini-DSO-With-STC-MCU-Ea/
//https://www.instructables.com/Simplest-4-Bit-TTL-CPU/
//https://hackaday.com/2019/10/16/the-smallest-homebrewed-ttl-cpu-in-the-world/
//https://en.wikipedia.org/wiki/Arithmetic_logic_unit
//https://github.com/pootle/tripipy/blob/master/examples/motors2.py
//https://github.com/tommag/TMC5160_Arduino
//https://www.youtube.com/watch?v=GQdz5RxIyqo&t=694s
//spi cnc esp32
//https://github.com/bdring/4_Axis_SPI_CNC/blob/master/README.md
//https://www.youtube.com/watch?v=1BJaO2nbLjA
//stepdir pic16f628
//https://www.youtube.com/watch?v=mmsUuked7DU

//https://th.bing.com/th/id/R.23fdcee467c6156d44b8e0d4a4f821f8?rik=sQIhQDhQ9MI%2blw&riu=http%3a%2f%2fc.51hei.com%2fd%2fforum%2f202007%2f08%2f135053ju3ze3v0vgtq331x.png&ehk=YsQp3%2fnFhGZxOy3avwqqHrxneAAcBWA04mzNR2YUeNY%3d&risl=&pid=ImgRaw&r=0
//A_B_I encoder to RS485
//https://www.youtube.com/watch?v=p4ltHDpxrbI

//Servo DC +/-10V comandato in Step/Dir
//https://www.youtube.com/watch?v=bn_UVhotbN8
//Kód visszafejtő program 
//https://www.youtube.com/watch?v=cwyH59nACzQ

//https://docs.micropython.org/en/latest/develop/cmodules.html
//pdf download
//https://hackaday.com/2019/08/31/micropython-and-c-play-together-better/
//
//https://hackaday.com/2021/05/25/simple-micropython-game-is-a-30-minute-game-dev-course/
//picoPi C német
//https://www.youtube.com/watch?v=wBLj-npeuPE


//https://github.com/pootle/tripipy/blob/master/examples/motors2.py

//alu
//https://en.wikipedia.org/wiki/Arithmetic_logic_unit
//http://www.enscope.nl/simas_nac/
//https://www.instructables.com/Simplest-4-Bit-TTL-CPU/
//https://www.pcbway.com/blog/PCB_Design_Tutorial/How_to_make_your_own_ESP32_breakout_board_with_minimal_circuit.html


//Servo_keil
//https://github.com/OsamaMazhar/DC-Motor-Position-Control
//micropython
//https://www.youtube.com/watch?v=FJwgDaSsob8&t=22s
/*

//grbl atmega328
//https://th.bing.com/th/id/R.53e0ea9e99f98c67d8627d4d92dbe25a?rik=Xvg2%2fLszVo%2fT1Q&riu=http%3a%2f%2fr-site.net%2fmedia%2fimg%2fgrbl+default+pins.png&ehk=0eUO6E8f1krpx0tkbChH%2f%2bAj%2fjwYdSQMh9fV1i2wSk4%3d&risl=&pid=ImgRaw&r=0


//Arduino Serial.println -> degubln
//https://www.youtube.com/watch?v=--KxxMaiwSE

//USB host stm32
//https://www.youtube.com/watch?v=pC16Aon4crk

//sscanf
//https://onlinegdb.com/OOCbQ5Tyi
//https://stackoverflow.com/questions/58836403/problem-with-using-scanf-function-under-stm32
//https://9to5answer.com/scanf-can-39-t-scan-into-uint8_t
//https://www.cnblogs.com/-colin/p/8125227.html
//http://www.elektromys.eu/stm32.php
//válasz a gépnek sprintf
//http://www.elektromys.eu/clanky/stm_usart1/clanek.html

//https://github.com/google/fpc/blob/master/fixnum_string.c
//https://www.eevblog.com/forum/microcontrollers/stm32-spi-slave-mode-receive/
//https://linuxhint.com/scanf-c/

//stm8F003 hoz arduino
//https://github.com/tenbaht/sduino
//https://github.com/tenbaht

//stm32 gpio
//https://www.youtube.com/watch?v=eDOTe3vU7tY
//https://simonmartin.ch/resources/stm32/dl/STM32%20Tutorial%2001%20-%20GPIO%20Operations%20using%20HAL%20(and%20FreeRTOS).pdf

//sensorles bldc driver
//https://www.google.com/imgres?imgurl=https%3A%2F%2Fae01.alicdn.com%2Fkf%2FHTB15l9uKFXXXXXXXVXXq6xXFXXXo%2F220674772%2FHTB15l9uKFXXXXXXXVXXq6xXFXXXo.jpg%3Fsize%3D33072%26height%3D291%26width%3D617%26hash%3D261092d18cca2a59206bf54afd017e77&tbnid=gMOZgGWlzR-w-M&vet=12ahUKEwiUwszguOL9AhWBOuwKHaEMCIEQMygDegUIARCFAQ..i&imgrefurl=https%3A%2F%2Fwww.aliexpress.com%2Fitem%2F32543825357.html&docid=YKM3e2GYGPwvvM&w=617&h=291&q=mx612%20schematic&ved=2ahUKEwiUwszguOL9AhWBOuwKHaEMCIEQMygDegUIARCFAQ#imgrc=t6ordjXxZeXNyM&imgdii=eUGx8x1jbAu42M
//https://www.ti.com/lit/ds/symlink/max3232.pdf?ts=1679033042155&ref_url=https%253A%252F%252Fwww.google.com%252F
//https://www.elecbee.com/en-30376-Mini-RS232-to-TTL-Converter-Module-Board-Adapter-MAX3232-120kbps-3-5V-Serial-Port
https://pythonhosted.org/python-periphery/serial.html
//Learning C# Programming with Unity 3D, Second Edition
//https://github.com/PacktPublishing/Learning-C-by-Developing-Games-with-Unity-Seventh-Edition


//https://www.pordentrodaeletronica.com/post/resolvendo-o-defeito-do-driver-l9134-bobina-dos-vw-fox-2004
//kapcsolási rajz bldc servo motornak..?
//https://www.youtube.com/watch?v=IphkCWT7zW4
//https://www.aliexpress.com/item/32945533935.html?spm=a2g0o.productlist.main.7.501c5929QKeqWf&algo_pvid=97bb089e-21a0-4124-8ecc-43197b035349&algo_exp_id=97bb089e-21a0-4124-8ecc-43197b035349-3&pdp_ext_f=%7B%22sku_id%22%3A%2266221602870%22%7D&pdp_npi=3%40dis%21HUF%2146142.08%2137834.68%21%21%21%21%21%40211bf31716795629767584592d06ce%2166221602870%21sea%21HU%21916113630&curPageLogUid=pYhswQYypOIS
//https://www.rocketronics.de/shop/en/hybridservodriver-cs-d508.html
//https://github.com/ottoragam/Tarocco
//https://github.com/tuenhidiy/CNC-PLOTTER-FROM-DC-MOTORS-AND-OPTICAL-ENCODERS/blob/master/CNC-PLOTTER-FROM-DC-MOTORS-AND-OPTICAL-ENCODERS.ino
//https://www.tindie.com/products/ottoragam/tarocco/
//stm32 serial.avaible
//https://community.st.com/s/question/0D53W00000Diqv1SAB/how-to-handle-the-usart-receive-with-unknow-data-length
//https://simonmartin.ch/resources/stm32/dl/STM32%20Tutorial%2003%20-%20UART%20Communication%20using%20HAL%20(and%20FreeRTOS).pdf
//https://electronics.stackexchange.com/questions/606233/what-to-do-to-stop-pwm-after-n-pulses-in-stm32
/// az frekvenciák szinkrnba hozása.. hogy az impulzusokat egyenlő időben adja ki.. ha kebesebb akkor lassabb usb kell
//https://www.youtube.com/watch?v=Z6TLqQOJO8A
// a pwm jelet elegendő ha a dutty ját le szedi 0-ra, nem kell leállítania a  kimenetet...
//bár a számlálóját is újra kell indítani/nullázni

https://wpf-tutorial.com/Localization/LanguageStatus/de/

//AO4606
//https://easyeda.com/modules/H-bridge-4-x-AO4606_daf82c2069494cd1b3131c7f88ff7f90


//https://onlinegdb.com/ZX3skx6tj
/*

#include <stdio.h>
typedef struct{
	char row;
	char cul;
} Cell;


typedef struct {                                                //           0101 QR+1*eltolás első pozició a qr helye is és + eltolás
  char isE;     //Üres e a tárhely  0-1                  //           0201 QR+1*eltolás masodik pozició a qr helye is és + eltolás
  char num;     //number ami a beadagolt számából jön...
  Cell stack[10];      //0-28 dobozok száma---- 0- első poz     //     
} Store;                                                        //
                                                                //           2801 QR+1* eltolás a 28. pozició QR
Store G;
Store IB;
Store sB[8];
Store OB;
Store K;



int main()
{
    
   G.isE=1;
   G.num=4;
   G.stack[0].row=1;
   G.stack[0].cul=1;
   G.stack[1].row=2;
   G.stack[1].cul=1;
   G.stack[2].row=3;
   G.stack[2].cul=1;
   G.stack[3].row=4;
   G.stack[3].cul=1;
    while(1)
    {
    if( G.isE==1)
    {
    for(int i=0;i<G.num;i++)
    {
        printf("boxnum:%d  increment:%d \n",G.stack[i].row,G.stack[i].cul);
    }
     G.isE=0;
        
    }else
        break;

  
    return 0;
}




*/

/*
#include <stdio.h>
#include <string.h>
char ch[64]="LEDD,x";
char ch1[64]="TEXT*G0X20Y1.01F400";
char ch2[64]="MDIO*10,2,4";
char commandTEXT[64]="TEXT";
char commandTEXT1[64]="MDIO";

char commandstr[64]={0};


char c='\0',c1='\0',c2='\0';
int main()
{
    
    if(strncmp(commandTEXT,ch1,4)==0)
    {
        sscanf(ch1,"TEXT*%s",&commandstr);
        printf("TEXT  %s\n",commandstr);
    }
    if(strncmp(commandTEXT1,ch2,4)==0)
    {
        sscanf(ch2,"MDIO*%d,%d,%d",&c,&c1,&c2);
        printf("MDIO X: %d Y: %d Z: %d\n",c,c1,c2);
    }
    return 0;
}
*/
/*
stm32-delay as arduino
https://controllerstech.com/interface-stepper-motor-with-stm32/
void delay (uint16_t us)
{
  __HAL_TIM_SET_COUNTER(&htim1, 0);
  while (__HAL_TIM_GET_COUNTER(&htim1) < us);
}
*/
/*
import serial
from random import *

ser = serial.Serial('COM4', 115200, timeout=0.5)
ser.write('*99C\r\n')
for i in range(98):
    s.write(random(40,48))
ser.write('\r\n')
time.sleep(0.1)
ser.close()


sortir algoritmus
import serial
from random import *

ser = serial.Serial('COM4', 115200, timeout=0.5)
ser.write('*99C\r\n')
for i in range(98):
    s.write(random(40,48))
ser.write('\r\n')
time.sleep(0.1)
ser.close()



*/



void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, ESP32!");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10); // this speeds up the simulation
}









//https://onlinegdb.com/K8UdxvoNX

/*

#include <stdio.h>
typedef struct{
	char row;
	char cul;
} Cell;


typedef struct {                                                //           0101 QR+1*eltolás első pozició a qr helye is és + eltolás
  char isE;     //Üres e a tárhely  0-1                  //           0201 QR+1*eltolás masodik pozició a qr helye is és + eltolás
  char num;     //number ami a beadagolt számából jön...
  Cell stack[10];      //0-28 dobozok száma---- 0- első poz     //     
} Store;                                                        //
                                                                //           2801 QR+1* eltolás a 28. pozició QR
Store G;
Store IB;
Store sB[8];
Store OB;
Store K;
int strnum=0;


int main()
{
    
   G.isE=1;
   G.num=4;
   G.stack[0].row=1;
   G.stack[0].cul=1;
   G.stack[1].row=2;
   G.stack[1].cul=1;
   G.stack[2].row=3;
   G.stack[2].cul=1;
   G.stack[3].row=4;
   G.stack[3].cul=1;
   sB[0].isE=1;
   sB[1].isE=1;
    while(1)
    {
        if(G.isE==1)
        {
            for(int i=0;i<G.num;i++)
            {
                printf("Grow:%d  Gcul:%d \n",G.stack[i].row,G.stack[i].cul);
            }
            G.isE=0;
            if(IB.isE==0)
            {
                IB.isE=1;
                IB.num=G.num;
            }
        }
        if(IB.isE==1)
        {
            for(int i=0;i<IB.num;i++)
            {
                IB.stack[i].row=G.stack[i].row;
                IB.stack[i].cul=G.stack[i].cul;
                printf("IB.row:%d  IB.cul:%d \n",IB.stack[i].row,IB.stack[i].cul);
            }
            if(sB[strnum].isE==1)
                {     
                    strnum++;
                     IB.isE=0;
                   
               
                }else
                {
                    printf("ide jó %d\n",strnum);
                    sB[strnum].isE=1;
                    sB[strnum].num=IB.num;
               
                }
             
        }
        if(sB[strnum].isE==1&&strnum>=0&&strnum<=7)
        {   
            for(int i=0;i<sB[strnum].num;i++)
            {
                sB[strnum].stack[i].row=IB.stack[i].row;
                sB[strnum].stack[i].cul=IB.stack[i].cul;
                printf("i.:%d sB.row:%d  sB.cul:%d \n",strnum,sB[strnum].stack[i].row,sB[strnum].stack[i].cul);
            }
            sB[strnum].isE=0;
        }
        else
            strnum--;
        printf("strnum:%d\n",strnum);
       if(strnum<0)
        {
            break;
        }
    }
    return 0;
}


*/