Skip to content

Instantly share code, notes, and snippets.

View katsuyoshi's full-sized avatar

Katsuyoshi Ito katsuyoshi

  • ITO SOFT DESIGN Inc.
  • Akita, Japan
View GitHub Profile
@katsuyoshi
katsuyoshi / How to run
Created December 17, 2023 09:19
Learning racc
% racc parser.y -o parser.rb
% ruby parser.rb
1+2-3*4/5
require 'plc_access'
plc = PlcAccess::Protocol::Mitsubishi::McProtocol.new host:"192.168.0.10"
plc["M0"] = true
plc["M0"] # => true
plc["M0", 10] # => [true, false, ..., false]
plc["D0"] = 123
plc["D0"] # => 123
@katsuyoshi
katsuyoshi / main.cpp
Created October 3, 2023 09:21
M5Stack StampS3 Project on PlatformIO
#include <Arduino.h>
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print(".");
delay(1000);
}
@katsuyoshi
katsuyoshi / README.md
Last active October 8, 2023 16:11
DXOpalのテスト
@katsuyoshi
katsuyoshi / main.cpp
Last active April 13, 2023 23:30
LoRaモジュール評価ボード E220-900T22S(JP)-EV1の伝送レート変更。M5Atom Lite使用
#include <Arduino.h>
#include <M5Unified.h>
#define LORA_M0_PIN 21
#define LORA_M1_PIN 25
#define LORA_RX_PIN 23
#define LORA_TX_PIN 19
#define BAUDRATE_1200 0x00
@katsuyoshi
katsuyoshi / main.cpp
Last active April 13, 2023 14:20
LoRaモジュール評価ボード E220-900T22S(JP)-EV1を使ったLoRa通信受信側 M5AtomLite使用
#include <Arduino.h>
#include <M5Unified.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <FastLED.h>
#define LED_PIN 27
#define NUM_LEDS 1
#define LORA_M0_PIN 21
@katsuyoshi
katsuyoshi / main.cpp
Last active March 27, 2023 00:05
LoRaモジュール評価ボード E220-900T22S(JP)-EV1を使ったLoRa通信送信側 M5AtomS3使用
#include <Arduino.h>
#include <M5Unified.h>
#include <string.h>
#define LORA_RX_PIN 7
#define LORA_TX_PIN 6
#define GPS_RX_PIN 38
#define GPS_TX_PIN 39
#define REC_BUF_SIZE 128
import UIKit
import PlaygroundSupport
import Combine
class MyViewController : UIViewController {
var label: UILabel!
var sub: AnyCancellable!
override func loadView() {
@katsuyoshi
katsuyoshi / ContentView.swift
Last active March 17, 2023 07:29
iOSのBackgrounTaskでデッドロック
import SwiftUI
struct ContentView: View {
@Environment(\.scenePhase) var scenePhase
@State var controller = Controller()
@ObservedObject var publisher = Publisher()
var body: some View {
VStack {
Image(systemName: "globe")
@katsuyoshi
katsuyoshi / main.cpp
Last active March 11, 2023 23:04
M5AtomS3とToioで倒立振子に挑戦
#include <Arduino.h>
#include <M5Unified.h>
#include <MadgwickAHRS.h>
#define Serial USBSerial
Madgwick madgwick = Madgwick();
float roll = 0;
float pitch = 0;