6.3 Graph Example Code

To demonstrate how to use the Graph module an example with a Night mode switch will be used. An ATmega256RFR2 Xplained Pro with an I/O1 Xplained Pro extension is suitable as target hardware. The I/O1 extension board features a light sensor that can be used to detect whether it is night or day. This information can be used, for example, to switch a lamp on when the surroundings turn dark.

The example requires the following equipment and software:
  • Host computer with Atmel Studio 7 or later installed (Data Visualizer is included)
  • ATmega256RFR2 Xplained Pro kit
  • I/O1 Xplained Pro extension
To run the example, the following hardware setup is required:
  • I/O1 Xplained Pro extension connected to ATmega256RFR2 Xplained Pro EXT1 connector
  • USB cable connected from host computer to ATmega256RFR2 Xplained Pro
A picture of the setup is shown below.