Skip to content

Instantly share code, notes, and snippets.

View hlog2e's full-sized avatar
🧐

HongRok Kim hlog2e

🧐
View GitHub Profile
int SENSOR = 0; // the analog pin connected to the sensor
void setup() {
Serial.begin(9600); //시리얼 모니터 사용을 위한 초기화
}
void loop() {
int value = analogRead(SENSOR); // 센서에서 아날로그 read 로 값을 가져와서 int value 에 저장
Serial.println(value);
@hlog2e
hlog2e / hmc5883_ble
Last active November 20, 2023 03:02
hmc5883 + ble 모듈
#include <Wire.h>
#include <MechaQMC5883.h>
#include <SoftwareSerial.h>
int BT_RX = 2;
int BT_TX = 3;
SoftwareSerial HM10(BT_RX, BT_TX);
MechaQMC5883 qmc;
void setup() {
🌞 Morning 91 commits ██▉░░░░░░░░░░░░░░░░░░ 13.8%
🌆 Daytime 167 commits █████▎░░░░░░░░░░░░░░░ 25.3%
🌃 Evening 206 commits ██████▌░░░░░░░░░░░░░░ 31.3%
🌙 Night 195 commits ██████▏░░░░░░░░░░░░░░ 29.6%
@hlog2e
hlog2e / processing-paint.java
Created August 8, 2022 00:14
음태훈 프로세싱 그림판
boolean onErasing = false;
String buttonColor = "white";
int[][] redCircle = new int [41][41];
int[][] greenCircle = new int [41][41];
int[][] blueCircle = new int [41][41];
void setup() {
size(640, 360);
background(0);
//redCircle X
float Vout = 0.0; // 아두이노에 들어오는 전압
float Vin = 0.0; // 실제 전압
float R1 = 30000.0; // 1번 저항의 값 선언
float R2 = 7500.0; // 2번 저항의 값 선언
int sensorValue = 0; // 전압 측정 센서 변수 선언
void setup() {
Serial.begin(9600); // 컴퓨터랑 통신하기 위한 시리얼 모니터 사용 설정
pinMode(A0, INPUT);
}