L293D is a DC motor controller. Below Arduino code to use it. unsigned char table[128] = {0}; int motor1_A=6; int motor1_B=5; int motor1_Speed=3; void setup() { pinMode(motor1_A,OUTPUT); pinMode(motor1_B,OUTPUT); } void loop() { // motor1 for (int i=0; i<256; i+=1){ digitalWrite(motor1_A,HIGH); // A = HIGH and B = LOW means the motor will turn right digitalWrite(motor1_B,LOW);… Continue reading L293D, H Bridge Arduino
Category: Coding
Crontab on Linux
To launch a program at reboot. contab -e Add following line to crontab file: @reboot sudo python /home/pi/hw-home.py /home/pi/hw-home.txt
Arduino and Python
If you want to read Arduino serial from Python. Install pySerial: pip intall pyserial the code: import serial … print(‘# Arduino Reader – hackweb’) print(‘entering loop…’) ardu = serial.Serial(‘COM3’, 115200) time.sleep(2) while True: print(ardu.readline())