This file contains hidden or 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 <Arduino.h> | |
#define BUZZER_PIN D1 | |
#define LM35_PIN A0 | |
#define ESP8266_VREF_MV (float)3300.0 // 3.3V | |
#define ESP8266_ADC_MAX (float)1023.0 // 10 bits | |
#define OFFSET_TEMPERATURE (float)2.1099 // add offset if needed for calibration |
This file contains hidden or 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 <Arduino.h> | |
#include <ESP8266WiFi.h> | |
int wifi_sta_init (char *ssid, char *password); | |
int wifi_ap_init (char *ssid, char *password); | |
void setup() { | |
Serial.begin(115200); | |
while(!Serial); // Wait for Serial to be ready |
This file contains hidden or 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 <Arduino.h> | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Hello World"); | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
void loop() { |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# binary classifications | |
# import libraries | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from sklearn.preprocessing import StandardScaler | |
import tensorflow as tf |
This file contains hidden or 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 <avr/io.h> | |
#ifndef F_CPU | |
#define F_CPU 16000000UL | |
#endif | |
void timer1_init (void); | |
void timer1_set_duty (uint16_t duty); | |
void timer1_percent (uint8_t percent); |
This file contains hidden or 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
class TodoList: | |
def __init__(self, todo_list="", done_list=""): | |
self.todo_list = [] | |
self.done_list = [] | |
def add(self, data_str): | |
# data akan dimasukkan ke variabel | |
self.todo_list.append(data_str) | |
def view(self, index, which_data): |
This file contains hidden or 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
#define MOTOR_A1 2 | |
#define MOTOR_A2 3 | |
#define MOTOR_ENA 9 | |
#define MOTOR_B1 7 | |
#define MOTOR_B2 8 | |
#define MOTOR_ENB 10 | |
#define BUTTON 4 | |
int motor_pin[6] = { |
This file contains hidden or 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
#define MOTOR_POL_A1 2 | |
#define MOTOR_POL_A2 3 | |
#define MOTOR_ENA 9 | |
#define MOTOR_POL_B1 7 | |
#define MOTOR_POL_B2 8 | |
#define MOTOR_ENB 10 | |
#define PINS 6 | |
#define MOTOR_CW 0 // motor turn clock wise |
This file contains hidden or 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 <TimerOne.h> | |
#include <stdlib.h> | |
#define MAX_TIMER_COUNT 2000 // maximum 2s | |
#define RUN_AT(x) ((timer_count % x) == 0 || (timer_count % x) == x) | |
#define PERCENT(x) int(float((x*100)/255)) | |
volatile void timer_isr(); | |
volatile int timer_count = 0; |
This file contains hidden or 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
// Digital Logic Gate | |
// AND -> & | |
// OR -> | | |
// XOR -> ^ | |
// NOT -> ~ / ! | |
void setup() { | |
Serial.begin(115200); | |
// Inputs |