This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const byte LED_GPIO = 2; | |
volatile int interruptCounter; // When this is not zero, we'll take a reading from the sensor | |
// The interrupt service routine will increment it. | |
// When the sensor is read, this variable is decremented. | |
volatile int blinkCounter = 0; | |
// The hardware timer pointer | |
hw_timer_t * timer = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 06. Ultrasonic distance sensor HC-SR04 demo sketch | |
* | |
* This sketch calculates the distance between the HC-SR04 sensor and | |
* an object directly infront of it. | |
* | |
* To see the trigger and echo waveforms with your oscilloscope, | |
* connect CHA to the trigger and CHB to the echo pins. | |
* | |
* Set up edge trigger to CHA, and set it to 1V (or there about). | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 07. Arduino PWM oscilloscope demo sketch | |
* | |
* Use this sketch to experiment with the measurement of a PWM waveform | |
* on an oscilloscope. | |
* | |
* Connect CHA of the oscilloscope to the anode of the LED. | |
* | |
* Use a potentiometer to control the duty cycle. | |
* | |
* Set triggering to Auto, and start the experiment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
LJ - 07.30 - sine_wave_DAC0.lua | |
This script creates a rudimentary sine wave on DAC0. | |
Components | |
---------- | |
- LabJack T4 | |
- Oscilloscope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void refresh_readings() { | |
float f_temperature; | |
float f_humidity; | |
float f_pressure; | |
float f_altitude; | |
digitalWrite(LED_PIN, HIGH); | |
postCounter++; // New post, increase the post counter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import I2C | |
import time | |
# BME280 default address. | |
BME280_I2CADDR = 0x76 | |
# Operating Modes | |
BME280_OSAMPLE_1 = 1 | |
BME280_OSAMPLE_2 = 2 | |
BME280_OSAMPLE_4 = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written by Peter Dalmaris from Tech Explorations. | |
// Used to find out how long an ESP32 can last on a LiPo battery. | |
// This sketch will blink the LED at GPIO5 once per second and | |
// store the number of blinks in an EEPROM location. | |
// In between blinks, the ESP32 goes to sleep. | |
#include "EEPROM.h" | |
#include <DeepSleepScheduler.h> | |
#ifdef ESP32 |
NewerOlder