Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(1):
# Take each frame
_, frame = cap.read()
@robo8080
robo8080 / main.cpp
Last active October 2, 2018 11:29
invertedRobot
/* "A very easy and simple inverted pendulum balancing robot"
You need only half a day to make it, if you have some Materials.
Copyright (C) 2014 ArduinoDeXXX All Rights Reserved. */
//modified by robo8080
#include "mbed.h"
Ticker tick;
//Timer t;
DigitalOut fwdL(PTD4); //2
DigitalOut revL(PTA12); //3
@robo8080
robo8080 / microbit_temperature.py
Created January 20, 2020 12:13
microbit_temperature.py
#!python2
# coding: utf-8
import cb
def s8(value):
return -(value & 0b10000000) | (value & 0b01111111)
class MyCentralManagerDelegate (object):
def __init__(self):
self.peripheral = None
@robo8080
robo8080 / FunctionCall.cpp
Created July 12, 2023 11:18
天気予報FunctionCall
#include "FunctionCall.h"
#include <Avatar.h>
#include <AudioGeneratorMP3.h>
#include <HTTPClient.h>
using namespace m5avatar;
extern Avatar avatar;
extern String speech_text;
extern String speech_text_buffer;
extern AudioGeneratorMP3 *mp3;
// certificate for https://api.openai.com
// GlobalSign Root CA, valid until Fri Jan 28 2028, size: 1927 bytes
const char* root_ca_openai = \
"-----BEGIN CERTIFICATE-----\n" \
"MIIFYjCCBEqgAwIBAgIQd70NbNs2+RrqIQ/E8FjTDTANBgkqhkiG9w0BAQsFADBX\n" \
"MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEQMA4GA1UE\n" \
"CxMHUm9vdCBDQTEbMBkGA1UEAxMSR2xvYmFsU2lnbiBSb290IENBMB4XDTIwMDYx\n" \
"OTAwMDA0MloXDTI4MDEyODAwMDA0MlowRzELMAkGA1UEBhMCVVMxIjAgBgNVBAoT\n" \
"GUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBMTEMxFDASBgNVBAMTC0dUUyBSb290IFIx\n" \