Posts

Showing posts from December, 2022

Arduino Programming

 Hello everybody! Welcome back to my final blog entry for this module which will be Arduino programming!  I have studied Arduino programming for the past 4 weeks and this blog will show my progress. For part 1 of this blog will be focused on input devices. I have learnt to use 2 input devices which are a potentiometer analog input and a light dependent resistor (LDR). For part 2 of this blog will be focused on 2 output devices which are light-emitting diodes (LED) and a push button. Input devices This is the code used to make the potentiometer analog input setup work: Code Explanation int sensorvalue = 0;   void setup() {   pinMode(A0, INPUT);   pinMode(LED_BUILTIN, OUTPUT);   Serial.begin(9600); }   void loop() {   sensorvalue = analogRead(A0);   digitalWrite(LED_BUILTIN, HIGH);   Serial.print(",");   Serial.println(sensorvalue);   delay(sensorvalue); // Wait for sensorvalue millisecond(s)