Skip to content

Instantly share code, notes, and snippets.

View owennewo's full-sized avatar

Owen Williams owennewo

View GitHub Profile
/*
# Board selection
platform = atmelavr
board = pro16MHzatmega328
framework = arduino
monitor_speed = 38400
lib_deps =
; Simple FOC#minimal
jrowberg/I2Cdevlib-MPU6050
// THIS DOESN'T WORK.
// Discussed here https://www.stm32duino.com/viewtopic.php?f=7&t=832
#include <Arduino.h>
#include "fdcan.h"
FDCAN_HandleTypeDef hfdcan1;
FDCAN_TxHeaderTypeDef tx_header;
void sendCanMessage() {
@owennewo
owennewo / main_6_step.cpp
Created October 31, 2020 13:23
6 steps commutation of stm32g413 kit for drones (arduino platform)
// Discussed here: https://community.simplefoc.com/t/motor-driver-st-ihm08m1-6pwm/131/9?u=owen_williams
// youtube vid here: https://youtu.be/U1_6f7bK6rI
#include <Arduino.h>
#define STATUS_LED PC6
#define POT PB12
#define TX PB3
#define RX PB4
@owennewo
owennewo / main.cpp
Created September 4, 2020 15:13
SimpleFOC Music Player
#include <Arduino.h>
#include <SimpleFOC.h>
/*
This works best on an esp32 but have tested on atmega328p too
Be careful to set voltage appropriately. Might want to turn down power_supply to 6v too.
*/
#ifdef ESP32
BLDCMotor motor = BLDCMotor(5, 18, 19, 7, 4);