<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Modify Light Switch Example on nRF5 Mesh SDK v3.0.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41935/modify-light-switch-example-on-nrf5-mesh-sdk-v3-0-0</link><description>I am a beginner and I need to know how we can further modify the light switch example codes to access gpio pins and get some output from that. 
 I have run the example using nRF Mesh App as the provisioner. 
 I want to code such that when each of the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Jan 2019 13:39:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41935/modify-light-switch-example-on-nrf5-mesh-sdk-v3-0-0" /><item><title>RE: Modify Light Switch Example on nRF5 Mesh SDK v3.0.0</title><link>https://devzone.nordicsemi.com/thread/163450?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 13:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:455e3ea2-0ba1-4c7b-af01-a78e8f0da49e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;This is possible, but it would require some modifications to the example.&lt;/p&gt;
&lt;p&gt;To put it really simple. If you have one server and one client (and one provisioner), the thing that happens when you press one of the buttons on the client DK is that the&amp;nbsp;button_event_handler in the client example&amp;#39;s main.c file is called. If you press button 1, then the set_params.on_off is set to APP_STATE_ON (true), and if you press button 2 it is set to APP_STATE_OFF.&lt;/p&gt;
&lt;p&gt;Now, the on_off_model only contains a bool variable for the state of the on_off model, so you would have to change this model in order to send more than one bit of information. If you replace the generic_onoff_model with a custom model, containing e.g. one byte of information (you can do this by modifying the on_off model), and then change the&amp;nbsp;button_event_handler to send different values, depending on what button that is pressed (make sure to change both the server and client). The different buttons will change the&amp;nbsp;button_number in button_event_handler(uint32_t button_number);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the Server example, the callback function you get when you press the button on the server is the&amp;nbsp;app_onoff_server_set_cb(). Now, when you have changed the model to contain a byte (uint8_t instead of a bool), you can toggle the pins according to this value.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify Light Switch Example on nRF5 Mesh SDK v3.0.0</title><link>https://devzone.nordicsemi.com/thread/163007?ContentTypeID=1</link><pubDate>Wed, 26 Dec 2018 14:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2ea45b8-3f20-4562-9ace-dffa7fcd60a9</guid><dc:creator>BryanGerre</dc:creator><description>&lt;p&gt;Would really like to know this too&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>