Smartibot - function reset() - should it restore josytick control from APP #7353
Replies: 1 comment
-
Posted at 2020-03-05 by Robin Wed 2020.03.04 I have no experience with SmartiBot nor dpad. Hello Steve @user104966 and thank you for posting your code block.
It would be nice to understand what details were attempted to be conveyed. Please post link so that we may follow with that understanding.
Again, please post the referenced web link.
Looking over the code module I find neither a load() function or an onInit() function.
Am I to conclude that
It might be, as it isn't entirely clear what is to be attempted at this point. If the intent is to wipe out memory then
There isn't a reference to the reset() function and either button functions. Is it possible that ALL the code is not in the attached file? Posted at 2020-03-05 by @gfwilliams I could be wrong here, but I think that when the app connects it runs some magic command on the Smartibot (it may just end up being You'd have to ask Smartibot what the actual command is (or maybe disconnect the app, open the web IDE, and try using up-arrow to look back in the command history). Either way if you ran I guess looking at what you're doing, just calling Posted at 2020-03-05 by user104966 ok, thanks for comment, I will expand. All of the code loaded on the smartibot is in the attachment. The smartibot comes with an android or Iphone App which has some pre-defined panels. As a default, when the smartibot is connected to the App it is possible to control the motors using a D-pad . Lets call them Auto and Manual. On the App it is possible to execute a command when a button is pressed and released. So the code attached on the original post has been downloaded to flash but it does not automatically run when the smartibot is powered up. I am trying to use the smartibot as follows: switch on the smartibot and connect to the app. Press the manual button on the app and it sends text "stopWallAvoid()", the smartibot now stops moving. So based on the definition of reset, extract below. I expected the D-PAD to work. Am I correct in that assumption? I hope this explains what I was trying to do, there is no need to look at the reddit group, that is where it was suggested to call load() and wallAvoid from a button press. Based on that suggestion which worked I added the code for stopWallAvoid and reset. As I am about to hit post I have realised a work around, add my own functions for forwards, backwards , left , right and call them when the D-pad on the phone is used. Thanks for the response, I will add more detail next time and post links, Posted at 2020-03-11 by @gfwilliams As I'd mentioned above, you don't want to call reset:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-03-04 by user104966
Background, there are alot more details on the Redditt sub-group, not sure of the best pace to post this.
So, I have downloaded modified wall avoidance software from the web, it does not run automatically.
Taking advice I have modified a panel on the app so that :
Button 1 on the app when pressed calls load()
when released calls wallAvoidance()
Button 2 on the app when pressed calls a function to stop wallAvoidance and stop both motors
when released calls reset()
So on power up I connect from the app and I can control the smartibot using the dpad.
When I press and release Button 1 on the app it starts wall avoidance.
When I press and release Button 2 on the app, wall avoidance terminates and the motors stop.
At this point because the RAM has been cleared I expected to be able to take control from the dpad, this does not happen.
I can however toggle between wall avoidance and not be using buttons 1 and 2 on the app.
Is there some other function I should use?
Have I misunderstood what reset() does?
Or have I found a feature in the firmware?
I would like to sort it because it means I can demonstrate the robot in schools and exhibitions by switching between the two modes from my phone.
Steve Gale
Here is the code for the smartibot itself
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions