⌚SB Watch 2
⌚SB Watch 2
🚚 Free fedex shipping from 97 $
🌎 WORLDWIDE SHIPPING for 25 $
Search
Close this search box.

SB Watch

About SB Watch Support

The SB Watch support of Atom remote in MagiScript allows developers to connect your SB Watch to Atom, and control the watch using commands. All SB Watch models are supported, including the Steel and Pocket models. Please note that Steel’s Bluetooth range is shorter compared to the other models because of the stainless steel material we have used, so the connection might be not reliable. You can:

set the time

reset the time to the current time

turn accelerometer reporting on/off,

receive button events.

Connecting To Your SB Watch

To connect Atom to an SB Watch, you need to use the sbwatch.connect method. The method takes a single argument, which is the ID of the SB Watch you want to connect to.

For example, to connect to an SB Watch with the ID “SBWatch-166666”, you would use the following command:

				
					sbwatch.connect('SBWatch-166666');
				
			

If Atom is not yet connected to an SB Watch, it will start searching for it, then connect. If an SB Watch is already connected, this command will be ignored. You can use “*” to connect to any SB Watch.

The best way to connect is by adding this call to the beginning of the main function, which runs when the code is loaded.

				
					function main() {
  sbwatch.connect('SBWatch-166666');
  // ...
}
				
			

If Atom is not yet connected to a PeekSmith device, it will start searching for it and then connect. If a PeekSmith device is already connected, this command will be ignored (even if it is a different device). You can use the '*' character to connect to any available PeekSmith device.

The best way to connect is by adding this call to the beginning of the main function, which runs when the code is loaded.

 

				
					function main() {
  ps.connect('PeekSmith-036666');
  // ...
}
				
			

Displaying Text on PeekSmith Screen

Once you have connected to a PeekSmith device, you can display text on its screen using the ps.print method. The method takes a single argument, which is the text that you want to display on the screen. If PeekSmith is not yet connected, MagiScript will collect your messages and send them as soon as a device is connected.

For example, if you want to display the text “Hello World” on the PeekSmith screen, you can use the following code:

 

				
					ps.print('Hello World');
				
			

This will display the text “Hello World” on the PeekSmith screen.

Using PeekSmith’s “Smart Text”, you can display cards or colors on the screen like sending messages:

 

				
					ps.print('AH');        // displays an Ace of Heart
ps.print('7D KS');     // seven of diamonds, king of spades
ps.pring('star');      // displays a star ESP sign
ps.print('yellow');    // displays a yellow card
				
			

Setting the current time on the SB Watch
You can use the sbwatch.setCurrentTime() command to set the current time on the SB Watch. This will update the watch to display the current time according to the system clock of the SB Watch. To use this command, simply call it with no arguments, like this:

				
					sbwatch.setCurrentTime();
				
			

Accelerometer Data (since firmware v1.1.31)

 

SB Watch has an accelerometer, and Atom can turn it on or off. When turned on, the accelerometer will start reporting raw x, y, and z data.

 

Accelerometer ON

 

There are more ways to turn on the accelerometer, but they have the same effect:

				
					ps.accel('on'); // please note that ON or On will not work
ps.accel(true);
				
			

Accelerometer OFF

Turning off the accelerometer is similar:

 

				
					ps.accel('off'); // please note that OFF or Off will not work
ps.accel(false);
				
			

Accelerometer Data

 

You will start receiving events with XYZ data when you turn on the accelerometer via the onEvent function. The value is going to be comma-separated numbers, the type ‘xyz’, and the source ‘ps::accel’.

 

Example

 

Here’s an example code of how you can use them:

				
					function main() {
  sbwatch.connect('SBWatch-155309');
  sbwatch.accel('on');
}

function onEvent(value, type, source) {
  if (type === 'xyz' && source === 'sbwatch:accel') {
    let xyz = strSplit(value, ',');
    let x = parseInt(xyz[0]);
    let y = parseInt(xyz[1]);
    let z = parseInt(xyz[2]);
    console.log(x, y, z);
  }
}
				
			

Receiving Button Events

When an SB Watch is connected, it will start sending button press and release events of the crown. You can process them with the onEvent function.

Read our Buttons documentation page for more details.

Conclusion

The SB Watch support of Atom remote in MagiScript provides a convenient way for developers to connect their SB Watch to Atom and control its functions. By following the steps outlined in this documentation, you can easily connect to your SB Watch and set its time using MagiScript.