Skip to content

Instantly share code, notes, and snippets.

prasertsakd

Block or report user

Report or block prasertsakd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View serial_json.flow
[
{
"id": "49613054.b1d67",
"type": "xml",
"z": "31f47a75.15b9d6",
"name": "",
"property": "payload",
"attr": "",
"chr": "",
"x": 390,
View randomLedArray.ino
int timer = 100;
const PROGMEM unsigned int ledPins[] =
{ 0,1,2,3,4,0,1,2,3,4,
4,3,2,1,0,4,3,2,1,0,
0,1,2,3,4,4,3,2,1,0,
4,3,2,1,0,0,1,2,3,4,};
const PROGMEM unsigned int stepCount = 10;
@prasertsakd
prasertsakd / ASCIITable.ino
Created Dec 14, 2017
ASCII table for samd21
View ASCIITable.ino
/*
ASCII table
Prints out byte values in all possible formats:
* as raw binary values
* as ASCII-encoded decimal, hex, octal, and binary values
For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII
The circuit: No external hardware needed.
created 2006
by Nicholas Zambetti
modified 9 Apr 2012
View Board.txt
##############################################################
# NodeWifi chip has built-in 1MB flash
nodewifi.name=NodeWifi
nodewifi.upload.tool=esptool
nodewifi.upload.speed=115200
nodewifi.upload.resetmethod=nodemcu
nodewifi.upload.maximum_size=434160
nodewifi.upload.maximum_data_size=81920
@prasertsakd
prasertsakd / check_mega16u2.bat
Last active Mar 3, 2017
read chip id and verify
View check_mega16u2.bat
@echo off
set arduino_path=c:\arduino-1.6.12
set avrdude.exe=%arduino_path%\hardware\tools\avr\bin\avrdude.exe
set avrdude.conf=%arduino_path%\hardware\tools\avr\etc\avrdude.conf
%avrdude_path% -c usbtiny -v -p m16u2 -C %avrdude_conf%
@prasertsakd
prasertsakd / flash_mega16u2.bat
Last active Mar 3, 2017
for reflash mega16u2 to usbserial use avrdude
View flash_mega16u2.bat
@echo off
set arduino_path=c:\arduino-1.6.12
set firmware=Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex
set avrdude.exe=%arduino_path%\hardware\tools\avr\bin\avrdude.exe
set avrdude.conf=%arduino_path%\hardware\tools\avr\etc\avrdude.conf
%avrdude_path% -c usbtiny -p m16u2 -C %avrdude_conf% -F -D -U flash:w:%firmware% -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
View esp_idf_hello_world.c
#include <stdio.h>
void app_main() {
printf("Hello world\n");
}
View PN532_HID.ino
#include <PN532.h>
#include "Keyboard.h"
//#define SCK 13
//#define MOSI 11
//#define SS 10
//#define MISO 12
#define SCK 15
#define MOSI 16
View esp_touch.ino
const int ledPin = 2; // the number of the LED pin
const int threshold = 40; // the number of the LED pin
int ledState = LOW; // ledState used to set the LED
void setup() {
// put your setup code here, to run once:
//pinMode(ledPin, OUTPUT);
Serial.begin(115200);
touchAttachInterrupt(T0 , click , threshold );
View arduino_esp32_multi_thread_demo.ino
#define BUILDIN_LED 2
#define ledPIN1 23
#define ledPIN2 22
// ----------------------------------------------------------------------------------
void first_task(void *pvParameter){
/* Configure the IOMUX register for pad BLINK_GPIO (some pads are
muxed to GPIO on reset already, but some default to other
functions and need to be switched to GPIO. Consult the
Technical Reference for a list of pads and their default
You can’t perform that action at this time.