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
//in app.module.ts FormsModule -> ReactiveFormsModule | |
import { ReactiveFormsModule } from '@angular/forms'; | |
imports: [ | |
BrowserModule, | |
ReactiveFormsModule, | |
HttpModule | |
], | |
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
// in html | |
<form #userform = "ngForm" (ngSubmit) = "onSubmit(userform.value)"> | |
<input name="first" ngModel required #first="ngModel"> | |
<input type="text" placeholder="lastname" name="lastname" ngModel> | |
<select name="lang" ngModel> | |
<option value="a1">a1</option> | |
<option value="a2">a2</option> |
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
//in app.component.ts | |
export class AppComponent { | |
title = 'app works!'; | |
// Data array | |
todoListData = ["aaa", "bbb", "ccc"]; | |
inputText = ""; | |
// function |
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
//in app.module.ts | |
import { RouterModule } from '@angular/router'; | |
imports: [ | |
BrowserModule, | |
FormsModule, | |
HttpModule, | |
RouterModule.forRoot([ | |
{ | |
path: 'member', |
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 serial | |
import time | |
ser = serial.Serial('/dev/tty.usbmodem1411', 9600) | |
time.sleep(1) | |
print ser.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
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); | |
void setup() { | |
//Initialize serial library for transmitting and receiving data via USB | |
Serial.begin(9600); | |
lcd.begin(16, 2); //define LCD Size 16 by 2 |
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
<?php | |
require 'vendor/autoload.php'; | |
const DEFAULT_URL = 'https://phpdemoccc-sd27f.firebaseio.com/'; | |
const DEFAULT_PATH = '/'; | |
$firebase = new \Firebase\FirebaseLib(DEFAULT_URL); | |
// --- get data --- | |
$k1 = $firebase->get('/k1'); |
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
int number = 0 ; | |
void setup(){ | |
Serial.begin(9600); | |
} | |
void loop(){ | |
Serial.println(number); | |
number = number + 1; | |
delay(3000); |
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 "SPI.h" | |
#include "MFRC522.h" | |
#define SS_PIN 10 | |
#define RST_PIN 9 | |
#define SP_PIN 8 | |
MFRC522 rfid(SS_PIN, RST_PIN); | |
MFRC522::MIFARE_Key key; |
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 <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); | |
void setup() { | |
lcd.begin(16, 2); //define LCD Size 16 by 2 | |
// lcd line 1 |