Skip to content

Instantly share code, notes, and snippets.

@neosarchizo
neosarchizo / index.md
Created May 18, 2020
Set ESP32 Environment
View index.md

Install esp-idf

git clone -b [TAG] --recursive https://github.com/espressif/esp-idf.git esp-idf-[TAG]

@neosarchizo
neosarchizo / cm1106_calibration.ino
Last active Mar 16, 2020
[Arduino] CM1106 & CM1107 Calibration
View cm1106_calibration.ino
#include <cm1106_i2c.h>
CM1106_I2C cm1106_i2c;
void setup() {
cm1106_i2c.begin();
Serial.begin(9600);
delay(1000);
cm1106_i2c.read_serial_number();
delay(1000);
View gpio_uart.c
#include "sdk_common.h"
#include "gpio_uart.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "nrf.h"
static uint8_t gpio_tx_pin;
void gpio_uart_init(uint8_t tx_pin){
gpio_tx_pin = tx_pin;
View pm2008_calibration.ino
#include <Wire.h>
#define PM2008_I2C_ADDRESS 0x28
// Control modes
#define PM2008_I2C_CTRL_CLOSE_MEASUREMENT 0x1
#define PM2008_I2C_CTRL_OPEN_SINGLE_MEASUREMENT 0x2
#define PM2008_I2C_CTRL_SET_UP_CONTINUOUSLY_MEASUREMENT 0x3
#define PM2008_I2C_CTRL_SET_UP_TIMING_MEASUREMENT 0x4
#define PM2008_I2C_CTRL_SET_UP_DYNAMIC_MEASUREMENT 0x5
@neosarchizo
neosarchizo / .zshrc
Created Jan 18, 2020
avrdude shell script Mac OSX
View .zshrc
upload_arduino_hex() {
avrdude -p $1 -c avrisp2 -P usb -e -U flash:w:$2 -v
}
# upload_arduino_hex m328p avrisp_mk2_test.ino.with_bootloader.standard.hex
@neosarchizo
neosarchizo / rs485_test.ino
Created Oct 30, 2019
[디바이스마트] RS485 테스트
View rs485_test.ino
#include <SoftwareSerial.h>
#define R 9
#define G 10
#define B 11
SoftwareSerial mySerial(2, 3);
int pState = HIGH;
byte id = 0;
@neosarchizo
neosarchizo / serial_plotter_multiple.ino
Created Oct 4, 2019
[디바이스마트] 아두이노 시리얼 플로터
View serial_plotter_multiple.ino
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print(1); Serial.print("\t"); // space, tab, comma
Serial.print(2); Serial.print("\t");
Serial.print(3);
Serial.println();
}
@neosarchizo
neosarchizo / 3v_uart_test.ino
Last active Oct 3, 2019
[디바이스마트] USB to UART TTL 테스트 코드
View 3v_uart_test.ino
void setup() {
Serial1.begin(9600);
}
void loop() {
Serial1.println("Hello world");
if(Serial1.available()){
Serial1.print("Reply) ");
@neosarchizo
neosarchizo / simple_monitor.ino
Created Sep 2, 2019
[새로운 시작][아두이노] PM2008 간단 모니터
View simple_monitor.ino
#include <pm2008_i2c.h>
PM2008_I2C pm2008_i2c;
#define RED 4
#define YELLOW 5
#define GREEN 6
#define BLUE 7
void setup() {
@neosarchizo
neosarchizo / get-docker.sh
Created Mar 20, 2019
get-docker.sh for Raspberry Pi Zero W
View get-docker.sh
#!/bin/sh
set -e
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.docker.com -o get-docker.sh
# $ sh get-docker.sh
#
# For test builds (ie. release candidates):
# $ curl -fsSL https://test.docker.com -o test-docker.sh
# $ sh test-docker.sh
You can’t perform that action at this time.