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
#define FCY 8000000UL // FCY = FOSC / 2 | |
#include <xc.h> | |
#include <stdio.h> | |
#include <libpic30.h> | |
#include <p30F2020.h> | |
#include "config.h" | |
int main(void) | |
{ |
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 <Ethernet.h> | |
#include <SPI.h> | |
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 }; // RESERVED MAC ADDRESS | |
EthernetClient client; | |
long previousMillis = 0; | |
unsigned long currentMillis = 0; | |
long interval = 3000; // READING INTERVAL | |
float p = 0.00; |
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
app.post('/results', function(req, res){ | |
var post = {} | |
post.date = new Date(), | |
post.temp = req.body.temp | |
sql.query('INSERT INTO analog_read SET ?', post, function(err, results, fields){ | |
if(err) throw err; | |
console.log('sent success with value : ', post.temp) | |
res.json({'status':'success!'}) | |
}) |
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
#define FCY 8000000UL // FCY = FOSC / 2 | |
#include <xc.h> | |
#include <stdio.h> | |
#include <libpic30.h> | |
#include <config.h> | |
int main(void) | |
{ | |
int channel1Result; |
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
// FBS | |
#pragma config BWRP = BWRP_OFF // Boot Segment Write Protect (Boot Segment may be written) | |
#pragma config BSS = NO_BOOT_CODE // Boot Segment Program Flash Code Protection (No Boot Segment) | |
// FGS | |
#pragma config GWRP = GWRP_OFF // General Code Segment Write Protect (General Segment may be written) | |
#pragma config GSS = GSS_OFF // General Segment Code Protection (Disabled) | |
// FOSCSEL | |
#pragma config FNOSC = PRIOSC // Oscillator Mode (Primary Oscillator (HS, EC)) |
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
/* | |
* File: newmain.c | |
* Author: Wildan S. Nahar | |
* | |
* Created on April 27, 2017, 7:01 PM | |
*/ | |
#define FCY 16000000UL | |
#include <xc.h> |
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
{ | |
"extends": "eslint:recommended", | |
"env": { | |
"es6":true, | |
"browser": true, | |
"node": true | |
}, | |
"rules": { | |
"arrow-body-style":"error", | |
"array-bracket-spacing":"error", |
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
const byte adcPin = 0; // A0 | |
const int MAX_RESULTS = 256; | |
volatile int results [MAX_RESULTS]; | |
volatile int resultNumber; | |
// ADC complete ISR | |
ISR (ADC_vect) | |
{ | |
if (resultNumber >= MAX_RESULTS) | |
ADCSRA = 0; // turn off ADC |
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
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
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
var mongoose = require('mongoose') | |
var Schema = mongoose.Schema | |
var lecturerSchema = new Schema ({ | |
name: String, | |
username: String, | |
kk: String, | |
kk_initial: String, | |
img_url: String, |
OlderNewer