My robot have a mouth now

The sequence is : Happy, Not happy, speechless, and talking .

I've made a sketch , solder it on a prototyping board and ... oh ! it work lol

The IC is a 74HC595 shift register and all resisors are 630 ohms ( More than the ohm's law say, but i did with what i had under the hand ! )

For the one that know this shift register , you must know that it is possible use few of them one behind other. So you can control a lot of leds ( or other ) with only 3 wires ( + 2 more for positive and ground )

Here is the sketch i did for my needs :

Of course the red wire is positive and the black is negative ...

For the control, i've used the arduino's IDE, i've to do this in MRL with python now but it work !

 

 

It will  but , can i use the shiftOut fonction with MRL ?

By exemple something like arduino.shiftOut(DATA, SHIFT, LSBFIRST, chars[i]);

 

I've found a way, it work in MRL 

I've made my own shiftOut fonction ... Here is my python code :

 

# variables dependent on your setup

boardType = "atmega328p"  # atmega168 | atmega328p | atmega2560 | atmega1280 | atmega32u4
comPort = "COM4" # com4 for atmega328 com8 for mega2560
SHIFT = 5
LATCH = 6
DATA = 7

# start Arduino service named arduino
arduino = Runtime.createAndStart("arduino", "Arduino")
arduino.setBoard(boardType) # atmega168 | mega2560 | etc
arduino.connect(comPort)
# set pinMode
arduino.pinMode(SHIFT, Arduino.OUTPUT)
arduino.pinMode(LATCH, Arduino.OUTPUT)
arduino.pinMode(DATA, Arduino.OUTPUT)


# Create shiftOut fonction
def shiftOut(value):
	arduino.digitalWrite(LATCH, arduino.LOW) # Stop the copy
	for byte in value:
		if byte == 1 :
			arduino.digitalWrite(DATA,arduino.HIGH)  
		else :
			arduino.digitalWrite(DATA,arduino.LOW)
		arduino.digitalWrite(SHIFT, arduino.HIGH) 
		arduino.digitalWrite(SHIFT, arduino.LOW)
	arduino.digitalWrite(LATCH, arduino.HIGH) # copy    


def smile():
	shiftOut([1,1,0,1,1,1,0,0]) #	send data	
def notHappy():
	shiftOut([0,0,1,1,1,1,1,0]) #	send data
def speechLess():
	shiftOut([1,0,1,1,1,1,0,0]) # send data

while (1) :
	smile()
	sleep(1)
	notHappy()
	sleep(1)
	speechLess()
	sleep(1)

Your Python-Fu is most impressive :D

I've added shiftOut to the list of things to add to the Arduino service.  Thanks for this and your bot is really looking great !