Skip to content

Commit 4d548d8

Browse files
lenardgeorgelenardgeorge
authored andcommitted
Changes to Folder Structure
1 parent 40eb20b commit 4d548d8

File tree

62 files changed

+156
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+156
-169
lines changed

Core_Module/Examples/Lessons/L4_DigitalInputs&Outputs/L4_Activity2/L4_Activity2.ino

Lines changed: 0 additions & 38 deletions
This file was deleted.

Core_Module/Examples/Lessons/L5_ShowingMessagesOnPC/L5_Activity2/L5_Activity2.ino

Lines changed: 0 additions & 38 deletions
This file was deleted.

Core_Module/library.properties

Lines changed: 0 additions & 9 deletions
This file was deleted.

Core_Module/Examples/Lessons/L3_LetsStartProgramming/L3_Activity3/L3_Activity3.ino renamed to Examples/Lessons/L3_LetsStartProgramming/L3_Activity3/L3_Activity3.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
*/
88

9-
9+
// initialising the pins.
1010
int redLED = 13;
1111
int yellowLED = 12;
1212

@@ -19,11 +19,11 @@ void setup()
1919

2020
void loop()
2121
{
22-
23-
digitalWrite(redLED, HIGH); // turn the LEDs on (HIGH is the voltage level)
22+
// Blink the LEDs.
23+
digitalWrite(redLED, HIGH);
2424
digitalWrite(yellowLED, HIGH);
25-
delay(1000); // wait for a second
26-
digitalWrite(redLED, LOW); // turn the LEDs off by making the voltage LOW
25+
delay(1000);
26+
digitalWrite(redLED, LOW);
2727
digitalWrite(yellowLED, LOW);
28-
delay(1000); // wait for a second
28+
delay(1000);
2929
}

Core_Module/Examples/Lessons/L4_DigitalInputs&Outputs/L4_Activity1/L4_Activity1.ino renamed to Examples/Lessons/L4_DigitalInputs&Outputs/L4_Activity1/L4_Activity1.ino

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,20 @@
55
This sketch is written to accompany Activity 1 in Lesson 04 of the CTC GO! core module
66
*/
77

8-
// pin where the button is connected
8+
// initialising the pins and other variables.
99
int button = 2;
10-
11-
// to save the button state
1210
int button_state = 0;
1311

1412
void setup()
1513
{
16-
// digital pin LED_BUILTIN as output
14+
// Setting up the pins as OUTPUTS & INPUTS.
1715
pinMode(LED_BUILTIN, OUTPUT);
18-
// digital pin button_pin as input
1916
pinMode(button_pin,INPUT);
2017
}
2118

2219
void loop()
2320
{
24-
// saving the button state in a variable
21+
// Saving the button state in a variable
2522
button_state = digitalRead(button_pin);
26-
27-
// changing the LED state
2823
digitalWrite(LED_BUILTIN, button_state);
2924
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
CTC GO! CORE MODULE
3+
LESSON 04 - Digital Inputs & Outputs
4+
5+
This sketch is written to accompany Activity 2 in Lesson 04 of the CTC GO! core module
6+
*/
7+
8+
int button = 2;
9+
int button_state = 0;
10+
11+
void setup()
12+
{
13+
// Setting up the pins as OUTPUTS & INPUTS.
14+
pinMode(LED_BUILTIN, OUTPUT);
15+
pinMode(button_pin,INPUT);
16+
}
17+
18+
void loop()
19+
{
20+
button_state = digitalRead(button_pin);
21+
22+
// if the button is presed, blink the LEDS
23+
if (button_state == HIGH)
24+
{
25+
digitalWrite(LED_BUILTIN, HIGH);
26+
delay(1000);
27+
digitalWrite(LED_BUILTIN, LOW);
28+
delay(1000);
29+
}
30+
else
31+
{
32+
digitalWrite(LED_BUILTIN, LOW);
33+
}
34+
}

Core_Module/Examples/Lessons/L4_DigitalInputs&Outputs/L4_Activity3/L4_Activity3.ino renamed to Examples/Lessons/L4_DigitalInputs&Outputs/L4_Activity3/L4_Activity3.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This sketch is written to accompany Activity 3 in Lesson 04 of the CTC GO! core module
66
*/
77

8-
8+
// initialising the pins and other variables.
99
int greenLED = 11;
1010
int yellowLED = 12;
1111
int redLED = 13;
@@ -22,6 +22,7 @@ void setup()
2222

2323
void loop()
2424
{
25+
// Randomly blink the LEDs
2526
blinkingLED = random(11, 14);
2627

2728
if (blinkingLED == greenLED)

Core_Module/Examples/Lessons/L5_ShowingMessagesOnPC/L5_Activity1/L5_Activity1.ino renamed to Examples/Lessons/L5_ShowingMessagesOnPC/L5_Activity1/L5_Activity1.ino

File renamed without changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
CTC GO! CORE MODULE
3+
LESSON 05 - Showing messages on PC
4+
5+
This sketch is written to accompany Activity 2 in Lesson 05 of the CTC GO! core module
6+
*/
7+
8+
// initialising the pins and other variables.
9+
int button = 2;
10+
int button_state = 0;
11+
int counter = 0;
12+
13+
void setup()
14+
{
15+
Serial.begin(9600);
16+
// Setting up the pins as OUTPUTS.
17+
pinMode(button, INPUT);
18+
}
19+
20+
void loop()
21+
{
22+
button_state = digitalRead(button);
23+
24+
//increase the value of counter one unit when button is pressed
25+
if (button_state == HIGH)
26+
{
27+
counter += 1;
28+
delay(500);
29+
Serial.print("counter value = ");
30+
Serial.println(counter);
31+
32+
//Reset counter when it reaches 100
33+
if (counter == 100)
34+
{
35+
counter = 0;
36+
}
37+
}
38+
}

Core_Module/Examples/Lessons/L6_SendingDataToTheBoard/L6_Activity1/L6_Activity1.ino renamed to Examples/Lessons/L6_SendingDataToTheBoard/L6_Activity1/L6_Activity1.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ void setup()
1616

1717
void loop()
1818
{
19+
// if there are characters available, read and print them
1920
if (Serial.available() > 0)
2021
{
2122
incomingNum = Serial.read();
2223
incomingChar = incomingNum;
2324

24-
Serial.println("Character Code");
25+
Serial.println("Character Code");
2526
Serial.print(incomingChar);
26-
Serial.print(" ");
27+
Serial.print(" ");
2728
Serial.println(incomingNum);
2829
}
2930
}

0 commit comments

Comments
 (0)