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
/************************************************************************ | |
M5StackFire I2C Scanner | |
The M5StackFire has a connector for I2C devices. | |
This program scans the addresses 1-127 continuosly and shows | |
the devices found on the TFT. | |
The M5Stack fire has two internal I2C devices at address 0x68 and 0x75. | |
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
from pynq.overlays.base import BaseOverlay | |
base = BaseOverlay("base.bit", download=False) | |
# あとでグラフに書きたい場合はtrue | |
is_debug_capture = True | |
l_src_arr = [] | |
r_src_arr = [] | |
l_dst_arr = [] | |
r_dst_arr = [] |
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
// select_line_in()呼び出し時にTX Buffから音声出力できるようにレジスタ設定を書き込んでおく | |
/****************************************************************************** | |
* Function to select LINE_IN as input. | |
* @param iic_index is the i2c index in /dev list. | |
* @return none. | |
*****************************************************************************/ | |
extern "C" void select_line_in(int iic_index) { | |
int iic_fd; | |
iic_fd = setI2C(iic_index, IIC_SLAVE_ADDR); |
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
# %matplotlib inline | |
import matplotlib.pyplot as plt | |
from ipywidgets import * | |
plt.rcParams['figure.figsize'] = (15.0, 10.0) | |
from pynq.overlays.base import BaseOverlay | |
base = BaseOverlay("base.bit") | |
# 2の補数の扱い辛い | |
def twos_complement(hexstr,bits): |
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 <iostream> | |
#include <string> | |
#include <vector> | |
#include <stack> | |
#include <stdint.h> | |
using namespace std; | |
int main() { | |
vector<uint8_t> mem(30000,0); | |
stack<int> branchStack; |
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
apiVersion: "batch/v1beta1" | |
kind: CronJob | |
metadata: | |
name: "<workload-name>" | |
namespace: "default" | |
labels: | |
app: "app-label" | |
spec: | |
schedule: "0 */4 * * *" | |
startingDeadlineSeconds: 120 |
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
def loopSeq = ((0 to 0xff) ++ (0x0 to 0xff).reverse) | |
val arr = {loopSeq map{x => s"{ $x, 0, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, $x, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, 0, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, $x, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, $x, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, 0, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, $x, $x,}, "}} |
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 <stdio.h> | |
typedef unsigned short uint16; | |
typedef unsigned char uint8; | |
const char numberTable[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; | |
void itoa(uint16 src, char* buf){ | |
uint8 i; | |
buf[0] = '0'; | |
buf[1] = 'x'; |
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 <stdio.h> | |
// 未知数の数/方程式の数 | |
#define N 2 | |
int main(void){ | |
// x + 2y = 5 | |
//2x + 3y = 8 | |
double matrix[N][N + 1] = { | |
{ 1, 2, 5 }, |
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
#ifndef IMAGEDATA_H_ | |
#define IMAGEDATA_H_ | |
#include <avr/pgmspace.h> | |
PROGMEM const uint8_t img_src[240][50] = { | |
{ 0x7, 0xf8, 0xff, 0xff, 0x3, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0xfe, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, }, | |
{ 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x19, 0xff, 0xff, 0x8f, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, }, | |
{ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0xff, 0xff, 0xc7, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, |
NewerOlder