Atelier 1
Atelier 1
Atelier 1
Description: This is a LED blinker using the on-board RGB LED and switches in the
// Tiva C Launchpad board. When no switches are pressed, the blue LED stays on. When SW1
// is pressed, the blue and green LEDs will blink. When SW2 is pressed, the red and blue
#include "stdint.h"
#include "C:/Keil_v5/tm4c123gh6pm.h"
// Global Variables
// Function Prototypes
void PortF_Init(void);
void Delay(void);
// 3. Subroutines Section
int main(void){
void PortF_Init(void){
}
void Delay(void){unsigned long volatile time;
while(time){
time--;
#include "stdint.h"
#include "C:/Keil_v5/tm4c123gh6pm.h"
#include "TM4C123.h"
uint32_t i, j;
int main(void) {
while (1) {
#include "stdint.h"
#include "C:/Keil_v5/tm4c123gh6pm.h"
#include "TM4C123.h"
uint32_t i, j;
int main(void) {
while (1) {
} else {
#include <stdint.h>
#include <C:/Keil_v5/inc/tm4c123gh6pm.h>
while(time){
time--;
}
int main(void){
while(1){
Delay();
Delay();
Delay();
Delay();
Delay();
Delay();
// dark --- 0
#include "TM4C123GH6PM.h"
#include <math.h>
#define PI 3.14159265358979323846
int main() {
GPIOF->PUR = SW1_PIN | SW2_PIN; // Enable Pull Up resistor for PF0 and PF4
GPIOF->DIR = BLUE_LED_PIN | RED_LED_PIN | GREEN_LED_PIN; // Set PF1, PF2, PF3 as output pins
while (1) {
// Incrémentez le temps
time += 0.01;
} else {
GPIOF->DATA = GREEN_LED_PIN; // Green LED on
gpiodata = GPIOF->DATA;