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 Pin | |
import time | |
led = Pin(15, Pin.OUT) | |
button = Pin(14, Pin.IN, Pin.PULL_DOWN) | |
blueLED = Pin(16, Pin.OUT) | |
blueLED.value(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
from machine import Pin | |
import time | |
led = Pin(15, Pin.OUT) | |
button = Pin(14, Pin.IN, Pin.PULL_DOWN) | |
while True: | |
if button.value(): | |
led.value(1) | |
time.sleep(1) |
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
#Modified from https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/ads1015-slash-ads1115 | |
import time | |
import Adafruit_ADS1x15_modified as Adafruit_ADS1x15 | |
adc = Adafruit_ADS1x15.ADS1x15() |
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
#!/usr/bin/python | |
#BASED ON ADAFRUIT | |
#https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/python-circuitpython | |
#https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code | |
#Modified for I2C on the raspberry pi pico; for this, adapted code from: | |
# https://www.digikey.com/en/maker/projects/raspberry-pi-pico-rp2040-i2c-example-with-micropython-and-cc/47d0c922b79342779cdbd4b37b7eb7e2 | |
import time |
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
// @MAP_IO port_out_00[0] 06 | |
// @MAP_IO port_out_00[1] 07 | |
// @MAP_IO port_out_00[2] 08 | |
// @MAP_IO port_out_00[3] 09 | |
// @MAP_IO port_out_00[4] 10 | |
// @MAP_IO port_out_00[5] 11 | |
// @MAP_IO port_out_00[6] 12 | |
// @MAP_IO port_out_00[7] 14 | |
// @MAP_IO reset 18 |
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 machine | |
import utime | |
import ustruct | |
import sys | |
from machine import Pin | |
#PMOD2 Joystick | |
#4 pins | |
led_up = Pin(13, Pin.OUT) |
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
; Used Tom C. Hayes codes as templates (bit flip.a51, serial message receive.a51, int_inc_dec.a51) | |
; from Learning the Art of Electronics | |
$NOSYMBOLS ; keeps listing short.. | |
$INCLUDE (C:\MICRO\8051\RAISON\INC\c8051f410.inc) | |
$INCLUDE (C:\MICRO\8051\RAISON\INC\VECTORS320.INC) | |
CLOCK EQU P0.0 | |
LATCH EQU P0.1 |
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
#Version 0.2 | |
#Different color bricks now supported. | |
import random | |
import serial | |
import time | |
u = serial.Serial("COM13", baudrate=9600, timeout=10) |
NewerOlder