Skip to content

Instantly share code, notes, and snippets.

// Parametric Pulley with multiple belt profiles
// by droftarts January 2012
// Based on pulleys by:
// http://www.thingiverse.com/thing:11256 by me!
// https://github.com/prusajr/PrusaMendel by Josef Prusa
// http://www.thingiverse.com/thing:3104 by GilesBathgate
// http://www.thingiverse.com/thing:2079 by nophead
// dxf tooth data from http://oem.cadregister.com/asp/PPOW_Entry.asp?company=915217&elementID=07807803/METRIC/URETH/WV0025/F
#include <FastLED.h>
#include "font.h"
#define DATA_PIN1 6 // Data pin for matrix 1
#define DATA_PIN2 8 // Data pin for matrix 2
#define DATA_PIN3 10 // Data pin for matrix 3
#define MATRIX_WIDTH 8 // Width of the 8x8 matrix
#define MATRIX_HEIGHT 8 // Height of the 8x8 matrix
#define NUM_LEDS MATRIX_WIDTH * MATRIX_HEIGHT // Total number of LEDs in one matrix
#define BRIGHTNESS 5 // LED brightness (0-255)
#include <HX711.h>
#include <Wire.h>
#include <LCD-I2C.h>
// HX711 connections
#define LOADCELL_DOUT_PIN 6
#define LOADCELL_SCK_PIN 5
// Initialize HX711
HX711 scale;
/* Send a char through ITM */
int _write(int file, char *ptr, int len) {
int DataIdx;
for (DataIdx = 0; DataIdx < len; DataIdx++) {
ITM_SendChar(*ptr++);
}
return len;
}
/* USER CODE END 4 */
void I2C_Scan(void) {
printf("Scanning I2C bus:\r\n");
HAL_StatusTypeDef result;
uint8_t i;
for (i = 1; i < 128; i++) {
/*
* the HAL wants a left aligned i2c address
* &hi2c1 is the handle
* (uint16_t)(i<<1) is the i2c address left aligned
* retries 2
@roboter
roboter / main.c
Created July 2, 2023 07:28
Nokia BluePill PCD8544
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* @attention
*
* Copyright (c) 2023 STMicroelectronics.
* All rights reserved.
#include "gd32e232.h"
#include "systick.h"
// Speed 72MHz
// WB2812
// 0.35 µs == 350 ns
// 1 code HIGH 400 ns 800 ns +- 150ns
// 0 code HIGH 850 ns 450 ns +- 150ns
// RWA above 50µs
#define HAS_WIFI
using Iot.Device.Ssd13xx;
using nanoFramework.Hardware.Esp32;
using nanoFramework.Networking;
using System;
using System.Device.I2c;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
@roboter
roboter / CP2112.cs
Created April 27, 2022 21:23 — forked from nickfox-taterli/CP2112.cs
CP2112 Example
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ClassFinder.Lib
open System
module ClassFinder =
Console.ReadLine() |> System.Int32.Parse |> fun x-> [1..x] |> List.iter (fun _ -> printfn "Hello World")
let isUpper c =
c |> Char.IsUpper
let toUpper c =