Sending custom commands to another Jewelbot


#1

I see that you can push a button and send a message to another Jewelbot. Is that function available for programming as well? For instance, if user A pushes the button, then user B has a specific color light show up (or any combination that you choose to program).

Thx,
L


#2

No! Not yet. This is on our list of things to build, however.


#3

Cool, thanks for the quick reply!


#4

I would be interested in this as well.
Is there an “easy” way to extend/customize the code at https://github.com/Jewelbots/ to extend the send/receive functions ?
Thx.
m


#5

maybe answering my own question here
https://github.com/Jewelbots/arduino-friendship/blob/master/jewelbots_friendship_v119/cores/Jewelbot_v1/Jewelbots_src/messaging.c play_message() seems to be a good place to modify. Now I just need to find out how to build and upload any modification to the file.


#6

I can show you! Want to do a skype session and work on it together? I would love that!!


#7

Thanx so much for the offer. I guess time-zone difference and work-schedule might make the skype-call difficult. Maybe I could direct message you with some detailed questions? Thank for your help.


#8

That sounds great! Talk soon.


#9

Not sure if I sent the email to the correct address (just replied the notification email from the forum) …but anyway I seem to understand a bit more now how things are layed out.
This is my current understanding (please correct me if I am wrong).

After installing all the boards using the Arduino IDE you get the following 3 main.cpp files
packages\Jewelbots_Firmware_Update\hardware\JWBFirmware\1.1.6\cores\Jewelbot_v1\main.cpp
packages\Jewelbots_Friendship_Library\hardware\Jewelbot_v1\1.2.0\cores\Jewelbot_v1\Jewelbots_src\main.cpp
packages\Jewelbots_Arduino_Library\hardware\nRF51822\1.1.4\cores\JWB_nRF51822\ble-nrf51822-master\source\main.cpp
which provides the start-entry points for solo-coding, friendship-coding and “out-of-the box messaging”.
Functions provided in the *.ino will be called directly or indirectly from the above main.cpp files.

So I assume if I want to modify anything then just changing the code in either
packages\Jewelbots_Firmware_Update
packages\Jewelbots_Friendship_Library
packages\Jewelbots_Arduino_Library
causes the Arduino IDE to cross-compile the changes before it uploads it onto the Jewelbot - right ?
Or is there an extra step required? I assume some of the code is shared between those 3 modes (like messaging.c)?
Do I need to rebuild JWB_update_1_1_6a.zip as well somehow (not sure about what those zip’s actually contain)?

The content of main.cpp for \Jewelbots_Firmware_Update and Jewelbots_Friendship_Library makes sense to me
but the “Firmware”-one just seems to be
int attribute ((weak)) main( void )
{
setup();

while(1)
{
    loop();
}
return 0;

}

Does this mean I could still implement setup() and loop() when I do “Firmware Update” (I thought that it needed to be empty). Given that main() is stuck in that loop() all the time how is the “checking if friends are near” etc implemented in this case. Is there a timer event that causes the arduino to check ? The friendship main.cpp has all kind of setup/state-machine code in it but I could not find if a similar thing is happening when using “Firmware Update” …

Thanx so much for your help (sorry for so many questions)


#10

I didn’t get your email, I’m glad you posted in the forum! My personal email is sara at Jewelbots so feel free to reach out to me there whenever.

Yes, if you update those files (on my machine, those files live in a Library folder), the Arduino IDE will cross compile before the upload.

The two libraries we maintain are the Friendship Library and the Arduino library. The Firmware Update library should be phased out soon so you can feel free to ignore that one.

No need to rebuild the zip files. The changes you make in those folders will be reflected in the code that gets uploaded to the Jewelbots, if that makes sense.


#11

Hi Sara,
Thank you so much for your help.That all makes sense now. I think I have everything
I need to get started.

Kindest regards