Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
for (int i = 0; i < 10; i++) { | |
int val = analogRead(A0 + i); | |
int mapped = map(val, 0, 1023, 0, 9); | |
Serial.print(mapped); | |
Serial.print(" "); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
let angle = 0 | |
radio.onDataPacketReceived( ({ receivedNumber }) => { | |
if (receivedNumber < 0) { | |
basic.showIcon(IconNames.Angry) | |
} else { | |
pins.servoWritePin(AnalogPin.P2, pins.map( | |
3000 - Math.min(receivedNumber, 3000), | |
0, | |
3000, | |
5, |
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
let startTime = 0 | |
let scoring = false | |
let playing = false | |
let winTime = 0 | |
input.onPinPressed(TouchPin.P0, () => { | |
startRound() | |
}) | |
function handleWin() { | |
winTime = input.runningTime() - startTime | |
basic.showNumber(winTime) |
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 <synth_simple_drum.h> | |
#include <Audio.h> | |
#include <Wire.h> | |
#include <SPI.h> | |
#include <SD.h> | |
#include <SerialFlash.h> | |
// GUItool: begin automatically generated code | |
AudioSynthWaveformSine sine1; //xy=69.01041030883789,238.01041412353516 | |
AudioSynthKarplusStrong string1; //xy=114.01040649414062,78.01041412353516 |
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 microbit import uart, pin14, pin15, pin2, pin1, pin0, sleep, display | |
from sys import print_exception | |
import music | |
#This is a simplified version of the library here: | |
# https://github.com/fizban99/microbit_us100 | |
# | |
# TODO: Perhaps see the above for exception handling. | |
class US100: |