Skip to content

Instantly share code, notes, and snippets.

View swizardlv's full-sized avatar

Swizard swizardlv

  • Beijing
View GitHub Profile
// use aliyun repo in china because of gfw. https://maven.aliyun.com/mvn/view
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
maven {
url 'https://maven.aliyun.com/repository/public'
}
maven {
url 'https://maven.aliyun.com/repository/jcenter'
}
import Adafruit_DHT
import time

#sensor type
sensor=Adafruit_DHT.DHT11
#set GPIO NO
gpio=16

一、硬件连接 树莓派自带的40个排针接口里面就有一组SPI接口:GPIO9(MISO) ,GPIO10(MOSI), GPIO11(SCL)。 alt 树莓派管脚 alt 树莓派管脚 然后看一下我使用的OLED的接口(注意,OLED的驱动芯片必须是SSD1306):

分别是GND VCC D0 D1 RST DC CS

@swizardlv
swizardlv / mqtt_spark_streaming.py
Created July 31, 2017 07:11 — forked from kartben/mqtt_spark_streaming.py
Example of how to use Spark Streaming for MQTT data consolidation
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#