Build Your Own AI Assistant Part 1 - Creating the Assistant
116820 Views
Is the new Raspberry Pi AI Kit better than Google Coral?
114678 Views
Control Arduino with Python using Firmata / PyFirmata
87081 Views
How to Map with LiDAR - using a Raspberry Pi Zero 2W, RPLidar and Rviz
57314 Views
Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
53588 Views
Node-Red Automation, MQTT, NodeMCU & MicroPython
52067 Views
SMARS Lab upgrade with PyCharm
Chicken Nugget Piano
Pi Tray - Mini-rack - Part II
Weather Station Display
Pi 10 Inch Mini-rack
Installing and Using DeepSeek-R1:1.5 on a Raspberry Pi with Docker
Mini-Rack 3D Design Tutorial
0h 20m
Using the Raspberry Pi Pico's Built-in Temperature Sensor
0h 24m
Getting Started with SQL
0h 32m
Introduction to the Linux Command Line on Raspberry Pi OS
0h 42m
How to install MicroPython
0h 8m
Wall Drawing Robot Tutorial
0h 22m
Learn Linux from the basics to advanced topics.
Learn how to use a Raspberry Pi Pico
Learn MicroPython the best language for MicroControllers
Learn Docker, the leading containerization platform. Docker is used to build, ship, and run applications in a consistent and reliable manner, making it a popular choice for DevOps and cloud-native development.
Learn how to build SMARS robots, starting with the 3D Printing the model, Designing SMARS and Programming SMARS
Learn how to build robots, starting with the basics, then move on to learning Python and MicroPython for microcontrollers, finally learn how to make things with Fusion 360.
Learn Python, the most popular programming language in the world. Python is used in many different areas, including Web Development, Data Science, Machine Learning, Robotics and more.
Learn how to create robots in 3D, using Fusion 360 and FreeCAD. The models can be printed out using a 3d printer and then assembled into a physical robot.
Learn how to create Databases in Python, with SQLite3 and Redis.
KevsRobots Learning Platform
84% Percent Complete
By Kevin McAleer, 3 Minutes
Below is a sample program to control your SMARS with an additional Bluetooth module.
// SMARS Bluetooth remote control // Kevin McAleer // April 2019 // May 2019 - added buzzer feature // Requires a Fundomoto sheild //int ch_A_Brake = 9; //int ch_B_Brake = 8; int ch_A_Direction = 12; int ch_B_Direction = 13; int ch_A_speed = 10; int ch_B_speed = 11; char state = 0; int delaylength = 1000; int buzzerPin = 4; void setup() { // put your setup code here, to run once: Serial.begin(9600, SERIAL_8N1); Serial.println("SMARSFan OS 1.1"); Serial.println("---------------"); // establish motor direction toggle pins pinMode(ch_A_Direction, OUTPUT); pinMode(ch_B_Direction, OUTPUT); // establish motor brake pins // pinMode(ch_A_Brake, OUTPUT); // pinMode(ch_B_Brake, OUTPUT); } void buzz(){ digitalWrite(buzzerPin, HIGH); delay(delaylength / 2); digitalWrite(buzzerPin, LOW); } void forward() { // Move Forward digitalWrite(ch_A_Direction, LOW); // set direction to forward digitalWrite(ch_B_Direction, HIGH); // set direction to forward analogWrite(ch_A_speed, 255); // full speed ahead analogWrite(ch_B_speed, 255); // full speed ahead delay(delaylength); analogWrite(ch_A_speed, 0); // stop analogWrite(ch_B_speed, 0); // stop // Serial.flush(); } void backward() { // Move Backward digitalWrite(ch_A_Direction, HIGH); // set direction to backward digitalWrite(ch_B_Direction, LOW); // set direction to backward analogWrite(ch_A_speed, 255); // full speed ahead analogWrite(ch_B_speed, 255); // full speed ahead delay(delaylength); analogWrite(ch_A_speed, 0); // stop analogWrite(ch_B_speed, 0); // stop // Serial.flush(); } void left() { // Move left digitalWrite(ch_A_Direction, HIGH); // set direction to left digitalWrite(ch_B_Direction, HIGH); // set direction to left analogWrite(ch_A_speed, 255); // full speed ahead analogWrite(ch_B_speed, 255); // full speed ahead delay(delaylength); analogWrite(ch_A_speed, 0); // stop analogWrite(ch_B_speed, 0); // stop // Serial.flush(); } void right() { // Move right digitalWrite(ch_A_Direction, LOW); // set direction to right digitalWrite(ch_B_Direction, LOW); // set direction to right analogWrite(ch_A_speed, 255); // full speed ahead analogWrite(ch_B_speed, 255); // full speed ahead delay(delaylength); analogWrite(ch_A_speed, 0); // stop analogWrite(ch_B_speed, 0); // stop // Serial.flush(); } void fullstop() { // stop! digitalWrite(ch_A_Direction, HIGH); // set direction to right digitalWrite(ch_B_Direction, HIGH); // set direction to right analogWrite(ch_A_speed, 0); // full speed ahead analogWrite(ch_B_speed, 0); // full speed ahead delay(delaylength); // Serial.flush(); } void loop() { // put your main code here, to run repeatedly: if (Serial.available() > 0 ) { state = Serial.read(); Serial.println(state); if (state == 'u') { Serial.println("MOTORS: UP"); forward(); // move forward state = 0; } else if (state == 'd') { Serial.println("MOTORS: DOWN"); backward(); state = 0; } else if (state == 'l') { Serial.println("MOTORS: LEFT"); left(); state = 0; } else if (state == 'r') { Serial.println("MOTORS: RIGHT"); right(); state = 0; } else if (state == "s") { Serial.println("MOTORS: STOP"); fullstop(); state = 0; else if (state == 'b') { Serial.println("Buzzer: Sound") buzz() state = 0; } } } }
< Previous Next >