Requirements Raspberry Pi with Raspbian OS installed in it Arduino Uno or any other Arduino board Arduino USB cable LED Installing PyFirmata in Arduino using Raspberry Pi To upload PyFirmata firmware in Arduino, we have to install Arduino IDE in Raspberry Pi. Follow these steps to install: Step 1:- Connect the Raspberry Pi to… Continue reading Control Arduino from Raspberry Pi with pyFirmata
Category: Coding
Arduino and cpp files
You can create an Arduino project in which you have a main .ino file with setup() and loop(), but all the stuff in .h and .cpp files.
Best Javascript charting libraries
Check this link
Simple debounce.js function minified
export default function debounce(a,b,c){var d,e;return function(){function h(){d=null,c||(e=a.apply(f,g))}var f=this,g=arguments;return clearTimeout(d),d=setTimeout(h,b),c&&!d&&(e=a.apply(f,g)),e}}
Asar
Asar electron “tarball” # Open terminal and install asar node module globally $ npm install -g asar # Go into the app’s directory, in our case it’s Slack $ cd /Applications/Slack.app/Contents/Resources # Create a directory to paste the content of app $ mkdir example-sourcecode # Unpack the app.asar file in the above directory using asar… Continue reading Asar
Redux, Selectors
Always use a selector to get state from components. export const getAudio = (state) => { return { audio_folder: state.audio_folder, playing: state.playing } }
Git prevent from asking username and password everytime
Don’t use HTTP use SSH instead change https://github.com/WEMP/project-slideshow.git to [email protected]:WEMP/project-slideshow.git you can do it in .git/config file
Node: set ENV and execute command (Windows)
Pay attention: NO SPACE before && set NODE_ENV=local&& webpack-dev-server NOT set NODE_ENV=local && webpack-dev-server
Docker useful commands
View logs of a container docker logs -f CONTAINER List all containers (only IDs) docker ps -aq Stop all running containers docker stop $(docker ps -aq) If you want also to delete containers & images do the following steps, otherwise stop here. Remove all containers docker rm $(docker ps -aq) Remove all images docker rmi… Continue reading Docker useful commands
ESP8266 WiFi module
Link for add board manager http://arduino.esp8266.com/stable/package_esp8266com_index.json Erase the esp esptool.py erase_flash Code to flash AT firmware to ESP8266 (ESP8266_AT_Bin_V1.5.1) esptool.py –baud 115200 –port /dev/tty.wchusbserial1420 write_flash -fm dio -ff 40m -fs detect 0x00000 boot_v1.7.bin 0x01000 user1.1024.new.2.bin 0xfc000 esp_init_data_default.bin 0x7e000 blank.bin 0xfe000 blank.bin