BC-USB-Kit/Tutorials/Tutorial3
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
]
Start:
[[labs.beatcraft.com]]~
[[BC-USB-Kit]]~
[[BC-USB-Kit/Tutorials]]~
#contents
*Tutorial3 [#if0b38d3]
** Making a breadboard useful [#l14661ea]
>
Create a simple electronic circuit, using a breadboard. T...
** Preparation [#k805ccce]
>
- Breadboard~
You can use any breadboard, and you can purchase breadboa...
In this article, the breadboard shown in the picture belo...
~
&ref(T3_BB.jpg,,60%);~
>
-Cable~
This cable is used for connecting PICKit 3 to the breadbo...
Please read [[BC-USB-Kit Manual:http://labs.beatcraft.com...
On BC-USB-Kit, the pin headers from #1 to #5 at J1 are id...
(J2 is located at the opposite end of the USB connector.)~
~
&ref(T3_cable.jpg,,45%); &ref(T3_PK.jpg,,45%);~
>
-Other parts~
An LED, a resistor, and a cable~
** Creating a simple electronic circuit [#fe9400f2]
>
The outputs from GPIO controll the tuning-on/off of the L...
RA0, the 23rd-pin at J1, is used.~
The 14th-pin at J1 is used as GND since the location of t...
Please accordingly set the LED, resistor, and cable in th...
Please be careful with the direction of the LED as you ar...
The longer leg of LED is attached to BC-USB-Kit.~
~
&ref(T3_LED.jpg,,60%);~
** Preparation of the software [#d6068e1f]
>
This is the contents of "main.c."~
~
#include <stdio.h>
#include <stdlib.h>
#include <system.h>
#define LED_ON_BB LATAbits.LATA0
#define LED_TRIS_ON_BB TRISAbits.TRISA0
int main(int argc, char** argv) {
int onboard = 0;
SYSTEM_Initialize(SYSTEM_STATE_START);
LED_TRIS_ON_BB = 0;
while (1){
if (onboard>0){
LED_Off(LED_D1);
LED_ON_BB = 1;
}else{
LED_ON_BB = 0;
LED_On(LED_D1);
}
if ( BUTTON_IsPressed(BUTTON_S1) ){
onboard =! onboard;
}
}
return (EXIT_SUCCESS);
}
>
To learn programming, please do not try to memorize whole...
In this code, the critical part is that initially TRISAbi...
The other important part is that when LATAbits.LATA0 is s...
** Testing [#sbb7eabe]
>
If there are no problems, each time you press the user pr...
~
#youtube(qxkAiS78NXs);~
** Revision History [#yacd37f1]
>
- 2015-04-21 This article is initially published.~
End:
[[labs.beatcraft.com]]~
[[BC-USB-Kit]]~
[[BC-USB-Kit/Tutorials]]~
#contents
*Tutorial3 [#if0b38d3]
** Making a breadboard useful [#l14661ea]
>
Create a simple electronic circuit, using a breadboard. T...
** Preparation [#k805ccce]
>
- Breadboard~
You can use any breadboard, and you can purchase breadboa...
In this article, the breadboard shown in the picture belo...
~
&ref(T3_BB.jpg,,60%);~
>
-Cable~
This cable is used for connecting PICKit 3 to the breadbo...
Please read [[BC-USB-Kit Manual:http://labs.beatcraft.com...
On BC-USB-Kit, the pin headers from #1 to #5 at J1 are id...
(J2 is located at the opposite end of the USB connector.)~
~
&ref(T3_cable.jpg,,45%); &ref(T3_PK.jpg,,45%);~
>
-Other parts~
An LED, a resistor, and a cable~
** Creating a simple electronic circuit [#fe9400f2]
>
The outputs from GPIO controll the tuning-on/off of the L...
RA0, the 23rd-pin at J1, is used.~
The 14th-pin at J1 is used as GND since the location of t...
Please accordingly set the LED, resistor, and cable in th...
Please be careful with the direction of the LED as you ar...
The longer leg of LED is attached to BC-USB-Kit.~
~
&ref(T3_LED.jpg,,60%);~
** Preparation of the software [#d6068e1f]
>
This is the contents of "main.c."~
~
#include <stdio.h>
#include <stdlib.h>
#include <system.h>
#define LED_ON_BB LATAbits.LATA0
#define LED_TRIS_ON_BB TRISAbits.TRISA0
int main(int argc, char** argv) {
int onboard = 0;
SYSTEM_Initialize(SYSTEM_STATE_START);
LED_TRIS_ON_BB = 0;
while (1){
if (onboard>0){
LED_Off(LED_D1);
LED_ON_BB = 1;
}else{
LED_ON_BB = 0;
LED_On(LED_D1);
}
if ( BUTTON_IsPressed(BUTTON_S1) ){
onboard =! onboard;
}
}
return (EXIT_SUCCESS);
}
>
To learn programming, please do not try to memorize whole...
In this code, the critical part is that initially TRISAbi...
The other important part is that when LATAbits.LATA0 is s...
** Testing [#sbb7eabe]
>
If there are no problems, each time you press the user pr...
~
#youtube(qxkAiS78NXs);~
** Revision History [#yacd37f1]
>
- 2015-04-21 This article is initially published.~
Page: