7 ev3_speaker_set_volume ( 100 ) ;
13 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
15 while ( traceDistance < 1860 ) {
32 connectPosition = connectNumberManager[currentPosition][nextPosition] ;
34 if ( beforePosition == 0x00 ) {
37 beforeConnectPosition = connectNumberManager[beforePosition][currentPosition] ;
38 beforeDegree = allConnectPosition[beforePosition][beforeConnectPosition][
DEGREE] ;
40 nextDegree = allConnectPosition[currentPosition][connectPosition][
DEGREE] ;
43 nextDistance = allConnectPosition[currentPosition][connectPosition][
DISTANCE] + traceDistance ;
45 moveDegree = nextDegree - beforeDegree ;
48 sprintf ( msg,
"Degree> Current:%d,Next:%d", currentDegree, nextDegree ) ;
50 sprintf ( msg,
" Move:%d", moveDegree ) ;
52 sprintf ( msg,
"Position>Current:%d,Next:%d", currentPosition, connectPosition ) ;
54 sprintf ( msg,
"Distance>Next:%ld,Trace:%ld", nextDistance, traceDistance ) ;
57 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
59 for (
int i = 0 ; i < moveDegree ; i++ ) {
60 walker.
run ( 0, ( ( moveDegree * 3 ) / 4 ) * -1 ) ;
66 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
68 while ( traceDistance < nextDistance ) {
77 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
void isLeftsideLine(bool b)
void setForward(int8_t setValue)
void resetDistance(int32_t countL, int32_t countR)
std::int32_t getDistanceCurrent(std::int32_t countL, std::int32_t countR)
void preparatePuzzle(void)
void runLine(int32_t countL, int32_t countR, int8_t light_value)
void setPid(double _p_gain, double _i_gain, double _d_gain, double _target)
void puzzleLineTrace(int8_t, int8_t, int8_t)
void msg_f(const char *str, int32_t line)
std::int32_t getDistanceTotal(std::int32_t countL, std::int32_t countR)
int8_t getBrightness(void) const
void run(int8_t pwm, int8_t turn)
SpeedControl speedControl