This file contains hidden or 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
| # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries | |
| # SPDX-License-Identifier: MIT | |
| """ | |
| This test will initialize the display using displayio and draw a solid green | |
| background, a smaller purple rectangle, and some yellow text. | |
| """ | |
| import analogio | |
| import board |
This file contains hidden or 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 board | |
| import digitalio as dio | |
| import time | |
| motor_cw = dio.DigitalInOut(board.D3) | |
| motor_cw.direction = dio.Direction.OUTPUT | |
| motor_ccw = dio.DigitalInOut(board.D4) | |
| motor_ccw.direction = dio.Direction.OUTPUT |
This file contains hidden or 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 board | |
| import analogio as aio | |
| import digitalio as dio | |
| import pwmio | |
| import time | |
| cw = pwmio.PWMOut(board.D6, frequency=500, duty_cycle=0) | |
| ccw = pwmio.PWMOut(board.D8, frequency=500, duty_cycle=0) | |
| motor = cw |
This file contains hidden or 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
| /**************************************************************************/ | |
| // Based on code from Adafruit's PN532 NFC shield example | |
| // BSD license | |
| /**************************************************************************/ | |
| #include <Wire.h> | |
| #include <Adafruit_NFCShield_I2C.h> | |
| #define IRQ (2) |
This file contains hidden or 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 flask import Flask, render_template, request | |
| from uwsgidecorators import * | |
| import pytronics | |
| import os, time | |
| public = Flask(__name__) | |
| public.config['PROPAGATE_EXCEPTIONS'] = True | |
| # Include "no-cache" header in all POST responses | |
| @public.after_request |
This file contains hidden or 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 time | |
| import board | |
| import neopixel | |
| import random | |
| # The number of NeoPixels | |
| num_pixels = 240 | |
| # The order of the pixel colors - RGB or GRB. Some NeoPixels have red and green reversed! | |
| # For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW. |
This file contains hidden or 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 socket | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| sock.bind(('', 5000)) | |
| while True: | |
| data, addr = sock.recvfrom(4096) | |
| print('got packet: %s from $s' % data, addr) |
This file contains hidden or 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 socket | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| sock.sendto(b"Buy a copy of Chip War today!", ("130.64.80.187", 5000)) |
This file contains hidden or 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 board | |
| import digitalio as dio | |
| import time | |
| led = dio.DigitalInOut(board.LED) | |
| led.direction = dio.Direction.OUTPUT | |
| button = dio.DigitalInOut(board.D6) | |
| button.direction = dio.Direction.INPUT |
NewerOlder