Skip to content

Instantly share code, notes, and snippets.

@Mango-kid
Mango-kid / sh
Created March 27, 2025 19:15
framework 13 run gemma3 27B on GPU
#install rocm as found here -> https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html
sudo apt update
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
sudo apt install python3-setuptools python3-wheel
sudo usermod -a -G render,video $LOGNAME # Add the current user to the render and video groups
wget https://repo.radeon.com/amdgpu-install/6.3.3/ubuntu/noble/amdgpu-install_6.3.60303-1_all.deb
sudo apt install ./amdgpu-install_6.3.60303-1_all.deb
sudo apt update
sudo apt install amdgpu-dkms rocm
@Mango-kid
Mango-kid / manual_limi.py
Created March 22, 2018 15:24
Using the limt switch manually.
'''
the example uses the move command and the manual limit switch check command. It moves the motor and then checks the limit switch.
this can be used to do fine manual homing
'''
import Slush
#setup the motor
b = Slush.sBoard()
m = Slush.Motor(1)
#!/usr/bin/python3
#configure the slush library
import Slush
import time
b = Slush.sBoard()
#setup a motor, more than one motor can be setup here
m0 = Slush.Motor(0)
#!/usr/bin/python3
#setup the slushengine
import Slush
b = Slush.sBoard()
#setup a few different motors, this can also be done in an array
m0 = Slush.Motor(0)
m1 = Slush.Motor(1)
m2 = Slush.Motor(2)
#!/usr/bin/python3
import Slush
import time
b = Slush.sBoard()
#define the motor that is being used
m1 = Slush.Motor(0)
#print the position of the motor before we spin it
#include "mbed.h"
#include "rtos.h"
/* the pins that will be used on the Nucleo board */
AnalogIn analog_value(A0);
PwmOut mypwm(D10);
DigitalOut directionPin(D2);
DigitalOut enablePin(D3);
DigitalOut led1(LED1);
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
/* Read Quadrature Encoder
* Connect Encoder to Pins encoder0PinA, encoder0PinB, and +5V.
*
* Sketch by max wolf / www.meso.net
* v. 0.1 - very basic functions - mw 20061220
*
*/
int val;
const int analogInPin = A0;
int sensorValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {