According to https://xkcd.com/221/ the random number should be 4 :-)
In reality a randomizer will just be an algorithm to create numbers and often they get initialized by a timer. So if you always start the same code after reset and read the number it seems to met always the same initialisation. I miss a function to "randomize" the initialisation. Try to do it by any loop/function before that delays in a random way e.g. connection to wifi or read from a noisy AD channel until a specific value is read.
Posts made by holofloh
-
RE: Random Integer Problem
-
RE: UnitV Can it recognize the type of plant?
Theoretically yes. It depends on how good your training data set is and the light situation where the classification is done. Keep in mind the camera has a limited resolution.
-
RE: Minimum temperature range for Cameras - UnitV K210 AI Camera and OV2640
I don't know the exact specs and I have not tested. In my oppinion the battery will be the weak point. The small LiPo bag-batteries often go very weak below 0°C. You may remove it and power from external.
The datasheet of the image sensor OV2640 says operating is allowed between -30°C and +70°C, stable image between 0°C and 50°C. for the other components you can find similar information in their data sheets.
Make sure there is not too much humidity in air as it can condense on the electronic parts.
It may help to pack the camera into thermal insulation so that it heats itself a bit over the environment. In extreme environment a small extra heating could help. -
RE: M5 Timer cam issue
the board in your link seems to have PSRAM but in the code the selected model has "No PSRAM".
-
RE: M5Paper suggestion for multiple serial capture
Did you ever think about multiplexing? One Header as Serial I/O and one as 2-Bit control for an external 1:4/4:1 MUX. The SN74LV4052A for example provide two1:4 paths. You can use one for the RX, one for the TX signals.
Your program need to select the channel by two bits and then do the normal UART stuff as usual. -
RE: RGB Leds Crossfade
This is not an Uiflow specific solution. Try as following:
- Decide how many steps you want from start color to end color. e.g. 10 steps
- find the step size from start to end color e.g. you want from value 100 to 200 (difference / steps) = step size 10.
- loop for the number of steps and increase/decrease the value with the calculated step size.
-
RE: Can't Run the Config util
some USB to UART chips such as the CP210x family are customizable by the device manufacturer to have its VID and / or PID.
See: https://community.silabs.com/s/article/cp210x-customization?language=en_US
In this case you need also a cusomizated driver or telling the existing driver the new VID/PID (which is possible for example in a linux environment). It is no problem to have several drivers in parallel as they only work for devices with the correct VID/PID. -
RE: Centre a label on M5Stack
I assume you have changing text in the label. For the Y-axis set the label manually to the half of screen height minus the half of label height. The X-axis can be calculated by using half of screen width and half of label width
label0.get_width()
. -
RE: Arduino get_apikey()
the IP Adress is not hard coded when using DHCP to obtain it. Do you mean the hardware MAC adress? It is (theoretical) unique on every piece of network hardware.
WiFi.macAddress()
-
RE: How can I download my old script from a device?
You can use the "Device File Manager" in UiFlow.
-
RE: Smart Applications of Holography and Robotic Arms myCobot 320 M5Stack-Basic
Just my comment about the missuse of the words "hologram" and "holography":
Displaying a stereoscopic or augmented reality image that seems to be floating in the room has nothing to do with holograms or holography. It is impressive YES, but it is NOT a hologram. Why do I know this? Look at my nickname! I have made my own REAL optical holograms for many years. They are made by interfering high-coherent wavefronts coming for a laser source and recording the resulting pattern in a 2D surface. There are different types of setup but all have in common the interference of a reference-beam with a object-beam. See https://en.wikipedia.org/wiki/HolographyHowever, mounting a real hologram on a robot arm and move it around is also possible. In case of a hologram that changes its displayed content by the angle of the light source it can be very impressive!
-
RE: m5go World Clock Problem
Hi,
your question reads like "my car will not start, what shall I do?". The standard answer to that question is "buy a new car" even if the solution would be as easy as "turn the key" or "fill some gasoline".
From your description we know you want to have a world clock and you have a m5go. What is missing:- The environment you use to code your clock
- Your code which seems to be the problem
- the exact error message or a picture of what you call "overloaded"
please read this post first: https://forum.m5stack.com/topic/535/forum-rules-read-this-first-before-posting
-
RE: Limit to 2 Decimals in labels in UIFLOW
in the section "Text" is a piece that calls "Reduce ... to ... decimal places"
-
RE: How much does does 3D Antenna help with RSSI?
There is a rule in the RF world: "the best amplifier is a good antenna". You can get a higher antenna gain if the directional pattern is narrow. A good example for a very narow pattern is a satellite-tv dish or line-of-sight communication devices that need to be exact aligned to get a good signal. The opposite is a omnidirectional antenna in a WiFi device where the signal strenght is more or less the same all around the device. there are many different antenna designs for different pattern and different applications on the market.
It may help to study the datasheet of the 3D antenna, which is a PRO-OB-440 in this case, to decide if the pattern works for your application and how much gain you earn. As far as I see the PRO-OB-440 is not bad for its size but as every antenna, it has to follow the laws of science and cannot do witchcraft. -
RE: Atomic Programm runterladen
Ja, das ist wirklich das richtige Vorgehen. Normalerweise ist auf einem Microcontroller nur der kompilierte Code gespeichert der sich ohne weiteres nicht mehr so einfach in den Quellcode zurück übersetzen lässt. Gerade bei kommerziellen Anwendungen ist der Quellcode oft ein Firmengeheimnis und es ist gar nicht erwünscht, dass dieser vom Anwender oder der Konkurrenz ausgelesen und dekompiliert werden kann. Daher wird der Code oft noch verschlüsselt und der Controller hat einen integrierten Schutz gegen das auslesen.
Im Falle von UIFlow läuft aber auf dem Controller ein Python Interpreter und der "Quellcode" ist ein Python Script. Das kannst du im Prinzip per serieller Konsole auslesen und sogar editieren aber es macht eigentlich keinen Sinn. Dein Vorgehen mit dem speichern vor dem Hochladen ist der korrekte Weg. Organisiere dir den Speiherplatz aber etwas sinnvoll so, dass du nicht bald den Überblick über die Versionen deiner Programme verlierst. Es macht ausserdem Sinn die Version von UIFlow mit der du ein Programm erstellt hast zu notieren. -
RE: ATOMIC PWM
Es gibt Lüfter die einen PWM Eingang haben. Die Betriebsspannung von z.B. 12V liegt dann immer an und man gibt mit dem PWM Eingang die Drehzahl vor. Die im Lüfter integrierte Elektronik regelt dann auf diesen Wert. Da intern geregelt wird, kann die Elektronik auch dafür sorgen, dass der Lüfter sauber anläuft indem der Regler am Anfang etwas mehr Strom auf den Motor gibt.
Du hast aber wohl einen Lüfter ohne PWM Eingang. Also verstellst du mit dem PWM die Versorgungsspannung von 0 bis 12V (Die PWM Frequenz spielt hier eine untergeordnete Rolle, die Pulse werden durch den Stützkondensator im Lüfter integriert). Die meisten Lüfter mit 12V die ich schon in den Fingern hatte laufen ab ca. 5-6V an und brauchen dabei schon mal einige Sekunden um auf Drehzahl zu kommen.
Falls du ein einstellbares abornetzteil hast, suche mal die Spannung ab der dein Lüfter sicher anläuft. Falls du kein einstellbares Netzteil hast, experimentiere mit dem PWM Duty.
Versuche also zuerst in groben, dann in feineren Schritten ab wann der Lüfter sicher angeht. Lass ihm immer einige Sekunden Zeit zum anlaufen. Start mal mit 50% Duty und wenn er nach 5 Sekunden nicht anläuft mit 60%. Wenn der Lüfter mal läuft kann vermutlich wieder etwas tiefer eingestellt werden.Mit dem Tachoausgang des Lüfters kannst du dann später eine Überwachung der Drehzahl machen und dafür Sorgen, dass das PWM Duty für den Anlauf höher ist als danach. Also das Duty automatisch erhöhen bis der Lüfter angeht und dann auf eine bestimmte Drehtzahl regeln. Im Prinzip macht die Elektronik in einem Lüfter mit PWM Eingang genau das.
-
RE: ATOMIC PWM
Nutzt du am Lüfter den PWM Eingang für das PWM Signal, also die Speisung direkt auf 12V? Oder speist du PWM am 12V Eingang?
So wie ich das sehe, machst du eine Rampe von 0% bis 100% und dann zurück in jeweils rund einer Sekunde. Das dürfte den Lüfter bestimmt etwas verwirren da die Anlaufzeit wohl schon länger dauert. Mach die Rampe mal deutlich langsamer (z.B. Wait 100ms) oder schreibe zum Test eine Sequenz mit fixen Werten z.B. 20%, 40%, 60%, 80%, 100% mit je ein paar Sekunden dazwischen. -
RE: Code works when I press play but not when I download on device
it is possible to have more than one script on the device. In the firmware menu it is possible to choose the default one. Maybe you have a wrong one set as default? It may help to clear the flash and burn the latest firmware. If the download still not work try some demo code to see if this runs as intended.
-
RE: M5Paper: how to detect USB power?
Thanks Felix,
I was thinking way to far to solve this problem. The end of my main loop looks now like this:
// If on battery power the system go to sleep and waiting for the wakeup call by RTC // If on USB power the system stay awake so undo what shutdown() did and waste some time before repeating the main loop M5.shutdown(sleepseconds); M5.enableMainPower(); M5.RTC.clearIRQ(); delay(sleepseconds*1000);
it seems to work.