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 - 10.40 - LJ - 10.40 - DAC0_write.py | |
This script shows how to write voltage to DAC0. | |
Components | |
---------- | |
- LabJack T4 | |
- Voltmeter/Multimeter |
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 - 10.50 - FIO4_blink.py | |
This script shows how to control an LED with FIO4. | |
Components | |
---------- | |
- LabJack T4 | |
- LED |
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 - 10.60 - lua_script_host_control.py | |
This script shows how to control an LED with FIO4 by deploying a Lua scripts | |
to the LabJack. This script also demonstrates communication between this Python | |
script and the on-board Lua scrip via user RAM. | |
Components | |
---------- |
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 - 10.70 - simple_logging.py | |
This script shows how to control an LED with FIO4 by deploying a Lua scripts | |
to the LabJack. This script also demonstrates communication between this Python | |
script and the on-board Lua scrip via user RAM. | |
Components | |
---------- |
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
import paho.mqtt.client as mqtt | |
# The callback for when the client receives a CONNACK response from the server. | |
def on_connect(client, userdata, flags, rc): | |
print("Connected with result code "+str(rc)) | |
# Subscribing in on_connect() means that if we lose the connection and | |
# reconnect then subscriptions will be renewed. | |
client.subscribe("techexplorations/test") |
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
byte encodebool(boolean* arr) | |
{ | |
byte val = 0; | |
for (int i = 0; i<4; i++) | |
{ | |
val <<= 1; | |
if (arr[i]) val |= 1; | |
} | |
return val; | |
} |
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 |
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 simply blink an LED at a 1Hz frequency. | |
// It will increment the counter in EEPROM address 0 every time it blinks. | |
// https://techexplorations.com | |
#include "EEPROM.h" | |
int addr = 0; | |
#define EEPROM_SIZE 32 |
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
// This sketch will initialise the long | |
// counter in address 0. | |
// Written by Peter Dalmaris from Tech Explorations. | |
// Used to find out how long an ESP32 can last on a LiPo battery. | |
// https://techexplorations.com | |
#include "EEPROM.h" | |
int addr = 0; | |
#define EEPROM_SIZE 32 |