Skip to content

Instantly share code, notes, and snippets.

View tina1998612's full-sized avatar
:octocat:
DigitalNomad

李婷婷 Lee Ting Ting tina1998612

:octocat:
DigitalNomad
View GitHub Profile
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
0xEffB8759ACB5C5cf5A97C80D7400F8fBd4F81Eb6
cb13cf4bf1b142aab8dc9d3c73d54716caf14f7c
void in_round_turn(){
if(!inAuto) return;
if(!in_round) {
if(center[1]>40 && center[2]>40) setServoDegree(-30), in_round = 1; // turn right if top center line is on the right side
else setServoDegree(30), in_round = 2; // else turn left
} else{ // if in round && center line points to black img
switch(in_round){
case 1:
setServoDegree(-30);
break;
/*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>
import processing.serial.*;
import java.util.*;
Serial myPort;
int globalWidth = 80;
int globalHeight = 60;
int globalSpeed = 0;
int displaySpeed;
'use strict';
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN;
const APIAI_TOKEN = process.env.APIAI_TOKEN;
const WEATHER_API_KEY = process.env.WEATHER_API_KEY;
const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const apiai = require('apiai');
import processing.serial.*;
import java.util.*;
Serial myPort;
int globalWidth = 80;
int globalHeight = 60;
int globalSpeed = 0;
int displaySpeed;
*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>
/*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>