Jump to content
43oh

semicolo

Members
  • Content Count

    137
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    semicolo got a reaction from energia in RGB mixing colors   
    Yes there's room for improvement, what about using variables to hold color increments, something like
    // debounce inputs and leave time to press another button if (digitalRead(redButton) == LOW || digitalRead(blueButton) == LOW || digitalRead(greenButton) == LOW) delay(50); // rinc, ginc, binc hold the r,g and b increments if (digitalRead(redButton) == LOW) rinc=5; else rinc=0; if (digitalRead(blueButton) == LOW) binc=5; else binc=0; if (digitalRead(greenButton) == LOW) ginc=5; else ginc=0; // go up to 255 int i; for (int i=0; i<51; i++) { r=r+rinc; g=g+ginc; b=b+binc; analogWrite(redLED, r); analogWrite(greenLED, g); analogWrite(blueLED, ; delay(30); } // go back down to 0 for (int i=0; i<51; i++) { r=r-rinc; g=g-ginc; b=b-binc; analogWrite(redLED, r); analogWrite(greenLED, g); analogWrite(blueLED, ; delay(30); } Not tested, I hope I didn't screw up the loop counts :-)
  2. Like
    semicolo got a reaction from Rei Vilo in Energia framework on Eclipse?   
    That's not quite what Rei has in mind, he wants to be able to add the arduino core to a CCS project to be able to use the IDE (debugger and all)
    The makefile probably uses the energia compiler/linker, but it may be a start to see if the Ti toolchain is compatible.
  3. Like
    semicolo got a reaction from lvagasi in Yet another music box simulator   
    Hi guys, I wanted to share this project I made for my step sister last christmas.
     
    After seeing some other music box project on hack a day, I found it would make a nice gift. I started experimenting on arduino and launchpad/g2553 using wavetable software synthesis.
    It looks like I suck at optimizing c code on microcontrollers, I had to decrease the output sample rate to 6250Hz on the arduino for 6 channels and down to 7812Hz on the launchpad and use fixed point numbers with 4 bits after the point, sound was not good enough to my taste.
    (here are the CCS sources if someone wants to play with them: yamb-launchpad.zip)
     
    Here's a picture of the finished project, the final board uses an MSP430g2452 and an Atmel AT25DF32 SPI flash memory that holds the 8bits unsigned samples played by the CPU at 31250Hz using a 62500Hz pwm.
    Everything's hidden in the side of a homemade wooden box. Mains voltage is held off by the switch unless the top of the box is open.

     
    And here's the sound used, it was generated on my pc by a console floating point version of the wavetable synthesis software.
     
    yamb.zip
  4. Like
    semicolo got a reaction from izdane in Yet another music box simulator   
    Hi guys, I wanted to share this project I made for my step sister last christmas.
     
    After seeing some other music box project on hack a day, I found it would make a nice gift. I started experimenting on arduino and launchpad/g2553 using wavetable software synthesis.
    It looks like I suck at optimizing c code on microcontrollers, I had to decrease the output sample rate to 6250Hz on the arduino for 6 channels and down to 7812Hz on the launchpad and use fixed point numbers with 4 bits after the point, sound was not good enough to my taste.
    (here are the CCS sources if someone wants to play with them: yamb-launchpad.zip)
     
    Here's a picture of the finished project, the final board uses an MSP430g2452 and an Atmel AT25DF32 SPI flash memory that holds the 8bits unsigned samples played by the CPU at 31250Hz using a 62500Hz pwm.
    Everything's hidden in the side of a homemade wooden box. Mains voltage is held off by the switch unless the top of the box is open.

     
    And here's the sound used, it was generated on my pc by a console floating point version of the wavetable synthesis software.
     
    yamb.zip
  5. Like
    semicolo got a reaction from bluehash in Yet another music box simulator   
    Hi guys, I wanted to share this project I made for my step sister last christmas.
     
    After seeing some other music box project on hack a day, I found it would make a nice gift. I started experimenting on arduino and launchpad/g2553 using wavetable software synthesis.
    It looks like I suck at optimizing c code on microcontrollers, I had to decrease the output sample rate to 6250Hz on the arduino for 6 channels and down to 7812Hz on the launchpad and use fixed point numbers with 4 bits after the point, sound was not good enough to my taste.
    (here are the CCS sources if someone wants to play with them: yamb-launchpad.zip)
     
    Here's a picture of the finished project, the final board uses an MSP430g2452 and an Atmel AT25DF32 SPI flash memory that holds the 8bits unsigned samples played by the CPU at 31250Hz using a 62500Hz pwm.
    Everything's hidden in the side of a homemade wooden box. Mains voltage is held off by the switch unless the top of the box is open.

     
    And here's the sound used, it was generated on my pc by a console floating point version of the wavetable synthesis software.
     
    yamb.zip
  6. Like
    semicolo got a reaction from bluehash in @ Bug   
    just at generates a lot of member="" for me too.
    No crash though
  7. Like
    semicolo got a reaction from energia in Problem using Arduino code in Energia   
    What about my my code? It just works I don't think you really need the sampling intervals to be spot on accuracy that you need a timer.
    If you really want it to be better just do
     
    // Very simple Arduino Lithium-ion battery capacity tester // from electronicsblog.net   #define LED GREEN_LED #define resistor 6.9   float capacity=0, value,voltage,current, time=0;   void measure (void) {     value= analogRead(0);     voltage=value/1024*5.0;     current = voltage/resistor;     capacity=capacity+current/3600;     time++;     Serial.print("Voltage= ");   Serial.print(voltage);     Serial.print("V Current= ");   Serial.print(current);     Serial.print("A Capacity= ");   Serial.print(capacity);   Serial.print("Ah ");     Serial.print("Discharging time= ");   Serial.print(time);   Serial.print("s ");     Serial.print("\n"); }   boolean x=false; unsigned long ms;   void setup() {     pinMode(LED, OUTPUT);     Serial.begin(9600);   ms = millis()+1000; };   void loop () {   digitalWrite(LED, x);   x=!x;   measure();   while (millis() < ms);   ms=millis()+1000; };
  8. Like
    semicolo got a reaction from energia in Problem using Arduino code in Energia   
    Just did some research, you could use the internal voltage reference for a a better accuracy
    analogReference(INTERNAL2V5)
    and use 1K/1K for the voltage reference.
    voltage would be
    voltage=value/1023*5
    You need *5 because the reference is 2.5V but you're using a 1/2 voltage divider (by the way I forgot to take the voltage into account on the post above)
  9. Like
    semicolo got a reaction from BDCoDE in Problem using Arduino code in Energia   
    Probably noise, the recommended way to get a sample is to put the cpu in sleep mode and wake up by the conversion interrupt, I don't know if energia is doing that.
    Also the noise can come from the supply.
    Did you add a voltage divider for the battery voltage? A fully charged battery is around 4.2V this could damage the MCU.
  10. Like
    semicolo got a reaction from BDCoDE in Problem using Arduino code in Energia   
    What about my my code? It just works I don't think you really need the sampling intervals to be spot on accuracy that you need a timer.
    If you really want it to be better just do
     
    // Very simple Arduino Lithium-ion battery capacity tester // from electronicsblog.net   #define LED GREEN_LED #define resistor 6.9   float capacity=0, value,voltage,current, time=0;   void measure (void) {     value= analogRead(0);     voltage=value/1024*5.0;     current = voltage/resistor;     capacity=capacity+current/3600;     time++;     Serial.print("Voltage= ");   Serial.print(voltage);     Serial.print("V Current= ");   Serial.print(current);     Serial.print("A Capacity= ");   Serial.print(capacity);   Serial.print("Ah ");     Serial.print("Discharging time= ");   Serial.print(time);   Serial.print("s ");     Serial.print("\n"); }   boolean x=false; unsigned long ms;   void setup() {     pinMode(LED, OUTPUT);     Serial.begin(9600);   ms = millis()+1000; };   void loop () {   digitalWrite(LED, x);   x=!x;   measure();   while (millis() < ms);   ms=millis()+1000; };
  11. Like
    semicolo got a reaction from kerplatz in GPIO pin sharing   
    shouldn't you set p2 to output at the beginning of sendbyte? looks like you set the pins direction at the end but not at the beginning.
     
    Nice hack by the way, I'll try to remember it.
  12. Like
    semicolo got a reaction from BDCoDE in Problem using Arduino code in Energia   
    Yes and remove all the timer stuff from setup
    So something like this
     
    // Very simple Arduino Lithium-ion battery capacity tester // from electronicsblog.net   #define LED 13 #define resistor 6.9   float capacity=0, value,voltage,current, time=0;   void measure (void) {     value= analogRead(0);     voltage=value/1024*5.0;     current = voltage/resistor;     capacity=capacity+current/3600;     time++;     Serial.print("Voltage= ");   Serial.print(voltage);     Serial.print("V Current= ");   Serial.print(current);     Serial.print("A Capacity= ");   Serial.print(capacity);   Serial.print("Ah ");     Serial.print("Discharging time= ");   Serial.print(time);   Serial.print("s ");     Serial.print("\n"); }   boolean x=false;   void setup() {     pinMode(LED, OUTPUT);     Serial.begin(9600);   };   void loop () {   digitalWrite(LED, x); x=!x; measure(); delay(1000); };
  13. Like
    semicolo got a reaction from roadrunner84 in Get 5V off USB on an MSP430 Launchpad   
    What spacing roadrunner84?
    0.1" don't fit on LP 1.5, it's slightly larger than 3 pins standard header
  14. Like
    semicolo got a reaction from olivluca in Get 5V off USB on an MSP430 Launchpad   
    Hi all, this is true on LP 1.5, maybe someone can confirm on older versions.
    I did a quick search about this on the forums and it doesn't seem to have been mentioned already.
     
    TP3 and TP1 near the USB connector allow you to get access to ground and the USB 5V
    TP3 is ground, TP1 is USB +5V.

     
    I soldered pins there on one of my LP for easy cable connection

  15. Like
    semicolo got a reaction from cubeberg in Get 5V off USB on an MSP430 Launchpad   
    Hi all, this is true on LP 1.5, maybe someone can confirm on older versions.
    I did a quick search about this on the forums and it doesn't seem to have been mentioned already.
     
    TP3 and TP1 near the USB connector allow you to get access to ground and the USB 5V
    TP3 is ground, TP1 is USB +5V.

     
    I soldered pins there on one of my LP for easy cable connection

  16. Like
    semicolo got a reaction from bluehash in Get 5V off USB on an MSP430 Launchpad   
    Hi all, this is true on LP 1.5, maybe someone can confirm on older versions.
    I did a quick search about this on the forums and it doesn't seem to have been mentioned already.
     
    TP3 and TP1 near the USB connector allow you to get access to ground and the USB 5V
    TP3 is ground, TP1 is USB +5V.

     
    I soldered pins there on one of my LP for easy cable connection

  17. Like
    semicolo got a reaction from oPossum in Square credit card swiper contains an MSP430G2412   
    Hi all, I opened one of these iphone/android card swiper from Square and found an MSP430G2412 in it

  18. Like
    semicolo got a reaction from pine in Square credit card swiper contains an MSP430G2412   
    Hi all, I opened one of these iphone/android card swiper from Square and found an MSP430G2412 in it

  19. Like
    semicolo got a reaction from RobG in Square credit card swiper contains an MSP430G2412   
    Hi all, I opened one of these iphone/android card swiper from Square and found an MSP430G2412 in it

  20. Like
    semicolo got a reaction from bluehash in Square credit card swiper contains an MSP430G2412   
    Hi all, I opened one of these iphone/android card swiper from Square and found an MSP430G2412 in it

×
×
  • Create New...