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
# This file is executed on every boot (including wake-boot from deepsleep) | |
import gc | |
gc.collect() | |
import network | |
ap_if = network.WLAN(network.AP_IF) | |
ap_if.config(essid="RGBLamp", password="12345678") |
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
html = """<!DOCTYPE html><html><head><title>RGBLamp</title><style type="text/css">body{background:#222;color:#aaa;font-family:monospace;}table,input,h1{font-size:4em;}input[type=range]{width:1em;}#r_color,#g_color,#b_color{width:1em;height:1em;background:#000;}#r_value,#g_value,#b_value{min-width:2em;}#rgb{width:4em;height:4em;background:#000;margin-left:.5em;}.box{border:solid .1em #111;-webkit-border-radius:6;-moz-border-radius:6;border-radius:6px;}.btn{color:#aaa;font-size:1em;font-family:monospace;background:#333;padding:10px 20px 10px 20px;margin-top:.5em;text-decoration:none;}.btn:hover{background:#000;text-decoration:none;}</style><script type="text/javascript">function showInfo(){var r=document.forms[0].r.value;var g=document.forms[0].g.value;var b=document.forms[0].b.value;showColor('r_color',255,invertColor(r),invertColor(r));showColor('g_color',invertColor(g),255,invertColor(g));showColor('b_color',invertColor(b),invertColor(b),255);showColor('rgb',r,g,b);showValue('r_value',r);showValue('g_value', |
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
""" | |
RGBLamp | |
------- | |
HTTP daemon for Micropython running on NodeMCU. | |
@author Leo Vidarte <[email protected]> | |
@date 22-08-2016 | |
""" | |
import socket |
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
from gpiozero import MotionSensor, Buzzer | |
import time | |
pir = MotionSensor(22) | |
bz = Buzzer(17) | |
print("Waiting for PIR to settle") | |
pir.wait_for_no_motion() | |
while True: |
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
-- rgb.lua | |
PIN_R = 3 | |
PIN_G = 2 | |
PIN_B = 1 | |
function led(r, g, b) | |
pwm.setduty(PIN_R, r) | |
pwm.setduty(PIN_G, g) | |
pwm.setduty(PIN_B, b) | |
end |
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> | |
#include <LiquidCrystal.h> | |
#define BUTTON_PIN 2 | |
#define LCD_LINE_LENGTH 17 | |
volatile int state = 1; | |
static char buffer0[LCD_LINE_LENGTH]; | |
static char buffer1[LCD_LINE_LENGTH]; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
<meta charset="utf-8"> | |
</head> | |
<body ng-app="app"> | |
<div ng-controller="ctrl"> | |
Score: {{ score.points }} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
<meta charset="utf-8"> | |
</head> | |
<body ng-app="app"> | |
<div ng-controller="SumController"> | |
<select ng-model="value" ng-options="n for n in [1, 2, 3, 4, 5]"></select> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
<meta charset="utf-8"> | |
</head> | |
<body ng-app="app"> | |
<div ng-controller="NameController"> | |
{{ name }} |
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 xmlrpclib | |
url = 'http://odoo.staging.coquelux.com.br:8069' | |
username = 'leonardo.vidarte@**********.com' | |
password = '*********' | |
db = 'erp_odoo' | |
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url)) | |
uid = common.authenticate(db, username, password, {}) |