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 pandas as pd | |
from reportlab.pdfgen import canvas | |
from reportlab.lib.pagesizes import A4 | |
from PyPDF2 import PdfWriter, PdfReader | |
import io | |
def create_certificate(name, base_pdf, output_pdf): | |
packet = io.BytesIO() | |
can = canvas.Canvas(packet, pagesize=A4) | |
# Set font and size |
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 | |
from neopixel import Neopixel | |
NO_OF_LEDS = 12 | |
pixelssec = Neopixel(8, 0, 1, "GRB") | |
pixelsmin1 = Neopixel(11, 2, 22, "GRB") | |
pixelsmin2 = Neopixel(12, 3, 18, "GRB") | |
rtc = machine.RTC() | |
WHITE = (80, 80, 80) |
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
#include <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
#define PIN 8 | |
#define NUMPIXELS 16 // Popular NeoPixel ring size | |
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
int pressed = 0; |
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
vowels = 'aeiou' | |
consonants = 'bcdfghjklmnpqrstvwxyz' | |
sentence = "how do you say ... in pig latin?" | |
### YOUR CODE HERE! | |
def translate_word(word): | |
if len(word) >= 2: | |
if word[0] in consonants and word[1] in vowels: | |
word = word[1:] + word[:1] + "ay" | |
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
# Slide Puzzle | |
# By Al Sweigart [email protected] | |
# http://inventwithpython.com/pygame | |
# Released under a "Simplified BSD" license | |
import pygame, sys, random | |
from pygame.locals import * | |
# Create the constants (go ahead and experiment with different values) | |
BOARDWIDTH = 4 # number of columns in the 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
# Slide Puzzle | |
# By Al Sweigart [email protected] | |
# http://inventwithpython.com/pygame | |
# Released under a "Simplified BSD" license | |
import pygame, sys, random | |
from pygame.locals import * | |
# Create the constants (go ahead and experiment with different values) | |
BOARDWIDTH = 4 # number of columns in the 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 random | |
HANGMANPICS = [''' | |
+---+ | |
| | | |
| | |
| | |
| | |
| | |
=========''', ''' | |
+---+ |
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
#include <Adafruit_NeoPixel.h> | |
// Which pin is connected to the pressure sensors | |
#define STEP_UP_PIN A0 | |
#define STEP_LEFT_PIN A1 | |
#define STEP_DOWN_PIN A2 | |
#define STEP_RIGHT_PIN A3 | |
// Which pin is connected to the NeoPixels | |
#define LED_UP_PIN 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
import processing.serial.*; | |
Serial port; | |
int x, y, z, strength; | |
void setup() { | |
printArray(Serial.list()); | |
port = new Serial(this, Serial.list()[1], 115200); | |
port.bufferUntil(10); | |
size(700, 550); | |
textSize(32); |
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
#include<IRremote.h> //including infrared remote header file | |
#define button_2 34935 //code for button 1 | |
#define button_4 10455 //code for button 2 | |
#define button_5 43095 //code for button 3 | |
#define button_6 26775 //code for button 4 | |
#define button_8 39015 //code for button 4 | |
int RECV_PIN = 9; //IR receiver pin | |
IRrecv irrecv(RECV_PIN); |
NewerOlder