Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Theshadowwalker91

  1. can anyone here help me. i am not sure how to use this code to turn on an led based on the serial data that is recived.
  2. also i ment how would i read the data and based on it turn on an led
  3. than you very much for the help. the code that RobG posted almost worked. but there was a little mistake, void shiftOut ( unsigned char ); and void pinWrite ( unsigned int, unsigned char ); should be void shiftOut ( unsigned long ); and void pinWrite ( unsigned int, unsigned long ); here is the code with the fixes for anyone who wants it. //*************************************************************************************** // MSP430 Driver for 74HC595 Shift Register // // Description; Drives 8 LED's with 3 digital pins of the MSP430, via a shift reg
  4. i see what you are trying to do but that doesnt change the amount of data sent out. when i upload it it does the same thing as the first ode but there is a delay at the end.
  5. i am daisy chaining them. i have the sout of one tied to the sin of the next. but with the code i posted i am only able to shift out a number as high as 255
  6. hello i am trying to use multiple shift registers and am having a hard time. this is the code i have to start with, but i am unsure how to modify it to use 3 shift registers //*************************************************************************************** // MSP430 Driver for 74HC595 Shift Register // // Description; Drives 8 LED's with 3 digital pins of the MSP430, via a shift register // // MSP430x2xx // //*************************************************************************************** #include //Define our pins #define DATA BIT0 // DS -> 1.0 #define CLOCK BI
  7. how would i go about reading serial data sent from an arduino. i the arduino is sending this Serial1.print ('<'); //start Serial1.print ('5'); // address 1-5 Serial1.print ("001"); // Foreground is Blue Serial1.print ("010"); // Background is Green Serial1.print ("100"); // Marker is Red Serial1.print ('>'); // end
  8. ya but i am not trying to do anything with an sd card. also i do not need to send data back to the arduino. i just need the msp to realize there is data coming in read it and if it is meant for that msp then do something based on the data and if it is not meant for that msp then to just ignore it.
  9. what i want to do is have an arduino send serial data to multiple msp430 launchpads. so that when the msp430 gets a certain message it will start doing a pattern and it will take care of light control while the arduino can do other things. any helpp would be appreciated. i also posted on the Arduino forum about this. what i need help with is reading serial data sent from the arduino and then doing a task based on the data. i am doing a Multi-drop set up with about 7 430s and one arduino mega. each 430 will be controlling 8 rgb leds via shift registers here is a rough id
  10. i tried both G2231 and G2252 with the G2231 i get the error "../lnk_msp430g2231.cmd", line 56: error: run placement fails for object ".bss", size 0x81 (page 0). Available ranges: RAM size: 0x80 unused: 0x4e max hole: 0x4c error: errors encountered during linking; "newtest.out" not built with the G2252 i get the error "../main.c", line 216: error: identifier "TIMERA0_VECTOR" is undefined 1 error detected in the compilation of "../main.c".
  11. i get an error when i try to compile. "../main.c", line 215: error: identifier "TIMERA0_VECTOR" is undefined 1 error detected in the compilation of "../main.c".
  12. hello again. i notice that the code was posted on a link. but it is for linux based software. is there anyone that can make this code work with CCS. // MSP430G2231 4X4X4 Matrix Cube code // uses three 74hc595 shift registers #include #include #include #include #include void Initializeports(void); static void __inline__delay(register unsigned int n); int binary2bcd16( unsigned char *bcd, int t ); // 16bit int display_led(int t, int display); void display_refresh( void ); // Time function varibles volatile unsigned char days = 0, hours = 0, minutes = 0, seconds = 0, e_hours = 0, e_
  13. thanks for the code but when i put it on the chip it just turns on both leds. no flashing or changing of rates.
  14. Isnt BIT3 on the launchpad aready debounced?? also my problem is if i hold the button it keeps adding to the variable.
  15. I see what you mean but i am not sure how to put it all together. i have made a rough code that does change the rate but i cant figure out how to make it come on and off with a button press. also when i press the button to change the rate it sometimes skips over most of them. here is the code. #include #define LED0 BIT0 #define LED1 BIT6 #define LED2 BIT1 #define LED3 BIT4 #define LED4 BIT5 #define BUTTON0 BIT7 #define BUTTON1 BIT3 int e; void delay_ms(unsigned int ms ){ unsigned in
  16. i can flash an led with the press of a button. i am using an if/else statement for reconizing the button press and i am useing the folowing code to control the leds void delay_ms(unsigned int ms ){ // Not really a milliseconds delay! unsigned int i; for (i = 0; i <= ms; i++){ __delay_cycles(500); } } void do_led( int led, int delay ) { P1OUT = led; delay_ms( delay ); } witch allows me to control the leds easier by typing do_led(BIT1 , 500) as an example. i just thought about maybe using a variable for time and maybe changing it with a second b
  17. hello. i am looking for some help with some code. i would like to flash an led with the push of a button but when you press a different button the rate of flash changes. i am using CCS to program a MSP430G2231.
  18. well i got it all wired up and in the car and the realized the the brake and signals share bulbs. so i need to work on my code. i need to figure out how to read two inputs and based on them do something. so if P2.3 is high and P2.4 is low then do one pattern. and if P2.3 is low and P2.4 is high do a different pattern. and if P2.3 is high and P2.4 is high do another.
  19. i was wondering is someone could port this code to work with the msp430 line of chips #include //#define TESTMODE // continuously sequence thru the LED's //#define BLINKY // blink LED on pin 13 #define SENSOR_PIN A0 // analog input pin for music #ifdef BLINKY #define LED_PIN 13 // digital output pin for LED #endif // BLINKY // trigger next frame when music amplitude > threshold // increase threshold to decrease sensitivity // decrease threshold to increase sensitivity int threshold = 5; // debouncing - filter out consecutive triggers that are too close // together to slow down th
  20. lol i just relised that lol thanks. works now.
  21. i also ran into anouther problem. when i hold a positive voltage to bit 0 of port 2 it does the sequence but it also plays the bit 1 sequence *it was my finger joining contacts. now i feel like an idiot lol
  22. i plan on using a UA78M33 (3/4 Pin 500mA Fixed 3.3V Positive Voltage Regulator) for power to the msp. there shouldnt be much current because i am using the uln2803. the leds will have resisters to operate at 12 v. but i am haveing problems. the code works when in my launchpad but when i put it on a circuit board that i made it wont work. it is getting 3.3volts and i did ground the reset but it wont seem to do anything. any thoughts?
  23. ok so i figured something out. i dont think it is the best way but it works. i am useing the MSP430G2252 along with a ULN2803. i am probally going to use resisters to drop the signal voltage from 12 to 3 volts. when you signal left the leds go from right to left. and the opposite for right. when you brake the leds go from center out to the edges and back again. and if you signal and brake it will do both sequences one after the other. if anyone has any tips on making the code better feel free to let me know. will post vid when done installing on car. #include "msp430g2252.h" #define LED0
  24. a friend of mine recently got a new car and he wants me to do somthing to it to make it different. he has a led light bar as a brake light in the middle of his trunk and i wanted to mod it. but i am haveing trubles. what i want to do is have it so when he presses the brakes the lights go from the center and out to each side and back to the middle. and when he signals it will go from one side to the other. i have a few options in msp chips. i have the MSP430G2211 MSP430G2131 MSP430G2231 MSP430G2252 and MSP430F2012. Any advice on witch chip to use. the led bar will be broke into 8 segments.
  • Create New...