Skip to content

Instantly share code, notes, and snippets.

View detik19's full-sized avatar

Tedy Tri Saputro detik19

View GitHub Profile
@detik19
detik19 / main.py
Created May 31, 2019 17:47
GPIO Pin MicroPython
from machine import Pin
from time import sleep
led = Pin(2, Pin.OUT)
button = Pin(4, Pin.IN)
while True:
led.value(button.value())
sleep(0.1)
@detik19
detik19 / main.py
Created May 31, 2019 17:47
GPIO Pin MicroPython
from machine import Pin
from time import sleep
led = Pin(2, Pin.OUT)
button = Pin(4, Pin.IN)
while True:
led.value(button.value())
sleep(0.1)
@detik19
detik19 / running text.ino
Created April 13, 2019 13:07
Running text led dot matrix
// Use the Parola library to scroll text on the display
//
// Demonstrates the use of the scrolling function to display text received
// from the serial interface
//
// User can enter text on the serial monitor and this will display as a
// scrolling message on the display.
// Speed for the display is controlled by a pot on SPEED_IN analog in.
// Scrolling direction is controlled by a switch on DIRECTION_SET digital in.
// Invert ON/OFF is set by a switch on INVERT_SET digital in.
@detik19
detik19 / hello.ino
Created April 13, 2019 12:54
test dot matrix module
// Program to demonstrate the MD_Parola library
//
// Uses the Arduino Print Class extension with various output types
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
@detik19
detik19 / user_main.c
Created April 12, 2019 17:03
RTOS SDK ESP8266
/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
@detik19
detik19 / main.cpp
Created March 7, 2019 16:16
HelloOpenCV3
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
@detik19
detik19 / main.c
Created February 12, 2019 22:52
RGB Blink
/*
* main.c
*
* Created on: 13 Feb 2019
* Author: tedy.saputro
*/
#include <stdio.h>
#include <stdint.h>
@detik19
detik19 / init.js
Created February 10, 2019 02:27
modified mongoose os
load('api_aws.js');
load('api_azure.js');
load('api_config.js');
load('api_dash.js');
load('api_events.js');
load('api_gcp.js');
load('api_gpio.js');
load('api_mqtt.js');
load('api_shadow.js');
load('api_timer.js');
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
void app_main()
{
printf("Hello world!\n");
/* Print chip information */
#include <TimerOne.h>
#include <Wire.h>
#include <MultiFuncShield.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Timer1.initialize();
MFS.initialize(&Timer1); // initialize multi-function shield library
}