Ron is de creator of M5ez :-) Did you go to the GitHub page of M5ez already? Maybe I can help, could you post some of your code?
Posts made by percramer
-
RE: Was excited about this until trying it.
-
GO Plus motor shield source code
Hi,
i have been testing some of the functions of the Goplus module and I must say that the source for the Atmel processor looks a bit strange to me (as does the test / sample for in the M5Stack Core module). If I look at the source for the go plus it declares an array :
const int HubPort[6] = {A0,5,A1,6,A2,7};
This is basically for the 3 hub ports. Which each have a analog input and a digital one. If I look at the schematics this is all just fine. A0 & 5 are both for hub connector 1, etc, etc. But if I then look at the code there is a large switch statement when data is send to the go plus. In the sample program the do the following:
M5.Lcd.fillScreen(BLACK);
adInValue[0] = hub1_d_read_value((uint8_t)6);
delay(50);
//M5.Lcd.Fill(0, 30 * i, 1);
M5.Lcd.setCursor(0, 30 * 0, 1);
M5.Lcd.print(adInValue[0]);adInValue[1] = hub1_d_read_value((uint8_t)7); delay(50); //M5.Lcd.Fill(0, 30 * i, 1); M5.Lcd.setCursor(0, 30 * 1, 1); M5.Lcd.print(adInValue[1]);
Which is the proccessed in the Goplus with :
case 6: pinMode(HubPort[0],INPUT_PULLUP); adInValue[0] = analogRead(HubPort[0]); break; case 7: pinMode(HubPort[1],INPUT_PULLUP); adInValue[1] = analogRead(HubPort[1]); break;
And it seems to want to acces the correct inputs (HubPort[0] and HubPort[1], but that HubPort[1] isn't an analog input, so how can it do an analog read on that?
and there are more things in the sample program (and the go plus source) that don't seem to add up. Is the code correct or just a wrong version? I know the original programmer left M5Stack, so could the code be wrong?
-
RE: Was excited about this until trying it.
I have just started using it a few weeks ago, so it takes a little getting used to. And it does has it flaws, but Ron is quite helpful. If you have got things that need to be checked periodically and buttons are shown then it is better to add events. I also do that for my mqtt code for example. You can add events by using :
void ez.addEvent(uint16_t (*function)(), uint32_t when = 1)
I don't know if this is needed for the faces keyboards also though... I am still looking for a good way to handle user input (if longer input is needed and the keys are a bit to hard to do that).
-
GO Plus motor stop
Hi all,
is the code in
https://github.com/m5stack/GoPlus/blob/master/src/src.ino
The actual code that it is shipped with? Apart from the fact that it is a bit of a mess, if i read it right then the dc motors should stop if you send a speed of 0
//duty_motor_num = motor_num;
if(motor_speed == 0){
if(motor_num == 0){digitalWrite(IN_0, 0); digitalWrite(IN_1, 0); duty_trun0 = trun; duty_speed0 = motor_speed; //MsTimer2::stop(); //time_flag = 0; duty0 = 0; duty_motor_0_flag = 0; //analogWrite(IN_0, 0); //analogWrite(IN_1, 0); }else if(motor_num == 2) { // digitalWrite(IN_2, 0); //digitalWrite(IN_3, 0); digitalWrite(IN_2, 0); digitalWrite(IN_3, 0); duty_trun1 = trun; duty_speed1 = motor_speed; //MsTimer2::stop(); //time_flag = 0; duty1 = 0; duty_motor_1_flag = 0; // analogWrite(IN_2, 0); // analogWrite(IN_3, 0); }
}
it seems like it shoudl first check if the motor speed is 0 and if that is true then check which motor is send. And if the motorspeed <> 0 then it should look at the direction etc.
But the motor never seems to stop... Can anybody confirm that this is a true?