Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


In-Depth Series

Arduino and related devices

In this series various contributors talk about how to use and program Arduino single-board microcontrollers and related devices.
See the Wikipedia article https://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems for details of the range of devices.

Kickstarter Omega2 Plus first time setup walkthrough - Jrullo | 2017-01-27

I paid for one Omega2 Plus Kickstarter pledge. Later, as most do, the project offers upgrades. My pack was for one Omega2 plus, an OLED module, and the expansion board. After pledging I then added on another Omega2, a GPS module and a mini expansion board. Review wise, this is a good inexpensive IOT kit for any beginner. Someone that is more advanced can get into Arduino, or ESP8266 with microPython.

I mention Arduino and ESP8266 with microPython.

Really good tutorials on how to get going with microPython:


Arduino Pumpkin - droops | 2015-11-25

Code for Pumpkin

int ledPin1 = 5;
int ledPin2 = 6;
int motorPin = 8;
int lightPin = 3;
int lightVal;
int potPin = 0;
int potVal;

void setup(){
  Serial.begin(9600);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(motorPin, OUTPUT);
  pinMode(potPin, INPUT);
  pinMode(lightPin, INPUT);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  digitalWrite(motorPin, LOW);
}

void loop(){
  potVal = analogRead(potPin);
  lightVal = analogRead(lightPin);
  Serial.println(lightVal);
  if (lightVal < potVal){
    animate();
  }
}

void animate(){
  digitalWrite(ledPin1, HIGH);
  digitalWrite(ledPin2, HIGH);
  digitalWrite(motorPin, HIGH);
  delay(100);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  digitalWrite(motorPin, LOW);
}

Arduino Bluetooth HOWTO - klaatu | 2015-10-16

Klaatu talks about the HC-05 and -06 series of bluetooth modules and how to use them with an Arduino, including some basic code on the Arduino to get it to respond to signals over bluetooth, and some basic PyQt code on how to send signals to the bluetooth device. PLUS, he talks about configuring the bluetooth so that it is connected to the serial port of your system (so that Python can use it).

A super basic bluetooth controller app can be found here: https://gitlab.com/makerbox/rovcon (it's Klaatu's code, and it's not quite finished, so if you have improvements or questions, feel free to comment or merge or email)


Arduino 101 Arduino IO - klaatu | 2015-01-26

In this two-part series, Klaatu introduces you to the Arduino. First, learn about the breadboard and how to make electricity course through it in order to power your very own simple circuit.

To follow along with what Klaatu is talking about, refer to these two graphics:

And here are diagrams of the simple circuits that Klaatu constructs.

image: a diagramme of the simple circuit in todays show

The simple code to reset the servo:

#include <Servo.h>
Servo myservo;

int servoPosition;

void setup()
{
  myservo.attach(13);
  myservo.write(90);
}

void loop() {}

And the code that responds to input:

#include <Servo.h>
Servo myservo; 

int servoPosition;
int servoMax = 180;
int servoMin = 0;

int value;
int valMax = 600;
int valMin = 50;


void setup()
{
  myservo.attach(13);
}

void loop() 
{
  value = analogRead(0);
  servoPosition = map(value, valMin, valMax, servoMax, servoMin);
  servoPosition = constrain(servoPosition, servoMin, servoMax);
  myservo.write(servoPosition);
}

And here is a bonus diagramme that you can try to create, using a light sensor, servo, and resistor.

image: homework

Arduino 101 Breadboard - klaatu | 2015-01-23

In this two-part series, Klaatu introduces you to the Arduino. First, learn about the breadboard and how to make electricity course through it in order to power your very own simple circuit.

To follow along with what Klaatu is talking about, refer to these two graphics:

And here are diagrams of the simple circuits that Klaatu constructs.

image: a diagram of the simplest circuit in todays show

image: a diagram of the switched circuit in todays show