Skip to content

Instantly share code, notes, and snippets.

View techzeero's full-sized avatar
🎯
Focusing

Techzeero techzeero

🎯
Focusing
View GitHub Profile
@techzeero
techzeero / Flame Sensor Output using Digital Pin.ino
Last active April 21, 2024 07:55
In this tutorial, we learn how to interface a flame sensor with Arduino. How to detect fire/flames using a flame sensor. https://techzeero.com/arduino-tutorials/flame-sensor-with-arduino-for-fire-detection/
/*
Flame Sensor With Arduino For Fire Detection
For more details, visit: https://techzeero.com/arduino-tutorials/flame-sensor-with-arduino-for-fire-detection/
*/
int Buzzer = 13; // Use buzzer for alert
int FlamePin = 2; // This is for input pin
int Flame;
void setup() {
@techzeero
techzeero / Multi-Value Dropdown.py
Created March 3, 2022 14:13
Multi-Value Dropdown | Dash Plotly
from dash import Dash, dcc, html, Input, Output
app = Dash()
app.layout = html.Div([
dcc.Dropdown(
id='dropdown1' # Dropdown id
options=[{'label': 'India', 'value': 'India'},
{'label': 'Russia', 'value': 'Russia'},
{'label': 'USA', 'value': 'USA'}], # Data to be shown in dropdown options
from dash import Dash, dcc, html, Input, Output
app = Dash()
app.layout = html.Div([
dcc.Dropdown(
options=[{'label': 'India', 'value': 'India'},
{'label': 'Russia', 'value': 'Russia'},
{'label': 'USA', 'value': 'USA'}], # Data to be shown in dropdown options
value='India', # Dropdown Default Value
import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.express as px
from dash.dependencies import Input, Output
app = dash.Dash()
df = px.data.iris()
@app.callback(Output(component_id='graph', component_property= 'figure'),
[Input(component_id='dropdown', component_property= 'value')])
def graph_update(dropdown_value):
fig = px.scatter(df[df["species"]==dropdown_value], x="sepal_width", y="sepal_length")
fig.update_layout(title = 'Sapel Length and Width of Different Species',
xaxis_title = 'Sepal Width',
yaxis_title = 'Sepal Length')
return fig
app = dash.Dash()
df = px.data.iris()
app.layout = html.Div([
html.H1(
id = 'H1',
children = 'Styling using html components',
style = {'textAlign':'center', 'marginTop':40,'marginBottom':40}
),
import dash
from dash import html
from dash import dcc
import plotly.express as px
pip install dash
pip install dash-html-components
pip install dash-core-components
pip install plotly
/*
Display Custom Characters on 16×2 LCD
For more details, visit: https://techzeero.com/arduino-tutorials/custom-characters-on-16x2-lcd/
*/
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
byte smile[8] = {0b00000,0b01010,0b00000,0b00000,0b10001,0b01110,0b00000,0b00000};
@techzeero
techzeero / PIR Motion Sensor with Arduino Code3.ino
Last active August 18, 2020 08:18
In this tutorial, we will learn how to use a PIR Motion Sensor with Arduino. https://techzeero.com/arduino-tutorials/pir-motion-sensor-with-arduino/
/*
PIR motion sensor with Arduino
For more details, visit: https://techzeero.com/arduino-tutorials/pir-motion-sensor-with-arduino/
*/
int ledPin = 13; // Attach LED Pin
int sensorPin = 5; // Attach sensor out pin to Arduino D5
void setup() {
pinMode(ledPin, OUTPUT);