Skip to content

Instantly share code, notes, and snippets.

View futureshocked's full-sized avatar

Peter Dalmaris futureshocked

View GitHub Profile
@futureshocked
futureshocked / flight_controller.ino
Created March 7, 2022 01:18
This script implements a flight controller joystick for my X-Flight simulator. Works with an Arduino Micro or A-Star 32U4 Mini
// Requires Arduino Joystick Library https://github.com/MHeironimus/ArduinoJoystickLibrary
#include <Joystick.h>
const int8_t sw_1 = 18;
const int8_t sw_2 = 4;
const int8_t sw_3 = 6;
//Joystick_ Joystick;
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
JOYSTICK_TYPE_JOYSTICK, 4, 0,
@futureshocked
futureshocked / Arduino_ticker.ino
Created September 7, 2021 08:10
Test Peter's four 8x8 LED matrix with Arduino PRo Mini PCB
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
int pinCS = 10; // Attach CS to this pin, DIN to MOSI and CLK to SCK (cf http://arduino.cc/en/Reference/SPI )
int numberOfHorizontalDisplays = 4;
int numberOfVerticalDisplays = 1;
byte button_1 = 5;
byte button_2 = 4;
@futureshocked
futureshocked / LJ - 07.30 - sine_wave_DAC0.lua
Created April 26, 2021 04:45
This script creates a rudimentary sine wave on DAC0.
--[[
LJ - 07.30 - sine_wave_DAC0.lua
This script creates a rudimentary sine wave on DAC0.
Components
----------
- LabJack T4
- Oscilloscope
@futureshocked
futureshocked / LJ - 09.50 - blink_LED_FIO5.lua
Created April 26, 2021 02:27
This script shows how to control an LED with FIO5 with a Lua script.
@futureshocked
futureshocked / LJ - 09.60 - blink_COMM_STATUS_LEDs.lua
Created April 26, 2021 02:27
This script shows how to control an LabJack T4 COMM STATUS LED using Lua.
@futureshocked
futureshocked / LJ - 09.70 - voltage_follower_verbose.lua
Created April 26, 2021 02:26
This script shows how to control an LED with FIO5 with a Lua script.
--[[
LJ - 09.70 - voltage_follower_verbose.lua
This script shows how to control an LED with FIO5 with a Lua script.
Components
----------
- LabJack T4
- Voltmeter/Multimeter
@futureshocked
futureshocked / LJ - 09.80 - counter_no_debouncing.lua
Created April 26, 2021 02:25
This program demonstrates how to use digital lines as simple counters.
--[[
LJ - 09.80 - counter_no_debouncing.lua
This program demonstrates how to use digital lines as simple counters.
This script is a simplified version of the one at
https://labjack.com/support/software/examples/lua-scripting/counter-examples/23-counters
This script demonstrates how to create a simple counter on FIO4.
Components
----------
@futureshocked
futureshocked / LJ - 09.90 - counter_with_debouncing.lua
Created April 26, 2021 02:24
This program demonstrates how to configure counters, with debounce, using DIO channels.
--[[
LJ - 09.90 - counter_with_debouncing.lua
This program demonstrates how to configure counters, with debounce, using DIO
channels. The debounce time for each counter will be between debounceInt and
2*debounceInt milliseconds. The debounce time is determined by the duration
of the interval and when in the interval the first input is received.
Original script:
https://labjack.com/support/software/examples/lua-scripting/counter-examples/23-counters-debounce
@futureshocked
futureshocked / LJ - 09.100 - convert_AIN_with_function.lua
Created April 26, 2021 02:23
This program demonstrates how to use a formula to scale the voltage measured on AIN0.
--[[
LJ - 09.100 - convert_AIN_with_function.lua
This program demonstrates how to use a formula to scale the voltage
measured on AIN0.
Components
----------
- LabJack T4
@futureshocked
futureshocked / LJ - 10.30 - AIN0_read.py
Created April 26, 2021 02:21
This script shows how to read voltage from AIN0.
'''
LJ - 10.30 - AIN0_read.py
This script shows how to read voltage from AIN0.
Components
----------
- LabJack T4
- Potentiometer