Plotclock

     调试程序,运行调试程序,舵机会移动两只悬臂分别停留在一只水平另一只垂直的位置上。如果差距非常大,可拆下悬臂调节,如果比较接近了,就修改程序第3~6行的四个参数 SERVOFAKTORLEFT 左悬臂垂直位置,SERVOFAKTORRIGHT 右悬臂垂直位置,SERVOLEFTNULL 左悬臂180度位置,SERVORIGHTNULL 右悬臂0度位置(右侧为0度,逆时针画圆),参数增加摆臂逆时针转动,一般增幅50,才能看到比较明显的变化。


     调节参数,直到摆臂停在下图的标准位置上为止。


     LIFT0、1、2参数原理相同调试方法略过

    《调试摆臂用代码》


//左右悬臂舵机的90度位置
#define SERVOFAKTORLEFT 550 
#define SERVOFAKTORRIGHT 630  //此参数650是理论中间位置,需要看实际情况调节//左右悬臂舵机的 0或180度位置
#define SERVOLEFTNULL 1750
#define SERVORIGHTNULL 880//三只舵机的接口
#define SERVOPINLIFT  2
#define SERVOPINLEFT  3
#define SERVOPINRIGHT 4//升举舵机的3个角度 
#define LIFT0 1080 // on dr<span style="font-size:12px;">awing surface  写的时候
#define LIFT1 925  // between numbers   字之间
#define LIFT2 725  // going towards sweeper 去笔擦高度</span>// 速度
#define LIFTSPEED 1500// 悬臂的长度,根据图纸测量,无需改变
#define L1 35
#define L2 57.2
#define L3 14.2// 左右舵机轴心的位置
#define O1X 23
#define O1Y -25
#define O2X 49
#define O2Y -25#include <Time.h> // see [url=http://playground.arduino.cc/Code/time]http://playground.arduino.cc/Code/time[/url] 
#include <Servo.h>int servoLift = 1500;Servo servo1;  // Servo 类 声明
Servo servo2;  // 
Servo servo3;  // volatile double lastX = 75;
volatile double lastY = 47.5;int last_min = 0;void setup() 
{ // Set current time only the first to values, hh,mm are neededsetTime(19,38,0,0,0,0);drawTo(38, 24);lift(0);servo1.attach(SERVOPINLIFT);  //  lifting servoservo2.attach(SERVOPINLEFT);  //  left servoservo3.attach(SERVOPINRIGHT);  //  right servodelay(1000);} void loop() 
{ // 移动左右悬臂,让两只悬臂分别停留在水平和垂直的位置上。 通过修改 SERVOFAKTORLEFT , SERVOFAKTORRIGHT, SERVOLEFTNULL , SERVORIGHTNULL 四个参数来微调drawTo(-3, 29.2);delay(500);drawTo(74.1, 28);delay(500);} // Writing numeral with bx by being the bottom left originpoint. Scale 1 equals a 20 mm high font.
// The structure follows this principle: move to first startpoint of the numeral, lift down, draw numeral, lift up
void number(float bx, float by, int num, float scale) {switch (num) {case 0:drawTo(bx + 12 * scale, by + 6 * scale);lift(0);bogenGZS(bx + 7 * scale, by + 10 * scale, 10 * scale, -0.8, 6.7, 0.5);lift(1);break;case 1:drawTo(bx + 3 * scale, by + 15 * scale);lift(0);drawTo(bx + 10 * scale, by + 20 * scale);drawTo(bx + 10 * scale, by + 0 * scale);lift(1);break;case 2:drawTo(bx + 2 * scale, by + 12 * scale);lift(0);bogenUZS(bx + 8 * scale, by + 14 * scale, 6 * scale, 3, -0.8, 1);drawTo(bx + 1 * scale, by + 0 * scale);drawTo(bx + 12 * scale, by + 0 * scale);lift(1);break;case 3:drawTo(bx + 2 * scale, by + 17 * scale);lift(0);bogenUZS(bx + 5 * scale, by + 15 * scale, 5 * scale, 3, -2, 1);bogenUZS(bx + 5 * scale, by + 5 * scale, 5 * scale, 1.57, -3, 1);lift(1);break;case 4:drawTo(bx + 10 * scale, by + 0 * scale);lift(0);drawTo(bx + 10 * scale, by + 20 * scale);drawTo(bx + 2 * scale, by + 6 * scale);drawTo(bx + 12 * scale, by + 6 * scale);lift(1);break;case 5:drawTo(bx + 2 * scale, by + 5 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 6 * scale, 6 * scale, -2.5, 2, 1);drawTo(bx + 5 * scale, by + 20 * scale);drawTo(bx + 12 * scale, by + 20 * scale);lift(1);break;case 6:drawTo(bx + 2 * scale, by + 10 * scale);lift(0);bogenUZS(bx + 7 * scale, by + 6 * scale, 6 * scale, 2, -4.4, 1);drawTo(bx + 11 * scale, by + 20 * scale);lift(1);break;case 7:drawTo(bx + 2 * scale, by + 20 * scale);lift(0);drawTo(bx + 12 * scale, by + 20 * scale);drawTo(bx + 2 * scale, by + 0);lift(1);break;case 8:drawTo(bx + 5 * scale, by + 10 * scale);lift(0);bogenUZS(bx + 5 * scale, by + 15 * scale, 5 * scale, 4.7, -1.6, 1);bogenGZS(bx + 5 * scale, by + 5 * scale, 5 * scale, -4.7, 2, 1);lift(1);break;case 9:drawTo(bx + 9 * scale, by + 11 * scale);lift(0);bogenUZS(bx + 7 * scale, by + 15 * scale, 5 * scale, 4, -0.5, 1);drawTo(bx + 5 * scale, by + 0);lift(1);break;case 111:lift(0);drawTo(70, 46);drawTo(65, 43);drawTo(65, 49);drawTo(5, 49);drawTo(5, 45);drawTo(65, 45);drawTo(65, 40);drawTo(5, 40);drawTo(5, 35);drawTo(65, 35);drawTo(65, 30);drawTo(5, 30);drawTo(5, 25);drawTo(65, 25);drawTo(65, 20);drawTo(5, 20);drawTo(60, 44);drawTo(75.2, 47);lift(2);break;case 11:drawTo(bx + 5 * scale, by + 15 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 15 * scale, 0.1 * scale, 1, -1, 1);lift(1);drawTo(bx + 5 * scale, by + 5 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 5 * scale, 0.1 * scale, 1, -1, 1);lift(1);break;}
}void lift(char lift) {switch (lift) {// room to optimize  !case 0: //850if (servoLift >= LIFT0) {while (servoLift >= LIFT0) {servoLift--;servo1.writeMicroseconds(servoLift);                                delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT0) {servoLift++;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}}break;case 1: //150if (servoLift >= LIFT1) {while (servoLift >= LIFT1) {servoLift--;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT1) {servoLift++;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}}break;case 2:if (servoLift >= LIFT2) {while (servoLift >= LIFT2) {servoLift--;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT2) {servoLift++;servo1.writeMicroseconds(servoLift);                                delayMicroseconds(LIFTSPEED);}}break;}
}void bogenUZS(float bx, float by, float radius, int start, int ende, float sqee) {float inkr = -0.05;float count = 0;do {drawTo(sqee * radius * cos(start + count) + bx,radius * sin(start + count) + by);count += inkr;} while ((start + count) > ende);}void bogenGZS(float bx, float by, float radius, int start, int ende, float sqee) {float inkr = 0.05;float count = 0;do {drawTo(sqee * radius * cos(start + count) + bx,radius * sin(start + count) + by);count += inkr;} while ((start + count) <= ende);
}void drawTo(double pX, double pY) {double dx, dy, c;int i;// dx dy of new pointdx = pX - lastX;dy = pY - lastY;//path lenght in mm, times 4 equals 4 steps per mmc = floor(4 * sqrt(dx * dx + dy * dy));if (c < 1) c = 1;for (i = 0; i <= c; i++) {// draw line point by pointset_XY(lastX + (i * dx / c), lastY + (i * dy / c));}lastX = pX;lastY = pY;
}double return_angle(double a, double b, double c) {// cosine rule for angle between c and areturn acos((a * a + c * c - b * b) / (2 * a * c));
}void set_XY(double Tx, double Ty) 
{delay(1);double dx, dy, c, a1, a2, Hx, Hy;// calculate triangle between pen, servoLeft and arm joint// cartesian dx/dydx = Tx - O1X;dy = Ty - O1Y;// polar lemgth (c) and angle (a1)c = sqrt(dx * dx + dy * dy); // a1 = atan2(dy, dx); //a2 = return_angle(L1, L2, c);servo2.writeMicroseconds(floor(((a2 + a1 - M_PI) * SERVOFAKTORLEFT) + SERVOLEFTNULL));// calculate joinr arm point for triangle of the right servo arma2 = return_angle(L2, L1, c);Hx = Tx + L3 * cos((a1 - a2 + 0.621) + M_PI); //36,5掳Hy = Ty + L3 * sin((a1 - a2 + 0.621) + M_PI);// calculate triangle between pen joint, servoRight and arm jointdx = Hx - O2X;dy = Hy - O2Y;c = sqrt(dx * dx + dy * dy);a1 = atan2(dy, dx);a2 = return_angle(L1, (L2 - L3), c);servo3.writeMicroseconds(floor(((a1 - a2) * SERVOFAKTORRIGHT) + SERVORIGHTNULL));}</span>

如果调试完毕,就可以安装笔擦等附件,开始耍贱了!

标准程序需要时间模块读取时间,如果没有模块,可以修改函数,返回随机数或者从00:00开始计时等办法。

《Plotclock小贱钟程序》


//↓↓↓↓↓↓↓  以下参数在调试程序中调节好后复制过来   ↓↓↓↓↓↓↓//1.先调节0、180度的位置。调节到位后,再调节90度位置
//左右悬臂舵机的 0或180度位置,,数字增加,左侧舵机逆时针调整,右侧舵机顺时针调整
//【此数值可能需要调节】
#define SERVOLEFTNULL 2030  //数值减小,顺时针旋转,加大则逆时针旋转
//【此数值可能需要调节】
#define SERVORIGHTNULL 1100  //数值减小,顺时针旋转,加大则逆时针旋转//2.调节到位0、180,再调节下面参数
//左右悬臂舵机的90度位置,,数字增加,左侧舵机顺时针调整,右侧舵机逆时针调整
//【此数值可能需要调节】
#define SERVOFAKTORLEFT 580 //数值加大,顺时针旋转,减小则逆时针旋转
//【此数值可能需要调节】
#define SERVOFAKTORRIGHT 610  //数值减小,顺时针旋转,加大则逆时针旋转//升举舵机的3个角度 
//【此数值可能需要调节】
#define LIFT0 1620 //落笔写字 on drawing surface
#define LIFT1 1320  //写字时抬臂动作 between numbers
#define LIFT2 580  //高抬笔架  going towards sweeper 
//【此数值可能需要调节】//
//以上参数,请运行调试程序 plotclockadj ,调整好位置后,将数据复制过来
////笔擦的坐标位置,如不能对准笔擦可以微调单位毫米
int  rubberx=72,rubbery=42;   //【此数值可能需要调节】//三只舵机的接口号
#define SERVOPINLIFT  2 //抬臂舵机
#define SERVOPINLEFT  3 //左臂舵机
#define SERVOPINRIGHT 4 //右臂舵机// 速度  数字越小越慢,太快了容易抖 1000~2000
#define LIFTSPEED 1500 // 悬臂的长度,根据图纸测量,无需改变
#define L1 35
#define L2 57.2
#define L3 14.2// 左右舵机轴心的位置,根据图纸测量,无需改变
#define O1X 22
#define O1Y -25
#define O2X 47
#define O2Y -25//需要的库函数 ,如果编译报告 time.h 错误请参考readme文档
#include <Time.h> // see http://playground.arduino.cc/Code/time 
#include <Servo.h>int servoLift = LIFT2;Servo servo1;  // 
Servo servo2;  // 
Servo servo3;  // volatile double lastX = rubberx;
volatile double lastY = rubbery;int last_min = 0;void setup() 
{ // 设置一个模拟时间,(小时,分钟,后面全填0)//如果此句编译错误,请将文件包内的libraries库放到Arduino文件夹内,具体操作办法见说明文档setTime(19,38,0,0,0,0); servo1.attach(SERVOPINLIFT);  //初始化抬臂舵机  lifting servoservo2.attach(SERVOPINLEFT);  //初始化左臂舵机  left servoservo3.attach(SERVOPINRIGHT); //初始化右臂舵机  right servolift(1); //抬笔drawTo(rubberx, rubbery); //停留在笔擦位置delay(1000);} void loop() 
{ int i = 0;//下面代码任选一行,进行不同模式的书写//if (last_min != minute())  //每分钟书写一次时间//if  (1)                  //反复不间断的擦写模式if (1) //如需修改请复制上面代码{if (!servo1.attached()) servo1.attach(SERVOPINLIFT);if (!servo2.attached()) servo2.attach(SERVOPINLEFT);if (!servo3.attached()) servo3.attach(SERVOPINRIGHT);lift(0);hour();while ((i+1)*10 <= hour())  //提取19:38时间部分的第一位,也就是19的1{i++;}number(3, 3, 111, 1);   //擦黑板number(5, 25, i, 0.9);  // 书写19:38的第一位,也就是写1number(19, 25, (hour()-i*10), 0.9); //提取并书写19:38的第二位,也就是写9number(28, 25, 11, 0.9);//书写19:38的点 :i=0;while ((i+1)*10 <= minute()) //提取19:38时间部分的分钟位,也就是38的3{i++;}number(34, 25, i, 0.9);//书写19:38的第四位,也就是3number(48, 25, (minute()-i*10), 0.9);//提取并书写19:38的第五位,也就是8lift(2);drawTo(70, 44);  //移动到70,44lift(1);last_min = minute();servo1.detach();servo2.detach();servo3.detach();}} // Writing numeral with bx by being the bottom left originpoint. Scale 1 equals a 20 mm high font.
// The structure follows this principle: move to first startpoint of the numeral, lift down, draw numeral, lift up
//这里是写字的函数,如果你觉得字写的丑,可以自行修改字体,结果可能是更丑。还可以自行增加其他内容,比如字母甚至是汉字
void number(float bx, float by, int num, float scale) {switch (num) {case 0:drawTo(bx + 12 * scale, by + 6 * scale);lift(0);bogenGZS(bx + 7 * scale, by + 10 * scale, 10 * scale, -0.8, 6.7, 0.5);lift(1);break;case 1:drawTo(bx + 3 * scale, by + 15 * scale);lift(0);drawTo(bx + 10 * scale, by + 20 * scale);drawTo(bx + 10 * scale, by + 0 * scale);lift(1);break;case 2:drawTo(bx + 2 * scale, by + 12 * scale);lift(0);bogenUZS(bx + 8 * scale, by + 14 * scale, 6 * scale, 3, -0.8, 1);drawTo(bx + 1 * scale, by + 0 * scale);drawTo(bx + 12 * scale, by + 0 * scale);lift(1);break;case 3:drawTo(bx + 2 * scale, by + 17 * scale);lift(0);bogenUZS(bx + 5 * scale, by + 15 * scale, 5 * scale, 3, -2, 1);bogenUZS(bx + 5 * scale, by + 5 * scale, 5 * scale, 1.57, -3, 1);lift(1);break;case 4:drawTo(bx + 10 * scale, by + 0 * scale);lift(0);drawTo(bx + 10 * scale, by + 20 * scale);drawTo(bx + 2 * scale, by + 6 * scale);drawTo(bx + 12 * scale, by + 6 * scale);lift(1);break;case 5:drawTo(bx + 2 * scale, by + 5 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 6 * scale, 6 * scale, -2.5, 2, 1);drawTo(bx + 5 * scale, by + 20 * scale);drawTo(bx + 12 * scale, by + 20 * scale);lift(1);break;case 6:drawTo(bx + 2 * scale, by + 10 * scale);lift(0);bogenUZS(bx + 7 * scale, by + 6 * scale, 6 * scale, 2, -4.4, 1);drawTo(bx + 11 * scale, by + 20 * scale);lift(1);break;case 7:drawTo(bx + 2 * scale, by + 20 * scale);lift(0);drawTo(bx + 12 * scale, by + 20 * scale);drawTo(bx + 2 * scale, by + 0);lift(1);break;case 8:drawTo(bx + 5 * scale, by + 10 * scale);lift(0);bogenUZS(bx + 5 * scale, by + 15 * scale, 5 * scale, 4.7, -1.6, 1);bogenGZS(bx + 5 * scale, by + 5 * scale, 5 * scale, -4.7, 2, 1);lift(1);break;case 9:drawTo(bx + 9 * scale, by + 11 * scale);lift(0);bogenUZS(bx + 7 * scale, by + 15 * scale, 5 * scale, 4, -0.5, 1);drawTo(bx + 5 * scale, by + 0);lift(1);break;case 111:lift(0);drawTo(rubberx, rubbery);drawTo(58, 42);drawTo(58, 45);drawTo(2, 45);drawTo(2, 41);drawTo(58, 41);drawTo(60, 37);drawTo(2, 37);drawTo(2, 33);drawTo(60, 33);drawTo(60, 29);drawTo(2, 29);drawTo(2, 25);drawTo(60, 25);drawTo(60, 20);drawTo(2, 20);drawTo(60, rubbery);drawTo(rubberx + 3 , rubbery);lift(2);break;case 11:drawTo(bx + 5 * scale, by + 15 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 15 * scale, 0.1 * scale, 1, -1, 1);lift(1);drawTo(bx + 5 * scale, by + 5 * scale);lift(0);bogenGZS(bx + 5 * scale, by + 5 * scale, 0.1 * scale, 1, -1, 1);lift(1);break;}
}//抬函数,不同的摆臂高度
void lift(char lift) {switch (lift) {// room to optimize  !case 0: if (servoLift >= LIFT0) {while (servoLift >= LIFT0) {servoLift--;servo1.writeMicroseconds(servoLift);                delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT0) {servoLift++;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}}break;case 1: if (servoLift >= LIFT1) {while (servoLift >= LIFT1) {servoLift--;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT1) {servoLift++;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}}break;case 2:if (servoLift >= LIFT2) {while (servoLift >= LIFT2) {servoLift--;servo1.writeMicroseconds(servoLift);delayMicroseconds(LIFTSPEED);}} else {while (servoLift <= LIFT2) {servoLift++;servo1.writeMicroseconds(servoLift);                delayMicroseconds(LIFTSPEED);}}break;}
}//里面似乎有勾股定理?
void bogenUZS(float bx, float by, float radius, int start, int ende, float sqee) {float inkr = -0.05;float count = 0;do {drawTo(sqee * radius * cos(start + count) + bx,radius * sin(start + count) + by);count += inkr;} while ((start + count) > ende);}//cos?sin?
void bogenGZS(float bx, float by, float radius, int start, int ende, float sqee) {float inkr = 0.05;float count = 0;do {drawTo(sqee * radius * cos(start + count) + bx,radius * sin(start + count) + by);count += inkr;} while ((start + count) <= ende);
}void drawTo(double pX, double pY) {double dx, dy, c;int i;// dx dy of new pointdx = pX - lastX;dy = pY - lastY;//path lenght in mm, times 4 equals 4 steps per mmc = floor(4 * sqrt(dx * dx + dy * dy));if (c < 1) c = 1;for (i = 0; i <= c; i++) {// draw line point by pointset_XY(lastX + (i * dx / c), lastY + (i * dy / c));}lastX = pX;lastY = pY;
}double return_angle(double a, double b, double c) {// cosine rule for angle between c and areturn acos((a * a + c * c - b * b) / (2 * a * c));
}//用各种三角函数把位置坐标换算成舵机的角度,具体咋算的,请参考
//Plotclock by joo - Thingiverse
//http://www.thingiverse.com/thing:248009/
void set_XY(double Tx, double Ty) 
{delay(1);double dx, dy, c, a1, a2, Hx, Hy;// calculate triangle between pen, servoLeft and arm joint// cartesian dx/dydx = Tx - O1X;dy = Ty - O1Y;// polar lemgth (c) and angle (a1)c = sqrt(dx * dx + dy * dy); // a1 = atan2(dy, dx); //a2 = return_angle(L1, L2, c);servo2.writeMicroseconds(floor(((a2 + a1 - M_PI) * SERVOFAKTORLEFT) + SERVOLEFTNULL));// calculate joinr arm point for triangle of the right servo arma2 = return_angle(L2, L1, c);Hx = Tx + L3 * cos((a1 - a2 + 0.621) + M_PI); //36,5掳Hy = Ty + L3 * sin((a1 - a2 + 0.621) + M_PI);// calculate triangle between pen joint, servoRight and arm jointdx = Hx - O2X;dy = Hy - O2Y;c = sqrt(dx * dx + dy * dy);a1 = atan2(dy, dx);a2 = return_angle(L1, (L2 - L3), c);servo3.writeMicroseconds(floor(((a1 - a2) * SERVOFAKTORRIGHT) + SERVORIGHTNULL));}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/255335.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【数据库学习】——Python实现mysql数据库SQL文件生成和导入

目录 1、将mysql数据导出到SQL文件中&#xff08;数据库存在的情况&#xff09; 2、将现有的sql文件数据导入到数据库中&#xff08;前提数据库存在&#xff09; 3、利用Navicat导出SQL文件和导入SQL文件 1&#xff09;从数据库导出SQL文件 2&#xff09;导入SQL文件到数据…

【重磅】Google官方推出了免费的、中文的、机器学习初级课程。

2019独角兽企业重金招聘Python工程师标准>>> 机器学习(Machine Learning, ML)是一门多领域交叉学科&#xff0c;涉及概率论、统计学、逼近论、凸分析、算法复杂度理论等多门学科。它是人工智能的核心&#xff0c;是使计算机具有智能的根本途径&#xff0c;其应用遍及…

市面上常见arduino版本比较

http://arduino.cc/en/Main/Products 详细链接 如果是入门&#xff0c;那么首选UNO R3&#xff0c;方便又省心 如果不是特殊要求&#xff0c;不建议购买2560&#xff0c;因为贵啊 nano是块很好的控制器&#xff0c;买不买随你咯 非特殊场合使用不建…

HALCON示例程序autobahn高速公路车道识别程序剖析

HALCON示例程序autobahn高速公路车道识别程序剖析 小哥哥小姐姐觉得有用点个赞呗&#xff01; 示例程序源码&#xff08;加注释&#xff09; *关闭halcon窗口的实时更新 dev_update_window (‘off’) *关闭halcon图形窗口 dev_close_window () *打开图形窗口 *dev_open_win…

CSS中的未定义行为,浏览器的差异(一)

今天看了张鑫旭大佬的新书的有感吧&#xff0c;记录一下。 Web标准未对一些场景做出明确规范&#xff0c;所以各大浏览器厂家只能根据自己的理解和喜好去实现&#xff0c;表现差异不是浏览器的bug&#xff0c;用计算机领域的术语描述为"未定义行为"。 比如一个例子&a…

Atmel megaAVR控制器 串行引导Bootloader

开始研究下Bootloader的代码结构 2015.1.9 粗略看了下&#xff0c;Bootloader主要做了下板卡的初始化 -----> 然后进入for( ; ; )死循环 -----> 循环刷新串口数据 -----> 根据数据做出不同应答 -----> 如果有写数据&#xff0c;则将数据存入buffer …

MapReduce入门2-流量监控

3、流量监控汇总&#xff08;使用LongWritable实现&#xff09; hdfs文件路径&#xff1a;/tmp/flow.txt 查看文件内容&#xff1a; 13770759991 50 100 25 400 13770759991 800 600 500 100 13770759992 400 300 250 1400 13770759992 800 1200 600 900字符串含义&#xff1a;…

【fiddler学习问题记录】——手机端证书下载页打不开、无法将此证书安装(已解决)

目录 1、手机端下载页打不开 解决方法1&#xff09;电脑端——将网络设置成公用&#xff08;亲测有效&#xff09; 解决方法2&#xff09;手机端将fiddler设置为信任应用&#xff0c;不被拦截 &#xff08;未试&#xff09; 2、无法将此证书安装 方法一&#xff1a;修改证书…

舵机的原理和控制

控制信号由接收机的通道进入信号调制芯片&#xff0c;获得直流偏置电压。它内部有一个基准电路&#xff0c;产生周期为20ms&#xff0c;宽度为1.5ms的基准信号&#xff0c;将获得的直流偏置电压与电位器的电压比较&#xff0c;获得电压差输出。最后&#xff0c;电压差的正负输出…

HDFS清理坏块

报错 Failed with exception java.io.IOException:org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-1921057509-192.168.57.129-1517160177567:blk_1073741930_1106 file/user/hive/warehouse/db_hive.db/student/student.txt Time taken: 0.104 se…

如何在PowerDesigner将PDM导出生成WORD文档或者html文件

a) 使用PowerDesigner打开pdm文件 b) 点击Report Temlates 制作模板 点击PowerDesigner菜单栏“Report” -> “Report Templates” c) 选择模板数据项 完成步骤a&#xff09;&#xff0c;得到如下界面&#xff0c;左右2个区&#xff0c;Aavailable区…

【软件测试】——基础篇(软件测试技术体系、过程管理)

目录 软件测试技术体系 软件测试过程管理​编辑 接口测试用例设计 手机端测试流程​编辑 软件测试技术体系 软件测试过程管理 接口测试用例设计 手机端测试流程

小米出招黑科技,5S或成全球首款”Under glass“指纹识别手机

这一次&#xff0c;小米PK苹果&#xff0c;小米胜。 不得不说&#xff0c;最近的手机圈真是热闹&#xff0c;继三星Note 7爆炸、苹果iPhone 7发布一度成为新闻热点之后&#xff0c;小米又来暗戳戳地抢风头了。 最近小米即将发布的两款新旗舰消息扎堆&#xff0c;其中基本已经确…

sql中实现取得某字段中数字值

ALTER function [dbo].[GetNum](a nvarchar(4000)) returns nvarchar(4000) as begin while patindex(%[^0-9]%,a)>0 begin set astuff(a,patindex(%[^0-9]%,a),1,) end--select a --299 return a end 例如: 转载于:https://www.cnblogs.com/fish-ycq/p/6433562.ht…

C语言条件编译及编译预处理阶段

一、C语言由源代码生成的各阶段如下&#xff1a; C源程序&#xff0d;>编译预处理&#xff0d;>编译&#xff0d;>优化程序&#xff0d;>汇编程序&#xff0d;>链接程序&#xff0d;>可执行文件其中 编译预处理阶段&#xff0c;读取c源程序&#xff0c;对其中…

网上书店 买方数据库

买方表 属性 字段名 类型 键值 是否空 用户ID UserId char(5) 主键 用户名称 UserName nvarchar(50) 用户密码 UserPwd nvarchar(50) 用户真实姓名 UserRealName nvarchar(50) 用户地址 UserAddress nvarchar(100) …

Web开发模式(MVC设计模式)

1.MVC&#xff1a;(Model-View-Controller)操作流程 显示层View:主要负责接收Servlet传递的内容&#xff0c;并调用JavaBean把内容显示给用户。 控制层Controller:负责所有的用户请求参数&#xff0c;判断请求参数是否合法&#xff0c;根据请求方式调用JavaBean进行处理&#x…

Arduino IDE 配置文件

最近学习Arduino。 Arduino开源硬件和Arduino IDE是一个很容易上手的系统。 目前arduino已经支持很多种板类型&#xff0c;甚至已经支持了部分arm芯片。比如arduino ng、arduino uno、arduino mini、pro mini等。但是大多数情况&#xff0c;都是使用的atmega8/at…

vue封装axios接口

一、安装axios axios安装命令&#xff1a;cnpm install axios 二、在文件中引用axios 一开始我是放在src下的main.js这个文件里面&#xff0c;后来发现mounted钩子读取接口方法为undefined&#xff0c;百度了才发现是vue生命周期的原因&#xff0c;最好的解决办法是把axios单独…

编写Arduino支持的C++类库

以下为摘抄的例子&#xff0c;已经亲自验证过&#xff0c;例子是正确的 我们在上一讲中实现了一个TN901红外温度传感器51程序到Arduino程序的转换&#xff0c;如果代码越来越多这样程序的可维护性会随之降低&#xff0c;也不适合团度开发。我们应该把常用的文件封装成C库&#…