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) |
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
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
// @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
#!/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
#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
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
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
`timescale 1ns / 1ps | |
// Code was provided by Brock J. LaMeres | |
// See his book "Introduction to Logic Curcuits & Logic Design with Verilog" (2nd edition) | |
// for more detailed discussions | |
// | |
// It was modified for Spartan7 and pared down for simplicity | |
// Only 3 instructions LDA, STA, and BRA to demonstrate simple program | |
// Only a single output port to display result |
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
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets klock_IBUF] | |
set_property -dict { PACKAGE_PIN T5 IOSTANDARD LVCMOS33 } [get_ports { klock }]; #IO_L22N_T3_AD7N_35 Sch=led0_b | |
set_property -dict { PACKAGE_PIN T6 IOSTANDARD LVCMOS33 } [get_ports { reset }]; #IO_L21P_T3_DQS_AD14P_35 Sch=led0_r | |
## port_out_00 | |
set_property -dict { PACKAGE_PIN V2 IOSTANDARD LVCMOS33 } [get_ports { port_out_00[0] }]; #IO_L4N_T0_35 Sch=btn[0] | |
set_property -dict { PACKAGE_PIN V3 IOSTANDARD LVCMOS33 } [get_ports { port_out_00[1] }]; #IO_L4P_T0_35 Sch=btn[1] |
OlderNewer