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 TileController import TileController | |
import time | |
import signal | |
import sys | |
# Global variable to store the controller | |
controller = None | |
def signal_handler(sig, frame): | |
print('\nKeyboard interrupt received. Cleaning up...') |
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 <Arduino.h> | |
#include <Wire.h> | |
#include <EEPROM.h> | |
#define MAX_ADDRESSES 32 | |
#define MAX_ROWS 6 | |
#define MAX_COLUMNS 6 | |
#define POWER_ARRAY_ROWS (MAX_ROWS * 3) | |
#define POWER_ARRAY_COLUMNS (MAX_COLUMNS * 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 TileController | |
with TileController.TileController("/dev/tty.usbmodem101") as tc: | |
print(tc.read_width()) | |
print(tc.read_height()) | |
print(tc.read_address_list()) | |
print(tc.scan_addresses()) | |
tc.blinkall_start() | |
input("Press Enter to stop blinking") |
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 TileController import TileController | |
import time | |
import signal | |
import sys | |
# Global variable to store the controller | |
controller = None | |
def signal_handler(sig, frame): | |
print('\nKeyboard interrupt received. Cleaning up...') |
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 serial | |
import time | |
class TileController: | |
def __init__(self, port, baudrate=115200, timeout=1): | |
self.ser = serial.Serial(port, baudrate, timeout=timeout) | |
time.sleep(1) # Wait for Arduino to reset | |
self._clear_initial_message() # Clear the "Command Line Terminal Ready" message | |
self.scan_addresses() # Perform initial scan |
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 matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
img = mpimg.imread('your_image.png') | |
imgplot = plt.imshow(img) | |
plt.show() |
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
messagesFile = open("messages.py", "r") |
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 math | |
while True: | |
mass = float(input("Mass: ")) | |
temp = float(input("Temp (C): "))+273 | |
print(str(math.sqrt(temp*2/mass))) |
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 math import * |