tcl/tk参考——列表操作lreverse

.

.

名字

lreverse - 反转列表元素的顺序

语法

lreverse list

描述

lreverse命令返回一个列表,列表中的元素和原 list列表相同,但是所有的元素按照从后向前的顺序重新排列。

示例

lreverse {a a b c}
       c b a a
lreverse {a b {c d} e f}
       f e {c d} b a
 
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
是小车自平衡的代码,是arduino的,// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation // is used in I2Cdev.h #include "Wire.h"` /******************************************************/ //UNO pin map int ENA=9; int ENB=11; int IN1=7; int IN2=8; int IN3=10; int IN4=12; int MAS,MBS; /* IMU Data */ double accX, accY, accZ; double gyroX, gyroY, gyroZ; int16_t tempRaw; double gyroXangle, gyroYangle; // Angle calculate using the gyro only double compAngleX, compAngleY; // Calculated angle using a complementary filter double kalAngleX, kalAngleY; // Calculated angle using a Kalman filter uint8_t i2cData[14]; // Buffer for I2C data uint32_t timer; unsigned long lastTime; /***************************************/ double P[2][2] = {{ 1, 0 },{ 0, 1 }}; double Pdot[4] ={ 0,0,0,0}; static const double Q_angle=0.001, Q_gyro=0.003, R_angle=0.5,dtt=0.005,C_0 = 1; double q_bias, angle_err, PCt_0, PCt_1, E, K_0, K_1, t_0, t_1; double angle,angle_dot,aaxdot,aax; double position_dot,position_dot_filter,positiono; /*-------------Encoder---------------*/ #define LF 0 #define RT 1 int Lduration,Rduration; boolean LcoderDir,RcoderDir; const byte encoder0pinA = 2; const byte encoder0pinB = 5; byte encoder0PinALast; const byte encoder1pinA = 3; const byte encoder1pinB = 4; byte encoder1PinALast; int RotationCoder[2]; /*--------------------------------------*/ float k1,k2,k3,k4; //Adjust the PID Parameters int turn_flag=0; float move_flag=0; int pwm; int pwm_R,pwm_L; float range; float range_error_all; float wheel_speed; float last_wheel; float error_a=0; void setup() { // join I2C bus (I2Cdev library doesn't do this automatically) Wire.begin(); // initialize serial communication Serial.begin(9600); //Serial.println("AT+NAMEitead"); //motor contraler pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); pinMode(ENA, OUTPUT); pinMode(ENB, OUTPUT); pinMode(6, OUTPUT);

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值