-
Notifications
You must be signed in to change notification settings - Fork 4
Testing the Examples
- Introduction
- Turning ON LEDs
- Testing in another boards
The iceK collection includes some examples for testing the blocks with different boards. These examples can also be used for testing the boards with icestudio, as the examples are very simple. Therefore, if it is the first time you are using icestudio with you board these examples could be a good starting point
Constant are very important! Specially the bit constant! With them we can create our first "hello world" circuit for turning on LEDs!
Examples on how to use constants for turning LEDs on and off
Examples for the Alhambra II Board
- File: 01-One-LED.ice
The LED 0 is turned on
- Result:
- File: 02-Two-LEDs.ice
The LEDs 0 and 1 are turned on
- Result:
Examples for the iceStick Board
- File: 01-One-LED.ice
- Result: The LED D1 (red) is turned on
- File: 02-Two-LEDs.ice
- Result: The LEDs D1 and D2 are turned on
- File: 01-One-LED.ice
- Result: The LED is turned on
The LEDs G and R of the iceBreaker board work with negative logic. The constant 0 is used for turning the LED on and the constant 1 por turning it off
- File: 01-One-LED.ice
- Result: The LED is turned on
- File: 02-Two-LEDs.ice
- Result: The LEDs G and R are turned on
- File: 01-One-LED.ice
- Result: The LED D1 (green) is turned on
- File: 02-Two-LEDs.ice
- Result: The LEDs D1 and D2 are turned on
- File: 01-One-LED.ice
- Result: The LED0 is turned on
- File: 02-Two-LEDs.ice
- Result: The LEDs 0 and 1 are turned on
- File: 01-One-LED.ice
- Result: The LED1 (blue) is turned on
- File: 02-Two-LEDs.ice
- Result: The LED1 (blue) and LED2 (green) are turned on
- File: 01-One-LED.ice
- Result: The LED0 (D9) is turned on
- File: 02-Two-LEDs.ice
- Result: The LED0 (D9) and LED1 (D8) are turned on
- File: 01-One-LED.ice
For turning the RGB LED the red component should be activated and the green and blue components deactivated. As the RGB led works with negative logic, a 0 bit should be placed on the Red output, and a 1 bit on the Green and Blue outputs
- Result: The RGB LED is turned red
- File: 02-Two-LEDs.ice
- Result: The RGB LED is turned yellow because the red and green components are activated
- File: 01-One-LED.ice
- Result: The LED0 (D0) is turned on
- File: 02-Two-LEDs.ice
- Result: The LEDs 0 and 1 (D0 and D1) are turned on
For turning the RGB LED Green, the green component should be activated and the red and blue components deactivated. As the RGB led works with negative logic, a 0 bit should be placed on the Gree output, and a 1 bit on the Red and Blue outputs
Also the USB signals should be set to "0"
- File: 01-One-LED.ice
- Result: The RBG LED turns green
- File: 02-Two-LEDs.ice
- Result:
- File: 01-One-LED.ice
For turning the RGB LED Red, the red component should be activated and the Green and blue components deactivated. As the RGB led works with negative logic, a 0 bit should be placed on the red output, and a 1 bit on the Green and Blue outputs
- Result: The RGB LED is turned red
- File: 02-Two-LEDs.ice
- Result: The RGB LED turns magenta
If you want to test the examples in another boards not mentioned here, but supported in Icestudio just follow these steps:
- Select your board from the Select/Board menu
- Make sure the iceK collection is installed and selected in Icestudio
- Choose an example for another board from the File/Examples/01-Turn-on-LEDs menu
- A pop up window will be shown asking you to load the example for board it was designed or convert it to the one you have selected. Click on convert. In this example, the current selected board is UPDuino v.3.0, and the examples opened was designed for the Alhambra II board:
- The example is open BUT the output pins will be in blank, with the name NULL or with an aleatory chosen pin. This means that you have to select first which pins you want to use in your board (every board has different pins, so sometimes it is not possible to automatically convert from one board to another). It should be done manually by the user
- If you do not select the pins, an error message will be shown. It is encouraged to always select manually the pins, for the safe side