2017-11-13から1日間の記事一覧

MultiU24X24toH16の解析

G1 X1 送信時 *acc_step_rate: 35, acc_time: 859, acc_rate: 671088 *acc_step_rate: 69, acc_time: 1718, acc_rate: 671088 *acc_step_rate: 103, acc_time: 2577, acc_rate: 671088 *acc_step_rate: 138, acc_time: 3436, acc_rate: 671088 *acc_step_rat…

Arduinoでprintfを実装する

ここを参考に https://arduino.stackexchange.com/questions/176/how-do-i-print-multiple-variables-in-a-string #include <stdarg.h> #include <Arduino.h> #define ARDBUFFER 16 int ardprintf(char *str, ...) { int i, count=0, j=0, flag=0; char temp[ARDBUFFER+1]; for(i=</arduino.h></stdarg.h>…

Sprinterのspeed lookup table

speed_lookuptable_fastをグラフ描画してみる =#from pylab import * import matplotlib.pyplot as plt slow = [ [ 62500, 12500], [ 50000, 8334], [ 41666, 5952], [ 35714, 4464], [ 31250, 3473], [ 27777, 2777], [ 25000, 2273], [ 22727, 1894], [ 20…

MultiU16X8toH16とMultiU24X24toH16の解析 その2

戦略 1. アセンブラと同じ操作をするCコードをline by lineで書いてみる 2. Sprinterを実際に動かして、入力値と出力値を調べる 解析用Arduinoプログラム // intRes = intIn1 * intIn2 >> 16 // uses: // r26 to store 0 // r27 to store the byte 1 of the …

MultiU16X8toH16とMultiU24X24toH16の解析

MultiU16X8toH16 // intRes = intIn1 * intIn2 >> 16 // uses: // r26 to store 0 // r27 to store the byte 1 of the 24 bit result // MultiU16X8toH16(timer, tmp_step_rate, gain); #define MultiU16X8toH16(timer_16bit, tmp_step_rate_8bit, gain_16bi…