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 "SdFat.h" | |
// SPI_DRIVER_SELECT == 0 // Must be set in SdFat/SdFatConfig.h | |
#define PIN_SD_CS 33 | |
#define PIN_SD_MOSI 27 | |
#define PIN_SD_MISO 25 | |
#define PIN_SD_SCK 26 | |
#define SD_FAT_TYPE 0 | |
SPIClass spi(HSPI); |
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
const fs = require("fs") | |
let buf = fs.readFileSync("file.bin"); | |
let arr = []; | |
for(let i=0;i<buf.length;i++) | |
{ | |
arr.push('0x'+buf[i].toString(16)); | |
} | |
fs.writeFileSync("file.txt","["+arr.join(",")+"]") |
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 webview | |
webview.create_window('Stellarium-Web', 'https://stellarium-web.org/') | |
webview.start() |
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
###USAGE### | |
# pip3 install makeblock --upgrade | |
########### | |
from time import sleep | |
from random import random | |
import math | |
from makeblock import MegaPi,SerialPort | |
A6 = 60 | |
A7 = 61 | |
A8 = 62 |
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
###USAGE### | |
# pip3 install makeblock --upgrade | |
########### | |
from time import sleep | |
from makeblock import MegaPi,SerialPort | |
megapi = MegaPi.connect() # or megapi = MegaPi.connect(SerialPort.connect("/dev/ttyXXXX")) | |
A6 = 60 | |
A7 = 61 | |
A8 = 62 | |
A9 = 63 |
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
###USAGE### | |
# pip3 install makeblock | |
########### | |
from time import sleep | |
from makeblock import MegaPi,SerialPort | |
megapi = MegaPi.connect() # or megapi = MegaPi.connect(SerialPort.connect("/dev/ttyXXXX")) | |
motor1 = megapi.DCMotor(1,1) | |
motor2 = megapi.DCMotor(1,2) | |
motor3 = megapi.DCMotor(2,1) | |
motor4 = megapi.DCMotor(2,2) |
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 "MeMegaPi.h" | |
#include <SoftwareSerial.h> | |
Me7SegmentDisplay disp(PORT_8); | |
MeInfraredReceiver infraredReceiverDecode(PORT_7); | |
MeStepperOnBoard stepper(SLOT_1); | |
int i = 0; | |
void setup() | |
{ | |
infraredReceiverDecode.begin(); |
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
const {execFile} = require('child_process'); | |
const gifsicle = require('gifsicle'); | |
execFile(gifsicle, ['--resize-fit-width', '200','-o', 'output.gif', 'input.gif'], err => { | |
console.log('Image minified!'); | |
}); |
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
[profile] | |
layer_height = 0.2 | |
wall_thickness = 0.8 | |
retraction_enable = True | |
solid_layer_thickness = 0.6 | |
fill_density = 40 | |
print_speed = 45 | |
print_temperature = 218 | |
print_temperature2 = 0 | |
print_temperature3 = 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
var canvas = document.getElementById("canvas"); | |
var ctx = canvas.getContext("2d"); | |
ctx.strokeStyle = "#000"; | |
ctx.strokeWidth = 1; | |
var cx = 400, | |
cy = 400, | |
r = 200.0; | |
function scale(cosλcosφ) { | |
return 1 / (1 + cosλcosφ); | |
} |