Running NodeMCU with Arduino - macos

I got my first NodeMCU today and I'm trying to run the blink sketch from Arduino http://www.arduino.cc/en/Tutorial/Blink
I've installed ch340G driver (as its mentioned in my nodemcu) and everything went without any errors.
However the problem is, it says the program is uploaded 100%, but the LED is not blinking. I would expect the LED to blink after the upload.
Following is a screen shot of my setup:
Also, I did bit of googling and I've seen port errors can be caused by poor cables, but I'm using my GoPro cable here.

There are 2 leds on the Nodemcu.
It might just be that the second led might be faulty.
Add this at the start of your blink code example
#ifdef LED_BUILTIN
#undef LED_BUILTIN
#endif
#define LED_BUILTIN 2
This will change the pin number for the builtin led, to the 2nd led on the Nodemcu.
Check if it works. If it does, then the 1st led is probably faulty.
I hope this helps.

It seems to be loading fine, try restarting the board(reset button).
Maybe the LED is on another pin,
nodeMCU pin numbers do not have to correspond to the ones used in arduino framework, take a look here for a possible pin mapping, example sketch and schema.
EDIT:
LED is on pin D4

Related

How to make Esp32-Cam blink when face is recognized

I've found several tutorials on how to set up a video-streaming server, how to get information, for example the temperature and humidity, via telegram or how to save a face so it gets recognized with Esp32-Cam. But I've found nowhere on the whole internet an example for my problem. I want the Esp32-Cam to light an LED when it recognizes a face. That should be possible, shouldn't it? There are a lot of pins which can be used as output. Does someone have a idea how to do that? When I have the light I want it to rotate a stepper motor too. I'de very grateful for your help :)
kind regards
the andorian guard

What is the best way to toggle gpios to indicate the kernel boot progress?

I have an small embedded system board (much like a RasPi) running a Yocto Linux distro (from a third party vendor, not the open-embbeded original repo). On that electronic board there are a bunch of LEDs in a row, each with a specific GPIO assigned. I can toggle them easily using sysfs (ex: echo 1 >/sys/class/gpio/gpio123/value).
I would like to indicate the progress of the kernel boot sequence (not during u-boot, not during systemd, really during the various steps in loading the drivers, etc. which last roughly 2 or 3 seconds on my board) much like a splash screen, but instead using the physical LEDs as a progress bar "splashscreen-like" indicator.
Is there a pre-defined best-way or "recommended" method/place/script/anything to do so? It is most likely a very common thing, I just can't seem to find any other people doing so (I know, I know, I am most likely just not searching/googling for the right words).
Thanks!
Modify the device tree of your machine board. There is a compatible = "gpio-led" tag using for the nodes to toggle these pins for the LED. You need to see how to toggle the GPIOs in the RasPi. Maybe in the Pin Funciton Controller, you can find a list of GPIOs or in the internet you canf ind it easily.
Here the link:
kernel.org/doc/Documentation/devicetree/bindings/leds/leds-gpio.txt

how would i go about emulating mouse devices correctly?

I have a device simulation framework vbscript file I use to create emulated usb mouse devices but I have a problem: how can I pass x,y for a specific usb mouse device without ending the script before all mouse devices are done? I thought about it and could use a file with x,y values but that might slow down the speed at which responses are received or not be in real time in worried about.
An example would be me sending 3,3 for x,y for device 0 during first loop then second loop i send 4,4 for x,y for device1. Im stumped as to how this can be done.
Anyone have any ideas?
Code for reference is here:
http://kinectmultipoint.codeplex.com
I just need to organize the code properly but I will try the file idea while wating on response
I just have implementation of my mouse program with kinect now i figured out the answer to this. Please visit link above to download code and no its not a direct download link you need to select downloads from top navigation bar and go to correct download.
If you wish to help me improve the code i've started combined the kinect and vbscript file together and progress is good but need successful two person kinect test.
I used command line paramters in vbscript to pass parameters with the mouse data.
Might in future research making an emulated multi-mouse driver because i dont like using the vbscript.

Resetting GPU and driver after CUDA error

Sometimes, bugs in my CUDA programs cause the desktop graphics to break (in Windows). Typically, the screen remains somewhat readable, but when graphics change, such as when dragging a window, lots of semi-random colored pixels and small blocks appear.
I have tried to reset the GPU and driver by changing the desktop resolution, but that doesn't help. The only fix I have found is to reboot the computer.
Is there a program out there or some trick I can use to get the driver and GPU to reset without rebooting?
Because the same problem occurs sometimes on unix and google forwarded me to this thread, I hope this helps somebody else..
On ubuntu unloading and reloading the nvidia kernel module solved the problem for me:
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm
Edit:
If you are on Tesla hardware on Linux and can run nvidia-smi, then you can reset the GPU using
nvidia-smi -r
or
nvidia-smi --gpu-reset
Here is the man output for this switch:
Resets GPU state. Can be used to clear double bit ECC errors or
recover hung GPU. Requires -i switch to target specific device.
Available on Linux only.
Otherwise...
The way to truly reset the hardware is to reboot.
What you describe shouldn't happen. I recommend testing with different hardware and let us know if it still occurs.
To reset the graphics stack in Windows, press Win+Ctrl+Shift+B.
I have a GeForce GTX 260 over NVDIA GPU SDK 4.2 and I am experiencing the some problems.
Sometimes developing I have bugs in the programs. This causes the screen to show the random colored pixels described in this post.
As stated here, if I change resolution they do not disappear. Moreover, if I only change the COLOUR DEPTH from 32 to 16 bits, the random colored pixels disappear, but going back to 32 bits (without rebooting) make them appear again.
Last bug that caused this behaviour was using __constant__ memory but passing it as a pointer:
test<<<grid, threadsPerBlock>>>( cuda_malloc_data, cuda_constant_data );
If I do not pass cudb_constant_data, then there is no bug (and consequently, the random coloured pixels do not appear).
from "device manager", under Display adapters tab, find the driver
disable it
press win + ctrl +shift + B (monitor will blink)
enable the driver
there you go.
ps -ef
find something like root 4066644 1 99 08:56 ? 04:32:25 /opt/conda/bin/python /data/
kill 4066644

How to enable vsync in DirectX10

I'm working on a apps that's based on DirectX10 by using SlimDX. I would like to enable vsync similar to DirectX9, but the fps doesn't seems to lock to 60Hz(which happens if I'm using Direct9). I'm setting vsync by using this
SwapChain.Present(1, PresentFlags.None);
Did I do something wrong?
Btw, I'm running Win7 with ATI HD5570 video card. After some googling, I gather that ATI can force vsync on certain games. So I wonder if that's related.
Reference for code to C++ will do as well. I'll translate it myself.
Thanks
First argument of SwapChain.Present is syncInterval. 0 indicates that presentation should occur immediately, without synchronization. Any other value indicates that presentation should be synchonized with the specified next vertical blank.
So use it like this:
SwapChain.Present(0, PresentFlags.None);
You can try to force vsync using Catalyst Control Center

Resources