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 <Bounce2.h> | |
const int pin = 2; | |
const int button = 10; | |
bool led_state = false; | |
Bounce bouncer = Bounce(); | |
// the setup function runs once when you press reset or power the board | |
void setup() { | |
pinMode(pin, OUTPUT); |
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
# | |
# Weather Station. Requires Grove Shield, Temp Sensor, and LCD | |
import utime | |
from lcd1602 import LCD1602 | |
from dht11 import * | |
from machine import Pin, I2C | |
from time import sleep | |
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 utime | |
import machine | |
led_onboard = machine.Pin(25, machine.Pin.OUT) | |
while True: | |
led_onboard.value(1) #set the LED to on | |
utime.sleep(1) #wait 1 second | |
led_onboard.value(0) #sset the LED to off | |
utime.sleep(1) |
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
// the setup function runs once when you press reset or power the board | |
void setup() { | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second |
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 <stdio.h> | |
void main() { | |
// Write C code here | |
printf("Hello world"); | |
} |
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
EXPORT DATA | |
OPTIONS (format=CSV, | |
header=TRUE, | |
uri="gs://bucket/path/rides_*.csv") AS | |
SELECT | |
* | |
FROM | |
`bigquery-public-data.london_bicycles.cycle_hire` | |
WHERE | |
DATE_TRUNC(DATE(end_date), month) >= '2015-08-01' |
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
SELECT | |
COUNT(rental_id) | |
FROM | |
`bigquery-public-data.london_bicycles.cycle_hire` | |
WHERE | |
DATE_TRUNC(DATE(end_date), month) >= '2015-08-01' and DATE_TRUNC(DATE(end_date), year) < '2017-01-01' |
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
SELECT | |
COUNT(rental_id) | |
FROM | |
`bigquery-public-data.london_bicycles.cycle_hire` | |
WHERE | |
DATE_TRUNC(DATE(end_date), year) < '2017-01-01' |
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
SELECT | |
DATE_TRUNC(DATE(end_date), YEAR) | |
FROM | |
`bigquery-public-data.london_bicycles.cycle_hire` | |
GROUP BY | |
1 |
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
model = models.Sequential([ | |
layers.Conv2D(filters=6, kernel_size=(5,5), strides=1, activation='tanh', input_shape=(HEIGHT, HEIGHT, NUM_CHANNELS)), | |
layers.AveragePooling2D(pool_size=(2,2)), | |
layers.Conv2D(filters=16, kernel_size=(5,5), strides=1, activation='tanh'), | |
layers.AveragePooling2D(pool_size=(2,2)), | |
layers.Flatten(), | |
layers.Dense(120), | |
layers.Dense(84), | |
layers.Dense(NCLASSES, activation='softmax') | |
]) |
NewerOlder