git clone -b [TAG] --recursive https://github.com/espressif/esp-idf.git esp-idf-[TAG]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
#define R 9 | |
#define G 10 | |
#define B 11 | |
SoftwareSerial mySerial(2, 3); | |
int pState = HIGH; | |
byte id = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
typedef union | |
{ | |
uint8_t command; | |
struct | |
{ | |
uint8_t a:1; | |
uint8_t b:1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 마나토끼 | |
// @namespace https://neosarchizo.github.io/ | |
// @version 1.0.413 | |
// @description try to take over the world! | |
// @author neosarchizo | |
// @match https://manatoki340.net/ | |
// @match https://manatoki340.net/page/update | |
// @match https://manatoki340.net/bbs/page.php?hid=update&page=* | |
// @match https://manatoki340.net/comic/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "packet.h" | |
void PACKET_generate(uint8_t cmd, uint8_t length, uint8_t *data) { | |
// STX | |
*data = PACKET_STX; | |
// LEN | |
*(data + PACKET_POS_LEN) = length - 2; | |
// CMD | |
*(data + 2) = cmd; | |
// CS : STX ^ LEN ^ CMD ^ D... |