Skip to content

Instantly share code, notes, and snippets.

View ahmaddidiks's full-sized avatar
🎯
Focusing

Ahmad Didik Setiyadi ahmaddidiks

🎯
Focusing
View GitHub Profile
@ahmaddidiks
ahmaddidiks / gpio-test.go
Last active March 21, 2024 08:02
Raspberry pi GPIO test golang
package main
import (
"log"
"os"
"time"
"github.com/stianeikeland/go-rpio/v4"
)
@ahmaddidiks
ahmaddidiks / challenge_2_map.go
Last active September 22, 2023 15:25
Mini challenge kelas Go kak Fitri
package main
import "fmt"
const KALIMAT = "selamat malam"
func main() {
result := make(map[string]int)
for _, rune := range KALIMAT {
@ahmaddidiks
ahmaddidiks / note.nd
Created September 18, 2023 02:25
NAV2 Stack
simpan map dari turtlebot
1. ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py
2. ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True
3. ros2 run turtlebot3_teleop teleop_keyboard
4. ros2 run nav2_map_server map_saver_cli -f ./house_map
,,
change the DDS
sudo apt install ros-humble-rmw-cyclonedds-cpp
@ahmaddidiks
ahmaddidiks / diffbot_system.cpp
Created September 13, 2023 15:58 — forked from renderedSafe/diffbot_system.cpp
ROS2 Control Demos diffbot hardware interface publisher. Useful for micro-ROS hardware control.
// Copyright 2021 ros2_control Development Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
from PyQt5.QtCore import QThread, pyqtSignal
from struct import unpack
from serial import Serial
class SerialWorker(QThread):
# update_data = pyqtSignal(list)
raw_data = pyqtSignal(bytes)
def __init__(self):
super(SerialWorker, self).__init__()
@ahmaddidiks
ahmaddidiks / index.html
Created August 20, 2023 05:05
Flask show table data
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Absensi Murid</h1>
<table id="demo">
@ahmaddidiks
ahmaddidiks / 0-PY-SQLITE-TABLE.MD
Created August 20, 2023 04:59 — forked from code-boxx/0-PY-SQLITE-TABLE.MD
Python Display SQLite Data In HTML Table

PYTHON DISPLAY SQLITE DATA IN HTML TABLE

https://code-boxx.com/sqlite-data-html-table-python-flask/

NOTES

  1. Run unpack.bat (Windows) unpack.sh (Linux/Mac). This will automatically:
    • Create a templates folder, move S3_users.html inside.
    • Create a static folder, move S3_users.css inside.
    • Create a virtual environment - virtualenv venv.
    • Activate the virtual environment - venv\scripts\activate (Windows) venv/bin/activate (Mac/Linux)
  • Install Flask - pip install flask
@ahmaddidiks
ahmaddidiks / flask_example.py
Last active July 29, 2023 08:15
Flask and mongo DB
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/',methods=[ 'GET'])
def hello_world():
return 'GET METHOD'
@app.route('/data',methods=['POST'])
def data():
@ahmaddidiks
ahmaddidiks / 1.py
Created May 13, 2023 14:53
Bib Nabiel
def isGanjil(num):
if num %2 == 1:
return True
else:
return False
def showMinimumNumber(listNumber):
# membuat list angka yang isinya hanya angka ganjil
newNumberList = []
for number in listNumber:
@ahmaddidiks
ahmaddidiks / mqtt_ssl_idf.ino
Created January 16, 2023 07:36 — forked from gmag11/mqtt_ssl_idf.ino
Secure MQTT connection to broker with ESP32 and internal IDF mqtt client library
#include "Arduino.h"
#include <WiFi.h>
#include "esp_log.h"
#include "esp_system.h"
#include "esp_event.h"
#include "mqtt_client.h"
#define SECURE_MQTT // Comment this line if you are not using MQTT over SSL
#ifdef SECURE_MQTT