Skip to content

Instantly share code, notes, and snippets.

@rockos
rockos / cambot with arduino
Created December 31, 2017 08:22
kidslab_20171231.ino
int distance;
String MEIREI;
int SPEED_H;
int SPEED;
int L_EN;
@rockos
rockos / kidslab20170617.go
Last active June 17, 2017 00:24
amida and gunron
package main
import (
"fmt"
)
/* 2 <-> 3 */
func amida23(a,b,c string) (string,string,string) {
return a,c,b
@rockos
rockos / buzzer_doremi.xml
Last active April 14, 2017 05:07
kidslab201704_arduino
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="variables_set" id="557" inline="true" x="88" y="-212"><field name="TYPE">Boolean</field><field name="VAR">item</field><value name="VALUE"><block type="inout_digital_read" id="473"><field name="PIN">2</field><field name="INPUT_MODE">INPUT</field></block></value><next><block type="controls_if" id="484" inline="false"><value name="IF0"><block type="logic_compare" id="315" inline="true"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="318"><field name="TYPE">Number</field><field name="VAR">item</field></block></value><value name="B"><block type="inout_highlow" id="464"><field name="BOOL">LOW</field></block></value></block></value><statement name="DO0"><block type="tone" id="478"><field name="PIN">10</field><field name="FREQ">262</field><next><block type="delay_custom" id="579" inline="false"><value name="DELAY_TIME"><block type="math_number" id="580"><field name="NUM">300</field></block></value><next><block type="tone" id="581"><fiel
#include <Servo.h>
//====================================================================================================================
//Parameter
//====================================================================================================================
#define SERV_NUM 4 //number of servo for array
#define FRAME 20 //interval time from current step to next step: 20msecc
int current_angle[SERV_NUM];
int target_angle[SERV_NUM+1];
@rockos
rockos / smp4_index.html
Created March 18, 2017 01:38
moving robot
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Getting started | phina.js</title>
<!-- phina.js を読み込む -->
@rockos
rockos / smp5_index.html
Created March 18, 2017 01:36
delete many robots
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Getting started | phina.js</title>
<!-- phina.js を読み込む -->
/* 1から100までの偶数の合計を算出する */
package main
import "fmt"
func main() {
/* 変数 sum に合計を格納します */
sum := 0
/* for 文は命令を繰り返すときに使います */
@rockos
rockos / smp6_index.html
Created February 10, 2017 09:04
Move your image using phina.js
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Getting started | phina.js</title>
<!-- phina.js を読み込む -->
@rockos
rockos / smp3_index.html
Created February 10, 2017 08:44
draw image using phina.js
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Getting started | phina.js</title>
<!-- phina.js を読み込む -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>KidsLab Animation</title>
<script src="main_anime1.js"></script>
<style>body{background:white;margin:0;padding:0;}</style>
</head>
<body>